update sqlc gen
This commit is contained in:
parent
0b725ece22
commit
3a299020fd
@ -134,7 +134,6 @@ SELECT
|
|||||||
p.amount,
|
p.amount,
|
||||||
p.created_at,
|
p.created_at,
|
||||||
a.id,
|
a.id,
|
||||||
a.email,
|
|
||||||
qz.config
|
qz.config
|
||||||
FROM
|
FROM
|
||||||
privileges AS p
|
privileges AS p
|
||||||
@ -144,7 +143,7 @@ WHERE
|
|||||||
qz.id = $1;
|
qz.id = $1;
|
||||||
|
|
||||||
-- name: CreateAccount :one
|
-- name: CreateAccount :one
|
||||||
INSERT INTO account (id, user_id, email, created_at, deleted) VALUES ($1, $2, $3, $4, $5) RETURNING *;;
|
INSERT INTO account (id, user_id, created_at, deleted) VALUES ($1, $2, $3, $4) RETURNING *;
|
||||||
|
|
||||||
-- name: DeletePrivilegeByAccID :exec
|
-- name: DeletePrivilegeByAccID :exec
|
||||||
DELETE FROM privileges WHERE account_id = $1;
|
DELETE FROM privileges WHERE account_id = $1;
|
||||||
@ -248,7 +247,6 @@ UPDATE privileges SET amount = $1 WHERE id = $2;
|
|||||||
SELECT
|
SELECT
|
||||||
a.id,
|
a.id,
|
||||||
a.user_id,
|
a.user_id,
|
||||||
a.email,
|
|
||||||
a.created_at,
|
a.created_at,
|
||||||
COALESCE(p.ID,0),
|
COALESCE(p.ID,0),
|
||||||
coalesce(p.privilegeid,''),
|
coalesce(p.privilegeid,''),
|
||||||
|
@ -15,7 +15,6 @@ import (
|
|||||||
type Account struct {
|
type Account struct {
|
||||||
ID uuid.UUID `db:"id" json:"id"`
|
ID uuid.UUID `db:"id" json:"id"`
|
||||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||||
Email sql.NullString `db:"email" json:"email"`
|
|
||||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||||
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
||||||
}
|
}
|
||||||
@ -62,6 +61,16 @@ type Field struct {
|
|||||||
Createdat sql.NullTime `db:"createdat" json:"createdat"`
|
Createdat sql.NullTime `db:"createdat" json:"createdat"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Leadtarget struct {
|
||||||
|
ID int64 `db:"id" json:"id"`
|
||||||
|
Accountid string `db:"accountid" json:"accountid"`
|
||||||
|
Type string `db:"type" json:"type"`
|
||||||
|
Quizid int32 `db:"quizid" json:"quizid"`
|
||||||
|
Target string `db:"target" json:"target"`
|
||||||
|
Deleted bool `db:"deleted" json:"deleted"`
|
||||||
|
Createdat sql.NullTime `db:"createdat" json:"createdat"`
|
||||||
|
}
|
||||||
|
|
||||||
type Pipeline struct {
|
type Pipeline struct {
|
||||||
ID int64 `db:"id" json:"id"`
|
ID int64 `db:"id" json:"id"`
|
||||||
Amoid int32 `db:"amoid" json:"amoid"`
|
Amoid int32 `db:"amoid" json:"amoid"`
|
||||||
|
@ -25,22 +25,15 @@ type AccountPaginationParams struct {
|
|||||||
Offset int32 `db:"offset" json:"offset"`
|
Offset int32 `db:"offset" json:"offset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AccountPaginationRow struct {
|
func (q *Queries) AccountPagination(ctx context.Context, arg AccountPaginationParams) ([]Account, error) {
|
||||||
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"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (q *Queries) AccountPagination(ctx context.Context, arg AccountPaginationParams) ([]AccountPaginationRow, error) {
|
|
||||||
rows, err := q.db.QueryContext(ctx, accountPagination, arg.Limit, arg.Offset)
|
rows, err := q.db.QueryContext(ctx, accountPagination, arg.Limit, arg.Offset)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
var items []AccountPaginationRow
|
var items []Account
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var i AccountPaginationRow
|
var i Account
|
||||||
if err := rows.Scan(
|
if err := rows.Scan(
|
||||||
&i.ID,
|
&i.ID,
|
||||||
&i.UserID,
|
&i.UserID,
|
||||||
@ -748,13 +741,12 @@ func (q *Queries) CopyQuizQuestions(ctx context.Context, arg CopyQuizQuestionsPa
|
|||||||
}
|
}
|
||||||
|
|
||||||
const createAccount = `-- name: CreateAccount :one
|
const createAccount = `-- name: CreateAccount :one
|
||||||
INSERT INTO account (id, user_id, email, created_at, deleted) VALUES ($1, $2, $3, $4, $5) RETURNING id, user_id, email, created_at, deleted
|
INSERT INTO account (id, user_id, created_at, deleted) VALUES ($1, $2, $3, $4) RETURNING id, user_id, created_at, deleted
|
||||||
`
|
`
|
||||||
|
|
||||||
type CreateAccountParams struct {
|
type CreateAccountParams struct {
|
||||||
ID uuid.UUID `db:"id" json:"id"`
|
ID uuid.UUID `db:"id" json:"id"`
|
||||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||||
Email sql.NullString `db:"email" json:"email"`
|
|
||||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||||
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
||||||
}
|
}
|
||||||
@ -763,7 +755,6 @@ func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) (A
|
|||||||
row := q.db.QueryRowContext(ctx, createAccount,
|
row := q.db.QueryRowContext(ctx, createAccount,
|
||||||
arg.ID,
|
arg.ID,
|
||||||
arg.UserID,
|
arg.UserID,
|
||||||
arg.Email,
|
|
||||||
arg.CreatedAt,
|
arg.CreatedAt,
|
||||||
arg.Deleted,
|
arg.Deleted,
|
||||||
)
|
)
|
||||||
@ -771,7 +762,6 @@ func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) (A
|
|||||||
err := row.Scan(
|
err := row.Scan(
|
||||||
&i.ID,
|
&i.ID,
|
||||||
&i.UserID,
|
&i.UserID,
|
||||||
&i.Email,
|
|
||||||
&i.CreatedAt,
|
&i.CreatedAt,
|
||||||
&i.Deleted,
|
&i.Deleted,
|
||||||
)
|
)
|
||||||
@ -1309,7 +1299,6 @@ const getAccAndPrivilegeByEmail = `-- name: GetAccAndPrivilegeByEmail :one
|
|||||||
SELECT
|
SELECT
|
||||||
a.id,
|
a.id,
|
||||||
a.user_id,
|
a.user_id,
|
||||||
a.email,
|
|
||||||
a.created_at,
|
a.created_at,
|
||||||
COALESCE(p.ID,0),
|
COALESCE(p.ID,0),
|
||||||
coalesce(p.privilegeid,''),
|
coalesce(p.privilegeid,''),
|
||||||
@ -1325,7 +1314,6 @@ WHERE
|
|||||||
type GetAccAndPrivilegeByEmailRow struct {
|
type GetAccAndPrivilegeByEmailRow struct {
|
||||||
ID uuid.UUID `db:"id" json:"id"`
|
ID uuid.UUID `db:"id" json:"id"`
|
||||||
UserID sql.NullString `db:"user_id" json:"user_id"`
|
UserID sql.NullString `db:"user_id" json:"user_id"`
|
||||||
Email sql.NullString `db:"email" json:"email"`
|
|
||||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||||
ID_2 int32 `db:"id_2" json:"id_2"`
|
ID_2 int32 `db:"id_2" json:"id_2"`
|
||||||
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
Privilegeid string `db:"privilegeid" json:"privilegeid"`
|
||||||
@ -1339,7 +1327,6 @@ func (q *Queries) GetAccAndPrivilegeByEmail(ctx context.Context, userID sql.Null
|
|||||||
err := row.Scan(
|
err := row.Scan(
|
||||||
&i.ID,
|
&i.ID,
|
||||||
&i.UserID,
|
&i.UserID,
|
||||||
&i.Email,
|
|
||||||
&i.CreatedAt,
|
&i.CreatedAt,
|
||||||
&i.ID_2,
|
&i.ID_2,
|
||||||
&i.Privilegeid,
|
&i.Privilegeid,
|
||||||
@ -1894,7 +1881,6 @@ SELECT
|
|||||||
p.amount,
|
p.amount,
|
||||||
p.created_at,
|
p.created_at,
|
||||||
a.id,
|
a.id,
|
||||||
a.email,
|
|
||||||
qz.config
|
qz.config
|
||||||
FROM
|
FROM
|
||||||
privileges AS p
|
privileges AS p
|
||||||
@ -1910,7 +1896,6 @@ type GetPrivilegesQuizAccountRow struct {
|
|||||||
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
Amount sql.NullInt32 `db:"amount" json:"amount"`
|
||||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||||
ID uuid.UUID `db:"id" json:"id"`
|
ID uuid.UUID `db:"id" json:"id"`
|
||||||
Email sql.NullString `db:"email" json:"email"`
|
|
||||||
Config sql.NullString `db:"config" json:"config"`
|
Config sql.NullString `db:"config" json:"config"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1929,7 +1914,6 @@ func (q *Queries) GetPrivilegesQuizAccount(ctx context.Context, id int64) ([]Get
|
|||||||
&i.Amount,
|
&i.Amount,
|
||||||
&i.CreatedAt,
|
&i.CreatedAt,
|
||||||
&i.ID,
|
&i.ID,
|
||||||
&i.Email,
|
|
||||||
&i.Config,
|
&i.Config,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user