mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
- Generate Server/db/dbgen/{events,plugins}.sql.go and full Server/db/pgdbgen/ (//go:build postgres gated)
- Implement PostgresStore EventStore and PluginStore methods in store/postgres.go
- Wire plugin host_events.go EventSink into hub broadcast path (SetPluginEventSink)
- Wire host_commands.go slash-command dispatcher: chat_command V1 handler + hub.SetPluginRegistry
- Add handlers_command.go + handlers_command_test.go for plugin slash-command dispatch
- Add reconnect_db_test.go: TestReconnect_BufferMiss_FallsBackToDBTier (cold-tier DB replay)
- Add otel-up/otel-down Makefile targets; docker-compose.otel.yml + prometheus.dev.yml
- Update PHASE_BC_LOCAL_TODO.md: mark in-session items complete; document remaining network-blocked steps
- Minor fixes: channel_handler access-control, router plugin handler wiring, service span instrumentation
49 lines
1.2 KiB
Go
49 lines
1.2 KiB
Go
//go:build postgres
|
|
|
|
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
// source: profile.sql
|
|
|
|
package pgdbgen
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
const updateUserPassword = `-- name: UpdateUserPassword :exec
|
|
UPDATE users SET password = $1 WHERE id = $2
|
|
`
|
|
|
|
type UpdateUserPasswordParams struct {
|
|
Password string `json:"password"`
|
|
ID int64 `json:"id"`
|
|
}
|
|
|
|
func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error {
|
|
_, err := q.db.Exec(ctx, updateUserPassword, arg.Password, arg.ID)
|
|
return err
|
|
}
|
|
|
|
const updateUserProfile = `-- name: UpdateUserProfile :execrows
|
|
|
|
UPDATE users SET username = $1, avatar = $2 WHERE id = $3
|
|
`
|
|
|
|
type UpdateUserProfileParams struct {
|
|
Username string `json:"username"`
|
|
Avatar *string `json:"avatar"`
|
|
ID int64 `json:"id"`
|
|
}
|
|
|
|
// PostgreSQL variants of the sqlite profile queries.
|
|
// UpdateUserProfile uses :execrows because postgres has no LastInsertId;
|
|
// the caller checks rows-affected for existence.
|
|
func (q *Queries) UpdateUserProfile(ctx context.Context, arg UpdateUserProfileParams) (int64, error) {
|
|
result, err := q.db.Exec(ctx, updateUserProfile, arg.Username, arg.Avatar, arg.ID)
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
return result.RowsAffected(), nil
|
|
}
|