i wanted to add full cahce but i dont have time :(

This commit is contained in:
gitGnome
2026-03-26 14:21:30 +01:00
parent ca0b85cdb7
commit 4ccaf627b4
3 changed files with 37 additions and 18 deletions
+8
View File
@@ -73,6 +73,14 @@ func DbSaveClientWithoutGroups(ctx context.Context, client *Client) error {
return err
}
func DbGetIdByClientName(ctx context.Context, name string) (uint32, error) {
var id uint32
err := dbConn.QueryRow(ctx, `
SELECT id FROM clients WHERE name = $1
`, name).Scan(&id)
return id, err
}
func DbSetClientByName(ctx context.Context, client *Client) error {
err := dbConn.QueryRow(ctx, `
SELECT name, pass_hash, color_red, color_green, color_blue, created_at FROM clients WHERE name = $1