Merged in feature/parallellogqueries (pull request #132)
Testing Tweaks * parallel * slowestquery * split * cleanup * health * dynamiccores * go * profile * timeout * commitmychanges * taskfile * sqlcheckstart * client * cost * ctxtimeout
This commit is contained in:
@@ -27,33 +27,33 @@ func (q *Queries) AddClientCanSync(ctx context.Context, arg *AddClientCanSyncPar
|
||||
}
|
||||
|
||||
const createClient = `-- name: CreateClient :exec
|
||||
INSERT INTO clients (id, name) VALUES ($1, $2)
|
||||
INSERT INTO clients (clientId, name) VALUES ($1, $2)
|
||||
`
|
||||
|
||||
type CreateClientParams struct {
|
||||
ID string `db:"id"`
|
||||
Name string `db:"name"`
|
||||
Clientid string `db:"clientid"`
|
||||
Name string `db:"name"`
|
||||
}
|
||||
|
||||
// CreateClient
|
||||
//
|
||||
// INSERT INTO clients (id, name) VALUES ($1, $2)
|
||||
// INSERT INTO clients (clientId, name) VALUES ($1, $2)
|
||||
func (q *Queries) CreateClient(ctx context.Context, arg *CreateClientParams) error {
|
||||
_, err := q.db.Exec(ctx, createClient, arg.ID, arg.Name)
|
||||
_, err := q.db.Exec(ctx, createClient, arg.Clientid, arg.Name)
|
||||
return err
|
||||
}
|
||||
|
||||
const getClient = `-- name: GetClient :one
|
||||
SELECT id, name, cansync FROM fullClients WHERE id = $1
|
||||
SELECT clientid, name, cansync FROM fullClients WHERE clientId = $1
|
||||
`
|
||||
|
||||
// GetClient
|
||||
//
|
||||
// SELECT id, name, cansync FROM fullClients WHERE id = $1
|
||||
func (q *Queries) GetClient(ctx context.Context, id string) (*Fullclient, error) {
|
||||
row := q.db.QueryRow(ctx, getClient, id)
|
||||
// SELECT clientid, name, cansync FROM fullClients WHERE clientId = $1
|
||||
func (q *Queries) GetClient(ctx context.Context, clientid string) (*Fullclient, error) {
|
||||
row := q.db.QueryRow(ctx, getClient, clientid)
|
||||
var i Fullclient
|
||||
err := row.Scan(&i.ID, &i.Name, &i.Cansync)
|
||||
err := row.Scan(&i.Clientid, &i.Name, &i.Cansync)
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -258,18 +258,18 @@ func (q *Queries) IsClientSynced(ctx context.Context, dollar_1 *string) (bool, e
|
||||
}
|
||||
|
||||
const updateClient = `-- name: UpdateClient :exec
|
||||
UPDATE clients SET name = $1 WHERE id = $2
|
||||
UPDATE clients SET name = $1 WHERE clientId = $2
|
||||
`
|
||||
|
||||
type UpdateClientParams struct {
|
||||
Name string `db:"name"`
|
||||
ID string `db:"id"`
|
||||
Name string `db:"name"`
|
||||
Clientid string `db:"clientid"`
|
||||
}
|
||||
|
||||
// UpdateClient
|
||||
//
|
||||
// UPDATE clients SET name = $1 WHERE id = $2
|
||||
// UPDATE clients SET name = $1 WHERE clientId = $2
|
||||
func (q *Queries) UpdateClient(ctx context.Context, arg *UpdateClientParams) error {
|
||||
_, err := q.db.Exec(ctx, updateClient, arg.Name, arg.ID)
|
||||
_, err := q.db.Exec(ctx, updateClient, arg.Name, arg.Clientid)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user