add sqlocal connection including example

This commit is contained in:
dswbx
2025-03-15 14:40:41 +01:00
parent 5697b7891a
commit 622a7b2b9a
22 changed files with 1047 additions and 56 deletions

View File

@@ -75,6 +75,7 @@ export type DbFunctions = {
const CONN_SYMBOL = Symbol.for("bknd:connection");
export abstract class Connection<DB = any> {
protected initialized = false;
kysely: Kysely<DB>;
protected readonly supported = {
batching: false,
@@ -89,6 +90,11 @@ export abstract class Connection<DB = any> {
this[CONN_SYMBOL] = true;
}
// @todo: consider moving constructor logic here, required by sqlocal
async init(): Promise<void> {
this.initialized = true;
}
/**
* This is a helper function to manage Connection classes
* coming from different places