update sqlc gen
This commit is contained in:
parent
d93b846bfc
commit
8fb3a4a1d3
@ -13,10 +13,10 @@ import (
|
||||
)
|
||||
|
||||
type Account struct {
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
UserID string `db:"user_id" json:"user_id"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
Deleted bool `db:"deleted" json:"deleted"`
|
||||
}
|
||||
|
||||
type Accountsamo struct {
|
||||
@ -102,12 +102,12 @@ type Pipeline struct {
|
||||
}
|
||||
|
||||
type Privilege struct {
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid sql.NullString `db:"privilegeid" json:"privilegeid"`
|
||||
AccountID uuid.NullUUID `db:"account_id" json:"account_id"`
|
||||
PrivilegeName sql.NullString `db:"privilege_name" json:"privilege_name"`
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
AccountID uuid.UUID `db:"account_id" json:"account_id"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
}
|
||||
|
||||
type Question struct {
|
||||
|
@ -173,9 +173,9 @@ WHERE privilege_name = $2
|
||||
`
|
||||
|
||||
type CheckAndAddDefaultParams struct {
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
PrivilegeName sql.NullString `db:"privilege_name" json:"privilege_name"`
|
||||
Amount_2 sql.NullInt32 `db:"amount_2" json:"amount_2"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount_2 int32 `db:"amount_2" json:"amount_2"`
|
||||
}
|
||||
|
||||
func (q *Queries) CheckAndAddDefault(ctx context.Context, arg CheckAndAddDefaultParams) error {
|
||||
@ -655,10 +655,10 @@ INSERT INTO account (id, user_id, created_at, deleted) VALUES ($1, $2, $3, $4) R
|
||||
`
|
||||
|
||||
type CreateAccountParams struct {
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
UserID string `db:"user_id" json:"user_id"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
Deleted bool `db:"deleted" json:"deleted"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) (Account, error) {
|
||||
@ -799,8 +799,8 @@ RETURNING p.id, p.privilegeID, p.account_id, p.privilege_name, p.amount, p.creat
|
||||
`
|
||||
|
||||
type DecrementManualParams struct {
|
||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||
Privilegeid sql.NullString `db:"privilegeid" json:"privilegeid"`
|
||||
UserID string `db:"user_id" json:"user_id"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
}
|
||||
|
||||
func (q *Queries) DecrementManual(ctx context.Context, arg DecrementManualParams) (Privilege, error) {
|
||||
@ -857,7 +857,7 @@ const deletePrivilegeByAccID = `-- name: DeletePrivilegeByAccID :exec
|
||||
DELETE FROM privileges WHERE account_id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) DeletePrivilegeByAccID(ctx context.Context, accountID uuid.NullUUID) error {
|
||||
func (q *Queries) DeletePrivilegeByAccID(ctx context.Context, accountID uuid.UUID) error {
|
||||
_, err := q.db.ExecContext(ctx, deletePrivilegeByAccID, accountID)
|
||||
return err
|
||||
}
|
||||
@ -1279,16 +1279,16 @@ WHERE
|
||||
`
|
||||
|
||||
type GetAccAndPrivilegeByEmailRow struct {
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
ID_2 int32 `db:"id_2" json:"id_2"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt_2 sql.NullTime `db:"created_at_2" json:"created_at_2"`
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
UserID string `db:"user_id" json:"user_id"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
ID_2 int32 `db:"id_2" json:"id_2"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt_2 time.Time `db:"created_at_2" json:"created_at_2"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetAccAndPrivilegeByEmail(ctx context.Context, userID sql.NullString) (GetAccAndPrivilegeByEmailRow, error) {
|
||||
func (q *Queries) GetAccAndPrivilegeByEmail(ctx context.Context, userID string) (GetAccAndPrivilegeByEmailRow, error) {
|
||||
row := q.db.QueryRowContext(ctx, getAccAndPrivilegeByEmail, userID)
|
||||
var i GetAccAndPrivilegeByEmailRow
|
||||
err := row.Scan(
|
||||
@ -1315,18 +1315,18 @@ WHERE a.user_id = $1
|
||||
`
|
||||
|
||||
type GetAccountWithPrivilegesRow struct {
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
||||
PrivilegeID int32 `db:"privilege_id" json:"privilege_id"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
PrivilegeCreatedAt sql.NullTime `db:"privilege_created_at" json:"privilege_created_at"`
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
UserID string `db:"user_id" json:"user_id"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
Deleted bool `db:"deleted" json:"deleted"`
|
||||
PrivilegeID int32 `db:"privilege_id" json:"privilege_id"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
PrivilegeCreatedAt time.Time `db:"privilege_created_at" json:"privilege_created_at"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetAccountWithPrivileges(ctx context.Context, userID sql.NullString) ([]GetAccountWithPrivilegesRow, error) {
|
||||
func (q *Queries) GetAccountWithPrivileges(ctx context.Context, userID string) ([]GetAccountWithPrivilegesRow, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getAccountWithPrivileges, userID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -1590,15 +1590,15 @@ WHERE p.amount = 0
|
||||
`
|
||||
|
||||
type GetExpiredCountPrivilegeRow struct {
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid sql.NullString `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName sql.NullString `db:"privilege_name" json:"privilege_name"`
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
UserID string `db:"user_id" json:"user_id"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetExpiredCountPrivilege(ctx context.Context, privilegeid sql.NullString) ([]GetExpiredCountPrivilegeRow, error) {
|
||||
func (q *Queries) GetExpiredCountPrivilege(ctx context.Context, privilegeid string) ([]GetExpiredCountPrivilegeRow, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getExpiredCountPrivilege, privilegeid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -1637,15 +1637,15 @@ WHERE p.created_at + p.amount * interval '1 day' < NOW()
|
||||
`
|
||||
|
||||
type GetExpiredDayPrivilegeRow struct {
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid sql.NullString `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName sql.NullString `db:"privilege_name" json:"privilege_name"`
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
UserID string `db:"user_id" json:"user_id"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetExpiredDayPrivilege(ctx context.Context, privilegeid sql.NullString) ([]GetExpiredDayPrivilegeRow, error) {
|
||||
func (q *Queries) GetExpiredDayPrivilege(ctx context.Context, privilegeid string) ([]GetExpiredDayPrivilegeRow, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getExpiredDayPrivilege, privilegeid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -1920,14 +1920,14 @@ SELECT id,privilegeID,privilege_name,amount, created_at FROM privileges WHERE ac
|
||||
`
|
||||
|
||||
type GetPrivilegesByAccountIDRow struct {
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid sql.NullString `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName sql.NullString `db:"privilege_name" json:"privilege_name"`
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetPrivilegesByAccountID(ctx context.Context, accountID uuid.NullUUID) ([]GetPrivilegesByAccountIDRow, error) {
|
||||
func (q *Queries) GetPrivilegesByAccountID(ctx context.Context, accountID uuid.UUID) ([]GetPrivilegesByAccountIDRow, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getPrivilegesByAccountID, accountID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -1961,14 +1961,14 @@ SELECT p.id,p.privilegeID,p.privilege_name,p.amount, p.created_at FROM privilege
|
||||
`
|
||||
|
||||
type GetPrivilegesByAccountIDWCRow struct {
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid sql.NullString `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName sql.NullString `db:"privilege_name" json:"privilege_name"`
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetPrivilegesByAccountIDWC(ctx context.Context, userID sql.NullString) ([]GetPrivilegesByAccountIDWCRow, error) {
|
||||
func (q *Queries) GetPrivilegesByAccountIDWC(ctx context.Context, userID string) ([]GetPrivilegesByAccountIDWCRow, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getPrivilegesByAccountIDWC, userID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -2014,10 +2014,10 @@ WHERE
|
||||
`
|
||||
|
||||
type GetPrivilegesQuizAccountRow struct {
|
||||
Privilegeid sql.NullString `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName sql.NullString `db:"privilege_name" json:"privilege_name"`
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
Config sql.NullString `db:"config" json:"config"`
|
||||
}
|
||||
@ -3085,11 +3085,11 @@ INSERT INTO privileges (privilegeID, account_id, privilege_name, amount, created
|
||||
`
|
||||
|
||||
type InsertPrivilegeParams struct {
|
||||
Privilegeid sql.NullString `db:"privilegeid" json:"privilegeid"`
|
||||
AccountID uuid.NullUUID `db:"account_id" json:"account_id"`
|
||||
PrivilegeName sql.NullString `db:"privilege_name" json:"privilege_name"`
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
AccountID uuid.UUID `db:"account_id" json:"account_id"`
|
||||
PrivilegeName string `db:"privilege_name" json:"privilege_name"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
}
|
||||
|
||||
func (q *Queries) InsertPrivilege(ctx context.Context, arg InsertPrivilegeParams) error {
|
||||
@ -3763,10 +3763,10 @@ UPDATE privileges SET amount = $1, created_at = $2 WHERE account_id = $3 AND pri
|
||||
`
|
||||
|
||||
type UpdatePrivilegeParams struct {
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
AccountID uuid.NullUUID `db:"account_id" json:"account_id"`
|
||||
Privilegeid sql.NullString `db:"privilegeid" json:"privilegeid"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
AccountID uuid.UUID `db:"account_id" json:"account_id"`
|
||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdatePrivilege(ctx context.Context, arg UpdatePrivilegeParams) error {
|
||||
@ -3784,8 +3784,8 @@ UPDATE privileges SET amount = $1 WHERE id = $2
|
||||
`
|
||||
|
||||
type UpdatePrivilegeAmountParams struct {
|
||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Amount int32 `db:"amount" json:"amount"`
|
||||
ID int32 `db:"id" json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdatePrivilegeAmount(ctx context.Context, arg UpdatePrivilegeAmountParams) error {
|
||||
|
Loading…
Reference in New Issue
Block a user