|
| 1 | +/* TypeScript file generated from BookService__sql.res by genType. */ |
| 2 | + |
| 3 | +/* eslint-disable */ |
| 4 | +/* tslint:disable */ |
| 5 | + |
| 6 | +constBookService__sqlJS=require('./BookService__sql.js'); |
| 7 | + |
| 8 | +importtype{Pg_Client_tasPgTyped_Pg_Client_t}from'pgtyped-rescript/src/res/PgTyped.gen'; |
| 9 | + |
| 10 | +importtype{tasJSON_t}from'./JSON.gen'; |
| 11 | + |
| 12 | +exporttypecategory="novel"|"science-fiction"|"thriller"; |
| 13 | + |
| 14 | +exporttypearrayJSON_t=JSON_t[]; |
| 15 | + |
| 16 | +exporttypecategoryArray=category[]; |
| 17 | + |
| 18 | +/** 'FindBookById' parameters type */ |
| 19 | +exporttypefindBookByIdParams={readonlyid?:number}; |
| 20 | + |
| 21 | +/** 'FindBookById' return type */ |
| 22 | +exporttypefindBookByIdResult={ |
| 23 | +readonlyauthor_id:(undefined|number); |
| 24 | +readonlybig_int:(undefined|bigint); |
| 25 | +readonlycategories:(undefined|categoryArray); |
| 26 | +readonlyid:number; |
| 27 | +readonlymeta:(undefined|arrayJSON_t); |
| 28 | +readonlyname:(undefined|string); |
| 29 | +readonlyrank:(undefined|number) |
| 30 | +}; |
| 31 | + |
| 32 | +/** 'FindBookById' query type */ |
| 33 | +exporttypefindBookByIdQuery={readonlyparams:findBookByIdParams;readonlyresult:findBookByIdResult}; |
| 34 | + |
| 35 | +/** 'BooksByAuthor' parameters type */ |
| 36 | +exporttypebooksByAuthorParams={readonlyauthorName:string}; |
| 37 | + |
| 38 | +/** 'BooksByAuthor' return type */ |
| 39 | +exporttypebooksByAuthorResult={ |
| 40 | +readonlyauthor_id:(undefined|number); |
| 41 | +readonlybig_int:(undefined|bigint); |
| 42 | +readonlycategories:(undefined|categoryArray); |
| 43 | +readonlyid:number; |
| 44 | +readonlymeta:(undefined|arrayJSON_t); |
| 45 | +readonlyname:(undefined|string); |
| 46 | +readonlyrank:(undefined|number) |
| 47 | +}; |
| 48 | + |
| 49 | +/** 'BooksByAuthor' query type */ |
| 50 | +exporttypebooksByAuthorQuery={readonlyparams:booksByAuthorParams;readonlyresult:booksByAuthorResult}; |
| 51 | + |
| 52 | +/** Returns an array of all matched results. */ |
| 53 | +exportconstFindBookById_many:(_1:PgTyped_Pg_Client_t,_2:findBookByIdParams)=>Promise<findBookByIdResult[]>=BookService__sqlJS.FindBookById.manyasany; |
| 54 | + |
| 55 | +/** Returns exactly 1 result. Returns `None` if more or less than exactly 1 result is returned. */ |
| 56 | +exportconstFindBookById_one:(_1:PgTyped_Pg_Client_t,_2:findBookByIdParams)=>Promise<(undefined|findBookByIdResult)>=BookService__sqlJS.FindBookById.oneasany; |
| 57 | + |
| 58 | +/** Returns exactly 1 result. Returns `Error` (with an optionally provided `errorMessage`) if more or less than exactly 1 result is returned. */ |
| 59 | +exportconstFindBookById_expectOne:(_1:PgTyped_Pg_Client_t,_2:findBookByIdParams,errorMessage:(undefined|string))=>Promise< |
| 60 | +{TAG:"Ok";_0:findBookByIdResult} |
| 61 | +|{TAG:"Error";_0:string}>=BookService__sqlJS.FindBookById.expectOneasany; |
| 62 | + |
| 63 | +/** Executes the query, but ignores whatever is returned by it. */ |
| 64 | +exportconstFindBookById_execute:(_1:PgTyped_Pg_Client_t,_2:findBookByIdParams)=>Promise<void>=BookService__sqlJS.FindBookById.executeasany; |
| 65 | + |
| 66 | +exportconstfindBookById:(params:findBookByIdParams,client:PgTyped_Pg_Client_t)=>Promise<findBookByIdResult[]>=BookService__sqlJS.findBookByIdasany; |
| 67 | + |
| 68 | +/** Returns an array of all matched results. */ |
| 69 | +exportconstBooksByAuthor_many:(_1:PgTyped_Pg_Client_t,_2:booksByAuthorParams)=>Promise<booksByAuthorResult[]>=BookService__sqlJS.BooksByAuthor.manyasany; |
| 70 | + |
| 71 | +/** Returns exactly 1 result. Returns `None` if more or less than exactly 1 result is returned. */ |
| 72 | +exportconstBooksByAuthor_one:(_1:PgTyped_Pg_Client_t,_2:booksByAuthorParams)=>Promise<(undefined|booksByAuthorResult)>=BookService__sqlJS.BooksByAuthor.oneasany; |
| 73 | + |
| 74 | +/** Returns exactly 1 result. Returns `Error` (with an optionally provided `errorMessage`) if more or less than exactly 1 result is returned. */ |
| 75 | +exportconstBooksByAuthor_expectOne:(_1:PgTyped_Pg_Client_t,_2:booksByAuthorParams,errorMessage:(undefined|string))=>Promise< |
| 76 | +{TAG:"Ok";_0:booksByAuthorResult} |
| 77 | +|{TAG:"Error";_0:string}>=BookService__sqlJS.BooksByAuthor.expectOneasany; |
| 78 | + |
| 79 | +/** Executes the query, but ignores whatever is returned by it. */ |
| 80 | +exportconstBooksByAuthor_execute:(_1:PgTyped_Pg_Client_t,_2:booksByAuthorParams)=>Promise<void>=BookService__sqlJS.BooksByAuthor.executeasany; |
| 81 | + |
| 82 | +exportconstbooksByAuthor:(params:booksByAuthorParams,client:PgTyped_Pg_Client_t)=>Promise<booksByAuthorResult[]>=BookService__sqlJS.booksByAuthorasany; |
| 83 | + |
| 84 | +exportconstFindBookById:{ |
| 85 | +/** Returns exactly 1 result. Returns `Error` (with an optionally provided `errorMessage`) if more or less than exactly 1 result is returned. */ |
| 86 | +expectOne:(_1:PgTyped_Pg_Client_t,_2:findBookByIdParams,errorMessage:(undefined|string))=>Promise< |
| 87 | +{ |
| 88 | +TAG:"Ok"; |
| 89 | +_0:findBookByIdResult |
| 90 | +} |
| 91 | +|{ |
| 92 | +TAG:"Error"; |
| 93 | +_0:string |
| 94 | +}>; |
| 95 | +/** Returns exactly 1 result. Returns `None` if more or less than exactly 1 result is returned. */ |
| 96 | +one:(_1:PgTyped_Pg_Client_t,_2:findBookByIdParams)=>Promise<(undefined|findBookByIdResult)>; |
| 97 | +/** Returns an array of all matched results. */ |
| 98 | +many:(_1:PgTyped_Pg_Client_t,_2:findBookByIdParams)=>Promise<findBookByIdResult[]>; |
| 99 | +/** Executes the query, but ignores whatever is returned by it. */ |
| 100 | +execute:(_1:PgTyped_Pg_Client_t,_2:findBookByIdParams)=>Promise<void> |
| 101 | +}=BookService__sqlJS.FindBookByIdasany; |
| 102 | + |
| 103 | +exportconstBooksByAuthor:{ |
| 104 | +/** Returns exactly 1 result. Returns `Error` (with an optionally provided `errorMessage`) if more or less than exactly 1 result is returned. */ |
| 105 | +expectOne:(_1:PgTyped_Pg_Client_t,_2:booksByAuthorParams,errorMessage:(undefined|string))=>Promise< |
| 106 | +{ |
| 107 | +TAG:"Ok"; |
| 108 | +_0:booksByAuthorResult |
| 109 | +} |
| 110 | +|{ |
| 111 | +TAG:"Error"; |
| 112 | +_0:string |
| 113 | +}>; |
| 114 | +/** Returns exactly 1 result. Returns `None` if more or less than exactly 1 result is returned. */ |
| 115 | +one:(_1:PgTyped_Pg_Client_t,_2:booksByAuthorParams)=>Promise<(undefined|booksByAuthorResult)>; |
| 116 | +/** Returns an array of all matched results. */ |
| 117 | +many:(_1:PgTyped_Pg_Client_t,_2:booksByAuthorParams)=>Promise<booksByAuthorResult[]>; |
| 118 | +/** Executes the query, but ignores whatever is returned by it. */ |
| 119 | +execute:(_1:PgTyped_Pg_Client_t,_2:booksByAuthorParams)=>Promise<void> |
| 120 | +}=BookService__sqlJS.BooksByAuthorasany; |