Merged in feature/textextract (pull request #108)
Start adding Textract + UUID changes * base * startclient * ts * short * tests
This commit is contained in:
@@ -8,7 +8,7 @@ package repository
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
const addClientCanSync = `-- name: AddClientCanSync :exec
|
||||
@@ -16,8 +16,8 @@ INSERT INTO clientCanSync (canSync, clientId) VALUES ($1, $2)
|
||||
`
|
||||
|
||||
type AddClientCanSyncParams struct {
|
||||
Cansync bool `db:"cansync"`
|
||||
Clientid pgtype.UUID `db:"clientid"`
|
||||
Cansync bool `db:"cansync"`
|
||||
Clientid uuid.UUID `db:"clientid"`
|
||||
}
|
||||
|
||||
// AddClientCanSync
|
||||
@@ -40,9 +40,9 @@ type CreateClientParams struct {
|
||||
// CreateClient
|
||||
//
|
||||
// INSERT INTO clients (externalId, name) VALUES ($1, $2) RETURNING id
|
||||
func (q *Queries) CreateClient(ctx context.Context, arg *CreateClientParams) (pgtype.UUID, error) {
|
||||
func (q *Queries) CreateClient(ctx context.Context, arg *CreateClientParams) (uuid.UUID, error) {
|
||||
row := q.db.QueryRow(ctx, createClient, arg.Externalid, arg.Name)
|
||||
var id pgtype.UUID
|
||||
var id uuid.UUID
|
||||
err := row.Scan(&id)
|
||||
return id, err
|
||||
}
|
||||
@@ -54,7 +54,7 @@ SELECT id, externalid, name, cansync FROM fullClients WHERE id = $1
|
||||
// GetClient
|
||||
//
|
||||
// SELECT id, externalid, name, cansync FROM fullClients WHERE id = $1
|
||||
func (q *Queries) GetClient(ctx context.Context, id pgtype.UUID) (*Fullclient, error) {
|
||||
func (q *Queries) GetClient(ctx context.Context, id uuid.UUID) (*Fullclient, error) {
|
||||
row := q.db.QueryRow(ctx, getClient, id)
|
||||
var i Fullclient
|
||||
err := row.Scan(
|
||||
@@ -278,7 +278,7 @@ SELECT (
|
||||
// NOT EXISTS (SELECT 1 FROM dependency_check)
|
||||
// )::bool
|
||||
// )::bool as is_synced
|
||||
func (q *Queries) IsClientSynced(ctx context.Context, dollar_1 pgtype.UUID) (bool, error) {
|
||||
func (q *Queries) IsClientSynced(ctx context.Context, dollar_1 *uuid.UUID) (bool, error) {
|
||||
row := q.db.QueryRow(ctx, isClientSynced, dollar_1)
|
||||
var is_synced bool
|
||||
err := row.Scan(&is_synced)
|
||||
@@ -290,8 +290,8 @@ UPDATE clients SET name = $1 WHERE id = $2
|
||||
`
|
||||
|
||||
type UpdateClientParams struct {
|
||||
Name string `db:"name"`
|
||||
ID pgtype.UUID `db:"id"`
|
||||
Name string `db:"name"`
|
||||
ID uuid.UUID `db:"id"`
|
||||
}
|
||||
|
||||
// UpdateClient
|
||||
|
||||
Reference in New Issue
Block a user