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