// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.30.0 // source: users.sql package sqlgen import ( "context" ) const insertUser = `-- name: InsertUser :one INSERT INTO users (username, password, created_at) VALUES (?, ?, ?) RETURNING id ` type InsertUserParams struct { Username string Password string CreatedAt int64 } func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (int64, error) { row := q.db.QueryRowContext(ctx, insertUser, arg.Username, arg.Password, arg.CreatedAt) var id int64 err := row.Scan(&id) return id, err } const selectUserByID = `-- name: SelectUserByID :one SELECT id, username, password, created_at FROM users WHERE id = ? LIMIT 1 ` func (q *Queries) SelectUserByID(ctx context.Context, id int64) (User, error) { row := q.db.QueryRowContext(ctx, selectUserByID, id) var i User err := row.Scan( &i.ID, &i.Username, &i.Password, &i.CreatedAt, ) return i, err } const selectUserByUsername = `-- name: SelectUserByUsername :one SELECT id, username, password, created_at FROM users WHERE username = ? LIMIT 1 ` func (q *Queries) SelectUserByUsername(ctx context.Context, username string) (User, error) { row := q.db.QueryRowContext(ctx, selectUserByUsername, username) var i User err := row.Scan( &i.ID, &i.Username, &i.Password, &i.CreatedAt, ) return i, err } const updateUser = `-- name: UpdateUser :exec UPDATE users SET username = ?, password = ? WHERE id = ? ` type UpdateUserParams struct { Username string Password string ID int64 } func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error { _, err := q.db.ExecContext(ctx, updateUser, arg.Username, arg.Password, arg.ID) return err }