lavender/database/profiles.sql.go

75 lines
1.6 KiB
Go
Raw Normal View History

2024-09-02 22:54:03 +01:00
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.25.0
// source: profiles.sql
package database
import (
"context"
"time"
)
const getProfile = `-- name: GetProfile :one
SELECT profiles.subject, profiles.name, profiles.picture, profiles.website, profiles.pronouns, profiles.birthdate, profiles.zone, profiles.locale, profiles.updated_at
FROM profiles
WHERE subject = ?
`
func (q *Queries) GetProfile(ctx context.Context, subject string) (Profile, error) {
row := q.db.QueryRowContext(ctx, getProfile, subject)
var i Profile
err := row.Scan(
&i.Subject,
&i.Name,
&i.Picture,
&i.Website,
&i.Pronouns,
&i.Birthdate,
&i.Zone,
&i.Locale,
&i.UpdatedAt,
)
return i, err
}
const modifyProfile = `-- name: ModifyProfile :exec
UPDATE profiles
SET name = ?,
picture = ?,
website = ?,
pronouns = ?,
birthdate = ?,
zone = ?,
locale = ?,
updated_at = ?
WHERE subject = ?
`
type ModifyProfileParams struct {
Name string `json:"name"`
Picture string `json:"picture"`
Website string `json:"website"`
Pronouns string `json:"pronouns"`
Birthdate interface{} `json:"birthdate"`
Zone string `json:"zone"`
Locale string `json:"locale"`
UpdatedAt time.Time `json:"updated_at"`
Subject string `json:"subject"`
}
func (q *Queries) ModifyProfile(ctx context.Context, arg ModifyProfileParams) error {
_, err := q.db.ExecContext(ctx, modifyProfile,
arg.Name,
arg.Picture,
arg.Website,
arg.Pronouns,
arg.Birthdate,
arg.Zone,
arg.Locale,
arg.UpdatedAt,
arg.Subject,
)
return err
}