/**
 * AUTO-GENERATED FILE @ 2019-11-04 16:12:30 - DO NOT EDIT!
 *
 * This file was automatically generated by schemats v.3.0.3
 * $ schemats generate -c postgres://localhost/mostly_ormless -t appleTransactions -t authors -t books -t emailAuthentication -t tags -s public
 *
 */ import { DefaultType , JSONValue , JSONArray , SQLFragment , GenericSQLExpression , ColumnNames , ColumnValues , Queryable , UpsertAction , } from "./core" ; export type appleEnvironment = 'PROD' | 'Sandbox' ; export namespace every { export type appleEnvironment = [ 'PROD' , 'Sandbox' ] ; } export namespace appleTransactions { export type Table = "appleTransactions" ; export interface Selectable { environment : appleEnvironment ; originalTransactionId : string ; accountId : number ; latestReceiptData : string | null ; } export interface Insertable { environment : appleEnvironment | SQLFragment ; originalTransactionId : string | SQLFragment ; accountId : number | SQLFragment ; latestReceiptData ? : string | null | DefaultType | SQLFragment ; } export interface Updatable extends Partial < Insertable > { } ; export type Whereable = { [ K in keyof Selectable ] ? : Selectable [ K ] | SQLFragment ; } ; export interface UpsertReturnable extends Selectable , UpsertAction { } ; export type Column = keyof Selectable ; export type OnlyCols < T extends readonly Column [ ] > = Pick < Selectable , T [ number ] > ; export type SQLExpression = GenericSQLExpression | Table | Whereable | Column | ColumnNames < Updatable | ( keyof Updatable ) [ ] > | ColumnValues < Updatable > ; export type SQL = SQLExpression | SQLExpression [ ] ; export interface OrderSpec { by : SQL ; direction : 'ASC' | 'DESC' ; nulls ? : 'FIRST' | 'LAST' ; } export interface SelectOptions < C extends readonly Column [ ] > { order ? : OrderSpec [ ] ; limit ? : number ; offset ? : number ; columns ? : C ; } } export namespace authors { export type Table = "authors" ; export interface Selectable { id : number ; name : string ; isLiving : boolean | null ; } export interface Insertable { id ? : number | DefaultType | SQLFragment ; name : string | SQLFragment ; isLiving ? : boolean | null | DefaultType | SQLFragment ; } export interface Updatable extends Partial < Insertable > { } ; export type Whereable = { [ K in keyof Selectable ] ? : Selectable [ K ] | SQLFragment ; } ; export interface UpsertReturnable extends Selectable , UpsertAction { } ; export type Column = keyof Selectable ; export type OnlyCols < T extends readonly Column [ ] > = Pick < Selectable , T [ number ] > ; export type SQLExpression = GenericSQLExpression | Table | Whereable | Column | ColumnNames < Updatable | ( keyof Updatable ) [ ] > | ColumnValues < Updatable > ; export type SQL = SQLExpression | SQLExpression [ ] ; export interface OrderSpec { by : SQL ; direction : 'ASC' | 'DESC' ; nulls ? : 'FIRST' | 'LAST' ; } export interface SelectOptions < C extends readonly Column [ ] > { order ? : OrderSpec [ ] ; limit ? : number ; offset ? : number ; columns ? : C ; } } export namespace books { export type Table = "books" ; export interface Selectable { id : number ; authorId : number ; title : string | null ; createdAt : Date ; updatedAt : Date ; } export interface Insertable { id ? : number | DefaultType | SQLFragment ; authorId : number | SQLFragment ; title ? : string | null | DefaultType | SQLFragment ; createdAt ? : Date | DefaultType | SQLFragment ; updatedAt ? : Date | DefaultType | SQLFragment ; } export interface Updatable extends Partial < Insertable > { } ; export type Whereable = { [ K in keyof Selectable ] ? : Selectable [ K ] | SQLFragment ; } ; export interface UpsertReturnable extends Selectable , UpsertAction { } ; export type Column = keyof Selectable ; export type OnlyCols < T extends readonly Column [ ] > = Pick < Selectable , T [ number ] > ; export type SQLExpression = GenericSQLExpression | Table | Whereable | Column | ColumnNames < Updatable | ( keyof Updatable ) [ ] > | ColumnValues < Updatable > ; export type SQL = SQLExpression | SQLExpression [ ] ; export interface OrderSpec { by : SQL ; direction : 'ASC' | 'DESC' ; nulls ? : 'FIRST' | 'LAST' ; } export interface SelectOptions < C extends readonly Column [ ] > { order ? : OrderSpec [ ] ; limit ? : number ; offset ? : number ; columns ? : C ; } } export namespace emailAuthentication { export type Table = "emailAuthentication" ; export interface Selectable { email : string ; consecutiveFailedLogins : number ; lastFailedLogin : Date | null ; } export interface Insertable { email : string | SQLFragment ; consecutiveFailedLogins ? : number | DefaultType | SQLFragment ; lastFailedLogin ? : Date | null | DefaultType | SQLFragment ; } export interface Updatable extends Partial < Insertable > { } ; export type Whereable = { [ K in keyof Selectable ] ? : Selectable [ K ] | SQLFragment ; } ; export interface UpsertReturnable extends Selectable , UpsertAction { } ; export type Column = keyof Selectable ; export type OnlyCols < T extends readonly Column [ ] > = Pick < Selectable , T [ number ] > ; export type SQLExpression = GenericSQLExpression | Table | Whereable | Column | ColumnNames < Updatable | ( keyof Updatable ) [ ] > | ColumnValues < Updatable > ; export type SQL = SQLExpression | SQLExpression [ ] ; export interface OrderSpec { by : SQL ; direction : 'ASC' | 'DESC' ; nulls ? : 'FIRST' | 'LAST' ; } export interface SelectOptions < C extends readonly Column [ ] > { order ? : OrderSpec [ ] ; limit ? : number ; offset ? : number ; columns ? : C ; } } export namespace tags { export type Table = "tags" ; export interface Selectable { tag : string ; bookId : number ; } export interface Insertable { tag : string | SQLFragment ; bookId : number | SQLFragment ; } export interface Updatable extends Partial < Insertable > { } ; export type Whereable = { [ K in keyof Selectable ] ? : Selectable [ K ] | SQLFragment ; } ; export interface UpsertReturnable extends Selectable , UpsertAction { } ; export type Column = keyof Selectable ; export type OnlyCols < T extends readonly Column [ ] > = Pick < Selectable , T [ number ] > ; export type SQLExpression = GenericSQLExpression | Table | Whereable | Column | ColumnNames < Updatable | ( keyof Updatable ) [ ] > | ColumnValues < Updatable > ; export type SQL = SQLExpression | SQLExpression [ ] ; export interface OrderSpec { by : SQL ; direction : 'ASC' | 'DESC' ; nulls ? : 'FIRST' | 'LAST' ; } export interface SelectOptions < C extends readonly Column [ ] > { order ? : OrderSpec [ ] ; limit ? : number ; offset ? : number ; columns ? : C ; } } export type Selectable = appleTransactions . Selectable | authors . Selectable | books . Selectable | emailAuthentication . Selectable | tags . Selectable ; export type Whereable = appleTransactions . Whereable | authors . Whereable | books . Whereable | emailAuthentication . Whereable | tags . Whereable ; export type Insertable = appleTransactions . Insertable | authors . Insertable | books . Insertable | emailAuthentication . Insertable | tags . Insertable ; export type Updatable = appleTransactions . Updatable | authors . Updatable | books . Updatable | emailAuthentication . Updatable | tags . Updatable ; export type Table = appleTransactions . Table | authors . Table | books . Table | emailAuthentication . Table | tags . Table ; export type Column = appleTransactions . Column | authors . Column | books . Column | emailAuthentication . Column | tags . Column ; export type AllTables = [ appleTransactions . Table , authors . Table , books . Table , emailAuthentication . Table , tags . Table ] ; export interface InsertSignatures { ( client , table , values ) : Promise < appleTransactions . Selectable > ; ( client , table , values ) : Promise < appleTransactions . Selectable [ ] > ; ( client , table , values ) : Promise < authors . Selectable > ; ( client , table , values ) : Promise < authors . Selectable [ ] > ; ( client , table , values ) : Promise < books . Selectable > ; ( client , table , values ) : Promise < books . Selectable [ ] > ; ( client , table , values ) : Promise < emailAuthentication . Selectable > ; ( client , table , values ) : Promise < emailAuthentication . Selectable [ ] > ; ( client , table , values ) : Promise < tags . Selectable > ; ( client , table , values ) : Promise < tags . Selectable [ ] > ; } export interface UpsertSignatures { ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < appleTransactions . UpsertReturnable > ; ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < appleTransactions . UpsertReturnable [ ] > ; ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < authors . UpsertReturnable > ; ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < authors . UpsertReturnable [ ] > ; ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < books . UpsertReturnable > ; ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < books . UpsertReturnable [ ] > ; ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < emailAuthentication . UpsertReturnable > ; ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < emailAuthentication . UpsertReturnable [ ] > ; ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < tags . UpsertReturnable > ; ( client , table , values , uniqueCols , noNullUpdateCols ? ) : Promise < tags . UpsertReturnable [ ] > ; } export interface UpdateSignatures { ( client , table , values , where ) : Promise < appleTransactions . Selectable [ ] > ; ( client , table , values , where ) : Promise < authors . Selectable [ ] > ; ( client , table , values , where ) : Promise < books . Selectable [ ] > ; ( client , table , values , where ) : Promise < emailAuthentication . Selectable [ ] > ; ( client , table , values , where ) : Promise < tags . Selectable [ ] > ; } export interface DeleteSignatures { ( client , table , where ) : Promise < appleTransactions . Selectable [ ] > ; ( client , table , where ) : Promise < authors . Selectable [ ] > ; ( client , table , where ) : Promise < books . Selectable [ ] > ; ( client , table , where ) : Promise < emailAuthentication . Selectable [ ] > ; ( client , table , where ) : Promise < tags . Selectable [ ] > ; } export interface SelectSignatures { < T extends readonly appleTransactions . Column [ ] > ( client , table , where ? , options ? , count ? ) : Promise < T extends undefined ? appleTransactions . Selectable [ ] : appleTransactions . OnlyCols < T > [ ] > ; < T extends readonly authors . Column [ ] > ( client , table , where ? , options ? , count ? ) : Promise < T extends undefined ? authors . Selectable [ ] : authors . OnlyCols < T > [ ] > ; < T extends readonly books . Column [ ] > ( client , table , where ? , options ? , count ? ) : Promise < T extends undefined ? books . Selectable [ ] : books . OnlyCols < T > [ ] > ; < T extends readonly emailAuthentication . Column [ ] > ( client , table , where ? , options ? , count ? ) : Promise < T extends undefined ? emailAuthentication . Selectable [ ] : emailAuthentication . OnlyCols < T > [ ] > ; < T extends readonly tags . Column [ ] > ( client , table , where ? , options ? , count ? ) : Promise < T extends undefined ? tags . Selectable [ ] : tags . OnlyCols < T > [ ] > ; } export interface SelectOneSignatures { < T extends readonly appleTransactions . Column [ ] > ( client , table , where ? , options ? ) : Promise < ( T extends undefined ? appleTransactions . Selectable : appleTransactions . OnlyCols < T > ) | undefined > ; < T extends readonly authors . Column [ ] > ( client , table , where ? , options ? ) : Promise < ( T extends undefined ? authors . Selectable : authors . OnlyCols < T > ) | undefined > ; < T extends readonly books . Column [ ] > ( client , table , where ? , options ? ) : Promise < ( T extends undefined ? books . Selectable : books . OnlyCols < T > ) | undefined > ; < T extends readonly emailAuthentication . Column [ ] > ( client , table , where ? , options ? ) : Promise < ( T extends undefined ? emailAuthentication . Selectable : emailAuthentication . OnlyCols < T > ) | undefined > ; < T extends readonly tags . Column [ ] > ( client , table , where ? , options ? ) : Promise < ( T extends undefined ? tags . Selectable : tags . OnlyCols < T > ) | undefined > ; } export interface CountSignatures { ( client , table , where ? ) : Promise < number > ; ( client , table , where ? ) : Promise < number > ; ( client , table , where ? ) : Promise < number > ; ( client , table , where ? ) : Promise < number > ; ( client , table , where ? ) : Promise < number > ; }