mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
- Add sqlc.yaml config (SQLite engine, db/queries/sqlite/, db/dbgen/ output) - Pin sqlc v1.30.0 in sqlc.version - Add Makefile with sqlc-install, sqlc-generate, sqlc-verify targets - Write 14 SQL query files covering all DB domains (users, sessions, invites, channels, messages, reactions, voice, roles, attachments, admin, dm, blocks, lockouts, profile) - Commit generated db/dbgen/ package (querier interface + typed fns) - FTS5 search queries remain hand-written in message_queries.go; transactional multi-step operations unchanged in Go
40 lines
1007 B
Go
40 lines
1007 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
// source: profile.sql
|
|
|
|
package dbgen
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
)
|
|
|
|
const updateUserPassword = `-- name: UpdateUserPassword :exec
|
|
UPDATE users SET password = ? WHERE id = ?
|
|
`
|
|
|
|
type UpdateUserPasswordParams struct {
|
|
Password string `json:"password"`
|
|
ID int64 `json:"id"`
|
|
}
|
|
|
|
func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error {
|
|
_, err := q.db.ExecContext(ctx, updateUserPassword, arg.Password, arg.ID)
|
|
return err
|
|
}
|
|
|
|
const updateUserProfile = `-- name: UpdateUserProfile :execresult
|
|
UPDATE users SET username = ?, avatar = ? WHERE id = ?
|
|
`
|
|
|
|
type UpdateUserProfileParams struct {
|
|
Username string `json:"username"`
|
|
Avatar *string `json:"avatar"`
|
|
ID int64 `json:"id"`
|
|
}
|
|
|
|
func (q *Queries) UpdateUserProfile(ctx context.Context, arg UpdateUserProfileParams) (sql.Result, error) {
|
|
return q.db.ExecContext(ctx, updateUserProfile, arg.Username, arg.Avatar, arg.ID)
|
|
}
|