mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
feat: adding env aware endpoint to obtain sqlite connection, remove libsql hard dependency
This commit is contained in:
8
app/src/adapter/sqlite/bun.ts
Normal file
8
app/src/adapter/sqlite/bun.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { Connection } from "bknd/data";
|
||||
import { $console } from "bknd/core";
|
||||
import { bunSqlite } from "../bun/connection/BunSqliteConnection";
|
||||
|
||||
export function sqlite(config: { url: string }): Connection {
|
||||
$console.info("Using bun-sqlite", config);
|
||||
return bunSqlite(config);
|
||||
}
|
||||
8
app/src/adapter/sqlite/edge.ts
Normal file
8
app/src/adapter/sqlite/edge.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { $console } from "bknd/core";
|
||||
import type { Connection } from "bknd/data";
|
||||
import { libsql } from "../../data/connection/sqlite/LibsqlConnection";
|
||||
|
||||
export function sqlite(config: { url: string }): Connection {
|
||||
$console.info("Using libsql", config);
|
||||
return libsql(config);
|
||||
}
|
||||
8
app/src/adapter/sqlite/node.ts
Normal file
8
app/src/adapter/sqlite/node.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { $console } from "bknd/core";
|
||||
import type { Connection } from "bknd/data";
|
||||
import { nodeSqlite } from "../node/connection/NodeSqliteConnection";
|
||||
|
||||
export function sqlite(config: { url: string }): Connection {
|
||||
$console.info("Using node-sqlite", config);
|
||||
return nodeSqlite(config);
|
||||
}
|
||||
3
app/src/adapter/sqlite/types.ts
Normal file
3
app/src/adapter/sqlite/types.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { Connection } from "bknd/data";
|
||||
|
||||
export type SqliteConnection = (config: { url: string }) => Connection;
|
||||
Reference in New Issue
Block a user