mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-09 13:11:48 -06:00
48 lines
923 B
Go
48 lines
923 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.25.0
|
|
// source: libraries.sql
|
|
|
|
package sql
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
const createLibrary = `-- name: CreateLibrary :exec
|
|
INSERT INTO libraries(
|
|
id, owner, display_name
|
|
) VALUES(
|
|
$1, $2, $3
|
|
)
|
|
`
|
|
|
|
type CreateLibraryParams struct {
|
|
ID uuid.UUID
|
|
Owner int32
|
|
DisplayName string
|
|
}
|
|
|
|
func (q *Queries) CreateLibrary(ctx context.Context, arg CreateLibraryParams) error {
|
|
_, err := q.db.Exec(ctx, createLibrary, arg.ID, arg.Owner, arg.DisplayName)
|
|
return err
|
|
}
|
|
|
|
const libraryById = `-- name: LibraryById :one
|
|
SELECT id, owner, display_name, deleted from libraries where id = $1
|
|
`
|
|
|
|
func (q *Queries) LibraryById(ctx context.Context, id uuid.UUID) (Library, error) {
|
|
row := q.db.QueryRow(ctx, libraryById, id)
|
|
var i Library
|
|
err := row.Scan(
|
|
&i.ID,
|
|
&i.Owner,
|
|
&i.DisplayName,
|
|
&i.Deleted,
|
|
)
|
|
return i, err
|
|
}
|