add_fts_index
add_fts_index: (
table: string,
column: string,
language?: string,
disable_fts?: boolean,
) => Promise<void>
add_index
add_index: (table: string, columns: string[]) => Promise<void>
add_unique_constraint
add_unique_constraint: (
table: string | undefined,
columns: string[],
) => Promise<void>
begin
begin: () => Promise<void>
changeConnection
changeConnection: (connectObj: any) => void
close
close: () => Promise<void>
commit
commit: () => Promise<void>
commitAndBeginNewTransaction
commitAndBeginNewTransaction: () => Promise<void>
copyFrom
copyFrom: (
readStream: ReadStream,
table: string,
fieldNames: any[],
client: any,
) => Promise<any>
OptionalcopyToJson
copyToJson?: (
writeStream: WriteStream,
table: string,
opts?: any,
) => Promise<void>
delete
delete: (table: string, where: Where) => Promise<any> deleteWhere
deleteWhere: (table: string, where: Where) => Promise<any> drop_fts_index
drop_fts_index: (table: string) => Promise<void>
drop_index
drop_index: (table: string, columns: string[]) => Promise<void>
drop_reset_schema
drop_reset_schema: () => Promise<void>
drop_unique_constraint
drop_unique_constraint: (
table: string | undefined,
columns: string[],
) => Promise<void>
dropTable
dropTable: (table: string) => Promise<any>
dropTables
dropTables: (tables: string[]) => Promise<any>
enable_multi_tenant
enable_multi_tenant: () => void
get_db_filepath
get_db_filepath: () => string
get_sql_logging
get_sql_logging: () => boolean
getClient
getClient: () => Promise<any>
getRequestContext
getRequestContext: () => {
client?: object
| string;
req: { __: (str: string) => string; getLocale: () => string };
}
getTenantSchema
getTenantSchema: () => string
getTenantSchemaPrefix
getTenantSchemaPrefix: () => string
getVersion
getVersion: (arg?: boolean) => Promise<string>
insert
insert: (table: string, data: GenObj, opts?: any) => Promise<any> is_it_multi_tenant
is_it_multi_tenant: () => boolean
is_sqlite
is_sqlite: boolean
isSQLite
isSQLite: boolean
listScTables
listScTables: () => Promise<any>
listTables
listTables: () => Promise<any>
listUserDefinedTables
listUserDefinedTables: () => Promise<any>
mkWhere
mkWhere: (q: Where) => any query
query: (sql: string, params?: any) => Promise<any>
reset
reset: () => Promise<void>
reset_sequence
reset_sequence: (table: string, column?: string) => Promise<void>
rollback
rollback: () => Promise<void>
runWithTenant
runWithTenant: (tenantId: string | RequestContext, fn: any) => Promise<any>
selectMaybeOne
selectMaybeOne: (table: string, where: Where, opts?: any) => Promise<any> set_sql_logging
set_sql_logging: (enabled: boolean) => void
setConnectionObject
setConnectionObject: (connectObj: any) => void
slugify
slugify: (str: string) => string
sqlsanitize
sqlsanitize: (s?: string) => string
time
time: () => Promise<Date>
truncate
truncate: (table: string) => Promise<void>
tryCatchInTransaction
tryCatchInTransaction: <T>(
fn: () => Promise<T>,
onError?: (err: Error) => Promise<T | void> | T | void,
) => Promise<T>
updateWhere
updateWhere: (table: string, data: Row, where: Where) => Promise<any> withTransaction
withTransaction: (
fn: () => Promise<any>,
onError?: (e: Error) => Promise<void>,
) => Promise<any>