@ckir/corelib - v0.1.13
Preparing search index...
DbDriver
Interface DbDriver
Core interface for database drivers. All dialects must implement this.
interface
DbDriver
{
beginTransaction
()
:
Promise
<
void
>
;
commitTransaction
()
:
Promise
<
void
>
;
connect
()
:
Promise
<
void
>
;
disconnect
()
:
Promise
<
void
>
;
prepare
(
sql
:
string
)
:
Promise
<
DatabaseResult
<
PreparedDriverStatement
>
>
;
query
<
T
=
any
>
(
sql
:
string
,
params
?:
QueryParams
,
)
:
Promise
<
DatabaseResult
<
QueryResponse
<
T
>
>
>
;
rollbackTransaction
()
:
Promise
<
void
>
;
stream
<
T
=
any
>
(
sql
:
string
,
params
:
QueryParams
,
onRow
:
(
row
:
T
)
=>
void
,
)
:
Promise
<
DatabaseResult
<
void
>
>
;
}
Implemented by
PostgresDriver
SqliteDriver
Index
Methods
begin
Transaction
commit
Transaction
connect
disconnect
prepare
query
rollback
Transaction
stream
Methods
begin
Transaction
beginTransaction
()
:
Promise
<
void
>
Returns
Promise
<
void
>
commit
Transaction
commitTransaction
()
:
Promise
<
void
>
Returns
Promise
<
void
>
connect
connect
()
:
Promise
<
void
>
Returns
Promise
<
void
>
disconnect
disconnect
()
:
Promise
<
void
>
Returns
Promise
<
void
>
prepare
prepare
(
sql
:
string
)
:
Promise
<
DatabaseResult
<
PreparedDriverStatement
>
>
Parameters
sql
:
string
Returns
Promise
<
DatabaseResult
<
PreparedDriverStatement
>
>
query
query
<
T
=
any
>
(
sql
:
string
,
params
?:
QueryParams
,
)
:
Promise
<
DatabaseResult
<
QueryResponse
<
T
>
>
>
Type Parameters
T
=
any
Parameters
sql
:
string
Optional
params
:
QueryParams
Returns
Promise
<
DatabaseResult
<
QueryResponse
<
T
>
>
>
rollback
Transaction
rollbackTransaction
()
:
Promise
<
void
>
Returns
Promise
<
void
>
stream
stream
<
T
=
any
>
(
sql
:
string
,
params
:
QueryParams
,
onRow
:
(
row
:
T
)
=>
void
,
)
:
Promise
<
DatabaseResult
<
void
>
>
Type Parameters
T
=
any
Parameters
sql
:
string
params
:
QueryParams
onRow
:
(
row
:
T
)
=>
void
Returns
Promise
<
DatabaseResult
<
void
>
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Methods
begin
Transaction
commit
Transaction
connect
disconnect
prepare
query
rollback
Transaction
stream
@ckir/corelib - v0.1.13
Loading...
Core interface for database drivers. All dialects must implement this.