Interface DatabaseAdapter<T>
Type Parameters
T extends AllowAnyTypeInformation
Properties
Readonly
supports
supports: T[]
Readonly
supportsNesting
supportsNesting: boolean
Methods
connect
- connect(): Promise<void>
Returns Promise<void>
count
- count(table, search, options?): Promise<number>
Parameters
table: string
search: Record<string, PrimitiveType<T>>
Optional
options: {
limit?: number;
}
Returns Promise<number>
create
- create(table, definition, options?): Promise<void>
Parameters
table: string
definition: Record<string, T>
Optional
options: {
ifNotExists?: boolean;
}
Optional
ifNotExists?: boolean
Returns Promise<void>
delete
- delete(table, search, options?): Promise<number>
Parameters
table: string
search: Record<string, PrimitiveType<T>>
Optional
options: {
limit?: number;
}
Returns Promise<number>
disconnect
- disconnect(): Promise<void>
Returns Promise<void>
drop
- drop(table, options?): Promise<void>
Parameters
table: string
Optional
options: {
ifExists?: boolean;
}
Optional
ifExists?: boolean
Returns Promise<void>
exists
- exists(table): Promise<boolean>
Returns Promise<boolean>
get
- get(table, search, options?): Promise<Record<string, T>[]>
Parameters
table: string
search: Record<string, PrimitiveType<T>>
Optional
options: {
limit?: number;
}
Returns Promise<Record<string, T>[]>
insert
- insert(table, data, options?): Promise<void>
Parameters
table: string
data: Record<string, PrimitiveType<T>>
Optional
options: Record<string, never>
Returns Promise<void>
update
- update(table, search, data, options?): Promise<number>
Parameters
table: string
search: Record<string, PrimitiveType<T>>
data: Record<string, PrimitiveType<T>>
Optional
options: {
limit?: number;
}
Returns Promise<number>
Database Adapter Level 1 with nesting support