11// Code generated by sqlc. DO NOT EDIT.
22
3- import type { Sql as SQL } from "postgres" ;
3+ import type { Sql } from "postgres" ;
44
55export const getAuthorQuery = `-- name: GetAuthor :one
66SELECT id, name, bio FROM authors
@@ -16,13 +16,7 @@ export interface GetAuthorRow {
1616 bio : string | null ;
1717}
1818
19- export type GetAuthorRowValues = [
20- number ,
21- string ,
22- string | null
23- ] ;
24-
25- export async function getAuthor ( sql : SQL , args : GetAuthorArgs ) : Promise < GetAuthorRow | null > {
19+ export async function getAuthor ( sql : Sql , args : GetAuthorArgs ) : Promise < GetAuthorRow | null > {
2620 const rows = await sql . unsafe ( getAuthorQuery , [ args . id ] ) as GetAuthorRow [ ] ;
2721 if ( rows . length !== 1 ) {
2822 return null ;
@@ -40,13 +34,7 @@ export interface ListAuthorsRow {
4034 bio : string | null ;
4135}
4236
43- export type ListAuthorsRowValues = [
44- number ,
45- string ,
46- string | null
47- ] ;
48-
49- export async function listAuthors ( sql : SQL ) : Promise < ListAuthorsRow [ ] > {
37+ export async function listAuthors ( sql : Sql ) : Promise < ListAuthorsRow [ ] > {
5038 return await sql . unsafe ( listAuthorsQuery , [ ] ) as ListAuthorsRow [ ] ;
5139}
5240
@@ -69,13 +57,7 @@ export interface CreateAuthorRow {
6957 bio : string | null ;
7058}
7159
72- export type CreateAuthorRowValues = [
73- number ,
74- string ,
75- string | null
76- ] ;
77-
78- export async function createAuthor ( sql : SQL , args : CreateAuthorArgs ) : Promise < CreateAuthorRow | null > {
60+ export async function createAuthor ( sql : Sql , args : CreateAuthorArgs ) : Promise < CreateAuthorRow | null > {
7961 const rows = await sql . unsafe ( createAuthorQuery , [ args . name , args . bio ] ) as CreateAuthorRow [ ] ;
8062 if ( rows . length !== 1 ) {
8163 return null ;
@@ -91,7 +73,7 @@ export interface DeleteAuthorArgs {
9173 id : number ;
9274}
9375
94- export async function deleteAuthor ( sql : SQL , args : DeleteAuthorArgs ) : Promise < void > {
76+ export async function deleteAuthor ( sql : Sql , args : DeleteAuthorArgs ) : Promise < void > {
9577 await sql . unsafe ( deleteAuthorQuery , [ args . id ] ) ;
9678}
9779
0 commit comments