@telorun/sql 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ # SUSTAINABLE USE LICENSE (Fair-code)
2
+
3
+ Copyright (c) 2026 DiglyAI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use, copy, modify, and distribute the Software for any purpose—including commercial purposes—subject to the following conditions:
6
+
7
+ 1. ANTI-COMPETITION RESTRICTION: The Software may not be provided to third parties as a managed service, commercial SaaS (Software-as-a-Service), PaaS (Platform-as-a-Service), BaaS (Backend-as-a-Service), or similar offering where the primary value provided to the user is the functionality of the Software itself, without a separate commercial license from the copyright holder.
8
+
9
+ 2. PERMITTED COMMERCIAL USE: You are free to use the Software to build, host, and monetize your own commercial applications, products, and services, provided such use does not violate Clause 1.
10
+
11
+ 3. ATTRIBUTION: This copyright notice and license must be included in all copies or substantial portions of the Software.
12
+
13
+ 4. CONTRIBUTIONS: Contributions to the Software are welcome and encouraged. By contributing, you agree that your contributions may be incorporated into the Software and distributed under this license.
14
+
15
+ 5. DISCLAIMER: The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software.
16
+
17
+ For commercial licensing, managed hosting exemptions, or enterprise inquiries, please contact DiglyAI.
@@ -0,0 +1,45 @@
1
+ import type { ResourceContext, ResourceInstance } from "@telorun/sdk";
2
+ import { Kysely, type QueryResult } from "kysely";
3
+ import type { SqlTransactionResource } from "./sql-transaction-controller.js";
4
+ import type { SqliteDb } from "./sqlite-driver-interface.js";
5
+ interface PoolConfig {
6
+ min?: number;
7
+ max?: number;
8
+ idleTimeoutMs?: number;
9
+ connectionTimeoutMs?: number;
10
+ }
11
+ interface SqlConnectionManifest {
12
+ metadata: {
13
+ name: string;
14
+ module: string;
15
+ };
16
+ driver: "postgres" | "sqlite";
17
+ connectionString?: string;
18
+ host?: string;
19
+ port?: number;
20
+ database?: string;
21
+ user?: string;
22
+ password?: string;
23
+ ssl?: boolean;
24
+ file?: string;
25
+ pool?: PoolConfig;
26
+ }
27
+ export type SqlDriver = SqlConnectionManifest["driver"];
28
+ export declare class SqlConnectionResource implements ResourceInstance {
29
+ readonly driver: SqlDriver;
30
+ private readonly db;
31
+ private readonly sqlite?;
32
+ constructor(m: SqlConnectionManifest, sqlite?: SqliteDb);
33
+ init(): Promise<void>;
34
+ teardown(): Promise<void>;
35
+ transaction<T>(cb: () => Promise<T>): Promise<T>;
36
+ execute<T>(sql: string, params?: unknown[], transaction?: SqlTransactionResource): Promise<QueryResult<T>>;
37
+ executeScript(sql: string): Promise<void>;
38
+ toRowCount(result: QueryResult<unknown>): number;
39
+ get kysely(): Kysely<any>;
40
+ snapshot(): Record<string, unknown>;
41
+ private resolveExecutor;
42
+ }
43
+ export declare function register(): void;
44
+ export declare function create(resource: SqlConnectionManifest, ctx: ResourceContext): Promise<SqlConnectionResource>;
45
+ export {};
@@ -0,0 +1,111 @@
1
+ import { randomUUID } from "crypto";
2
+ import { CompiledQuery, Kysely, PostgresDialect, SqliteDialect, } from "kysely";
3
+ import { Pool } from "pg";
4
+ import { currentTxId, deleteTx, getTx, setTx, txStorage } from "./transaction-store.js";
5
+ export class SqlConnectionResource {
6
+ driver;
7
+ db;
8
+ sqlite;
9
+ constructor(m, sqlite) {
10
+ this.driver = m.driver;
11
+ if (m.driver === "postgres") {
12
+ this.db = new Kysely({
13
+ dialect: new PostgresDialect({
14
+ pool: new Pool({
15
+ ...(m.connectionString
16
+ ? { connectionString: m.connectionString }
17
+ : { host: m.host, port: m.port ?? 5432, database: m.database, user: m.user, password: m.password }),
18
+ ssl: m.ssl ? { rejectUnauthorized: false } : false,
19
+ min: m.pool?.min ?? 1,
20
+ max: m.pool?.max ?? 10,
21
+ idleTimeoutMillis: m.pool?.idleTimeoutMs,
22
+ connectionTimeoutMillis: m.pool?.connectionTimeoutMs,
23
+ }),
24
+ }),
25
+ });
26
+ }
27
+ else if (m.driver === "sqlite") {
28
+ if (!sqlite) {
29
+ throw new Error("Sql: sqlite database was not initialized");
30
+ }
31
+ this.sqlite = sqlite;
32
+ this.db = new Kysely({
33
+ dialect: new SqliteDialect({
34
+ database: this.sqlite,
35
+ }),
36
+ });
37
+ }
38
+ else {
39
+ throw new Error("Invalid SQL Connection driver");
40
+ }
41
+ }
42
+ async init() {
43
+ await this.db.connection().execute(async () => {
44
+ // just checking
45
+ });
46
+ }
47
+ async teardown() {
48
+ await this.db.destroy();
49
+ }
50
+ async transaction(cb) {
51
+ const txId = randomUUID();
52
+ return this.db.transaction().execute(async (trx) => {
53
+ setTx(txId, { executor: trx });
54
+ try {
55
+ return await txStorage.run(txId, cb);
56
+ }
57
+ finally {
58
+ deleteTx(txId);
59
+ }
60
+ });
61
+ }
62
+ async execute(sql, params = [], transaction) {
63
+ const executor = this.resolveExecutor(transaction);
64
+ return executor.executeQuery(CompiledQuery.raw(sql, params));
65
+ }
66
+ async executeScript(sql) {
67
+ if (this.driver === "sqlite") {
68
+ this.sqlite?.exec(sql);
69
+ return;
70
+ }
71
+ await this.execute(sql);
72
+ }
73
+ toRowCount(result) {
74
+ if (result.numAffectedRows !== undefined) {
75
+ return Number(result.numAffectedRows);
76
+ }
77
+ return result.rows.length;
78
+ }
79
+ get kysely() {
80
+ return this.db;
81
+ }
82
+ snapshot() {
83
+ return {};
84
+ }
85
+ resolveExecutor(transaction) {
86
+ if (transaction) {
87
+ transaction.assertActive();
88
+ }
89
+ const txId = currentTxId();
90
+ if (txId) {
91
+ const entry = getTx(txId);
92
+ if (entry) {
93
+ return entry.executor;
94
+ }
95
+ }
96
+ return this.db;
97
+ }
98
+ }
99
+ export function register() { }
100
+ export async function create(resource, ctx) {
101
+ const sqlite = resource.driver === "sqlite" ? await openSqliteDatabase(resource.file) : undefined;
102
+ return new SqlConnectionResource(resource, sqlite);
103
+ }
104
+ async function openSqliteDatabase(file = ":memory:") {
105
+ if (typeof Bun !== "undefined") {
106
+ const { openDatabase } = await import("./sqlite-driver-bun.js");
107
+ return openDatabase(file);
108
+ }
109
+ const { openDatabase } = await import("./sqlite-driver-node.js");
110
+ return openDatabase(file);
111
+ }
@@ -0,0 +1,7 @@
1
+ import type { ResourceContext } from "@telorun/sdk";
2
+ import type { SqlConnectionResource } from "./sql-connection-controller.js";
3
+ interface ConnectionRef {
4
+ name: string;
5
+ }
6
+ export declare function resolveSqlConnection(value: SqlConnectionResource | ConnectionRef | undefined, ctx: ResourceContext): SqlConnectionResource | undefined;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ export function resolveSqlConnection(value, ctx) {
2
+ if (!value) {
3
+ return undefined;
4
+ }
5
+ if (typeof value.execute === "function") {
6
+ return value;
7
+ }
8
+ if (typeof value.name !== "string") {
9
+ throw new Error("Sql: invalid connection reference");
10
+ }
11
+ return ctx.moduleContext.getInstance(value.name);
12
+ }
@@ -0,0 +1,25 @@
1
+ import type { ResourceContext, ResourceInstance } from "@telorun/sdk";
2
+ import type { SqlConnectionResource } from "./sql-connection-controller.js";
3
+ import type { SqlResult } from "./sql-query-controller.js";
4
+ import type { SqlTransactionResource } from "./sql-transaction-controller.js";
5
+ interface SqlExecManifest {
6
+ metadata: {
7
+ name: string;
8
+ module: string;
9
+ };
10
+ connection?: SqlConnectionResource;
11
+ transaction?: SqlTransactionResource;
12
+ inputs: {
13
+ sql: string;
14
+ bindings?: unknown[];
15
+ };
16
+ }
17
+ declare class SqlExecResource implements ResourceInstance {
18
+ private readonly manifest;
19
+ private readonly ctx;
20
+ constructor(manifest: SqlExecManifest, ctx: ResourceContext);
21
+ invoke(input: any): Promise<SqlResult>;
22
+ }
23
+ export declare function register(): void;
24
+ export declare function create(resource: SqlExecManifest, ctx: ResourceContext): Promise<SqlExecResource>;
25
+ export {};
@@ -0,0 +1,27 @@
1
+ import { resolveSqlConnection } from "./sql-connection-ref.js";
2
+ class SqlExecResource {
3
+ manifest;
4
+ ctx;
5
+ constructor(manifest, ctx) {
6
+ this.manifest = manifest;
7
+ this.ctx = ctx;
8
+ }
9
+ async invoke(input) {
10
+ const m = this.manifest;
11
+ const ctx = this.ctx;
12
+ const expandedInput = ctx.expandValue(input, {});
13
+ const connection = resolveSqlConnection(m.connection, ctx) ?? m.transaction?.getConnection();
14
+ if (!connection) {
15
+ throw new Error("Sql: either 'connection' or 'transaction' must be set");
16
+ }
17
+ return runExec(connection, m.transaction, expandedInput.sql, expandedInput.bindings ?? []);
18
+ }
19
+ }
20
+ async function runExec(connection, transaction, sql, params) {
21
+ const result = await connection.execute(sql, params, transaction);
22
+ return { rows: result.rows, rowCount: connection.toRowCount(result) };
23
+ }
24
+ export function register() { }
25
+ export async function create(resource, ctx) {
26
+ return new SqlExecResource(resource, ctx);
27
+ }
@@ -0,0 +1,16 @@
1
+ import type { ResourceInstance } from "@telorun/sdk";
2
+ interface SqlMigrationManifest {
3
+ metadata: {
4
+ name: string;
5
+ module: string;
6
+ };
7
+ sql: string;
8
+ }
9
+ declare class SqlMigrationResource implements ResourceInstance {
10
+ readonly manifest: SqlMigrationManifest;
11
+ constructor(manifest: SqlMigrationManifest);
12
+ snapshot(): Record<string, unknown>;
13
+ }
14
+ export declare function register(): void;
15
+ export declare function create(resource: SqlMigrationManifest): Promise<SqlMigrationResource>;
16
+ export {};
@@ -0,0 +1,13 @@
1
+ class SqlMigrationResource {
2
+ manifest;
3
+ constructor(manifest) {
4
+ this.manifest = manifest;
5
+ }
6
+ snapshot() {
7
+ return {};
8
+ }
9
+ }
10
+ export function register() { }
11
+ export async function create(resource) {
12
+ return new SqlMigrationResource(resource);
13
+ }
@@ -0,0 +1,18 @@
1
+ import type { ResourceContext, ResourceInstance } from "@telorun/sdk";
2
+ import type { SqlConnectionResource } from "./sql-connection-controller.js";
3
+ interface SqlMigrationsManifest {
4
+ metadata: {
5
+ name: string;
6
+ module: string;
7
+ };
8
+ connection: SqlConnectionResource;
9
+ }
10
+ declare class SqlMigrationsResource implements ResourceInstance {
11
+ private readonly manifest;
12
+ private readonly ctx;
13
+ constructor(manifest: SqlMigrationsManifest, ctx: ResourceContext);
14
+ run(): Promise<void>;
15
+ }
16
+ export declare function register(): void;
17
+ export declare function create(resource: SqlMigrationsManifest, ctx: ResourceContext): Promise<SqlMigrationsResource>;
18
+ export {};
@@ -0,0 +1,56 @@
1
+ import { CompiledQuery, Migrator, } from "kysely";
2
+ import { resolveSqlConnection } from "./sql-connection-ref.js";
3
+ class TeloMigrationProvider {
4
+ migrations;
5
+ constructor(migrations) {
6
+ this.migrations = migrations;
7
+ }
8
+ async getMigrations() {
9
+ return Object.fromEntries(this.migrations.map((m) => [
10
+ m.name,
11
+ {
12
+ async up(db) {
13
+ await db.executeQuery(CompiledQuery.raw(m.sql));
14
+ },
15
+ },
16
+ ]));
17
+ }
18
+ }
19
+ class SqlMigrationsResource {
20
+ manifest;
21
+ ctx;
22
+ constructor(manifest, ctx) {
23
+ this.manifest = manifest;
24
+ this.ctx = ctx;
25
+ }
26
+ async run() {
27
+ const conn = resolveSqlConnection(this.manifest.connection, this.ctx) ?? failMissingConnection();
28
+ const migrations = [];
29
+ for (const [, { resource }] of this.ctx.moduleContext.resourceInstances) {
30
+ if (resource.kind === "Sql.Migration") {
31
+ migrations.push({
32
+ name: resource.metadata.name,
33
+ sql: resource.sql,
34
+ });
35
+ }
36
+ }
37
+ migrations.sort((a, b) => a.name.localeCompare(b.name));
38
+ const migrator = new Migrator({
39
+ db: conn.kysely,
40
+ provider: new TeloMigrationProvider(migrations),
41
+ migrationTableName: "migrations",
42
+ migrationLockTableName: "migration_locks",
43
+ });
44
+ const { error } = await migrator.migrateToLatest();
45
+ if (error) {
46
+ throw error;
47
+ }
48
+ }
49
+ }
50
+ function failMissingConnection() {
51
+ throw new Error("Sql.Migrations: missing connection");
52
+ }
53
+ export function register() { }
54
+ export async function create(resource, ctx) {
55
+ return new SqlMigrationsResource(resource, ctx);
56
+ }
@@ -0,0 +1,28 @@
1
+ import type { ResourceContext, ResourceInstance } from "@telorun/sdk";
2
+ import type { SqlConnectionResource } from "./sql-connection-controller.js";
3
+ import type { SqlTransactionResource } from "./sql-transaction-controller.js";
4
+ interface SqlQueryManifest {
5
+ metadata: {
6
+ name: string;
7
+ module: string;
8
+ };
9
+ connection?: SqlConnectionResource;
10
+ transaction?: SqlTransactionResource;
11
+ inputs: {
12
+ sql: string;
13
+ bindings?: unknown[];
14
+ };
15
+ }
16
+ export interface SqlResult {
17
+ rows: Record<string, unknown>[];
18
+ rowCount: number;
19
+ }
20
+ declare class SqlQueryResource implements ResourceInstance {
21
+ private readonly manifest;
22
+ private readonly ctx;
23
+ constructor(manifest: SqlQueryManifest, ctx: ResourceContext);
24
+ invoke(input: unknown): Promise<SqlResult>;
25
+ }
26
+ export declare function register(): void;
27
+ export declare function create(resource: SqlQueryManifest, ctx: ResourceContext): Promise<SqlQueryResource>;
28
+ export {};
@@ -0,0 +1,30 @@
1
+ import { resolveSqlConnection } from "./sql-connection-ref.js";
2
+ class SqlQueryResource {
3
+ manifest;
4
+ ctx;
5
+ constructor(manifest, ctx) {
6
+ this.manifest = manifest;
7
+ this.ctx = ctx;
8
+ }
9
+ async invoke(input) {
10
+ const m = this.manifest;
11
+ const ctx = this.ctx;
12
+ const expandedInput = ctx.expandValue(input, {});
13
+ const connection = resolveConnection(m.connection, m.transaction, ctx);
14
+ return runQuery(connection, m.transaction, expandedInput.sql, expandedInput.bindings);
15
+ }
16
+ }
17
+ function resolveConnection(connection, transaction, ctx) {
18
+ return (resolveSqlConnection(connection, ctx) ?? transaction?.getConnection() ?? failMissingConnection());
19
+ }
20
+ async function runQuery(connection, transaction, sql, params) {
21
+ const result = await connection.execute(sql, params, transaction);
22
+ return { rows: result.rows, rowCount: result.rows.length };
23
+ }
24
+ function failMissingConnection() {
25
+ throw new Error("Sql: either 'connection' or 'transaction' must be set");
26
+ }
27
+ export function register() { }
28
+ export async function create(resource, ctx) {
29
+ return new SqlQueryResource(resource, ctx);
30
+ }
@@ -0,0 +1,22 @@
1
+ import type { Invocable, ResourceContext, ResourceInstance } from "@telorun/sdk";
2
+ import type { SqlConnectionResource } from "./sql-connection-controller.js";
3
+ interface SqlTransactionManifest {
4
+ metadata: {
5
+ name: string;
6
+ module: string;
7
+ };
8
+ connection: SqlConnectionResource;
9
+ steps: Invocable;
10
+ inputs?: Record<string, unknown>;
11
+ }
12
+ export declare class SqlTransactionResource implements ResourceInstance {
13
+ private readonly manifest;
14
+ private readonly ctx;
15
+ constructor(manifest: SqlTransactionManifest, ctx: ResourceContext);
16
+ getConnection(): SqlConnectionResource;
17
+ assertActive(): void;
18
+ invoke(input: unknown): Promise<unknown>;
19
+ }
20
+ export declare function register(): void;
21
+ export declare function create(resource: SqlTransactionManifest, ctx: ResourceContext): Promise<SqlTransactionResource>;
22
+ export {};
@@ -0,0 +1,38 @@
1
+ import { resolveSqlConnection } from "./sql-connection-ref.js";
2
+ import { currentTxId } from "./transaction-store.js";
3
+ export class SqlTransactionResource {
4
+ manifest;
5
+ ctx;
6
+ constructor(manifest, ctx) {
7
+ this.manifest = manifest;
8
+ this.ctx = ctx;
9
+ }
10
+ getConnection() {
11
+ return (resolveSqlConnection(this.manifest.connection, this.ctx) ??
12
+ failMissingConnection(this.manifest.metadata.name));
13
+ }
14
+ assertActive() {
15
+ if (!currentTxId()) {
16
+ throw new Error(`Sql.Transaction '${this.manifest.metadata.name}': used outside an active transaction`);
17
+ }
18
+ }
19
+ async invoke(input) {
20
+ const m = this.manifest;
21
+ const ctx = this.ctx;
22
+ // Flat nesting: if already inside a transaction, reuse it
23
+ if (currentTxId()) {
24
+ const expandedInputs = ctx.expandValue(m.inputs ?? {}, input ?? {});
25
+ return m.steps.invoke(expandedInputs);
26
+ }
27
+ const conn = this.getConnection();
28
+ const expandedInputs = ctx.expandValue(m.inputs ?? {}, input ?? {});
29
+ return conn.transaction(() => m.steps.invoke(expandedInputs));
30
+ }
31
+ }
32
+ function failMissingConnection(name) {
33
+ throw new Error(`Sql.Transaction '${name}': missing connection`);
34
+ }
35
+ export function register() { }
36
+ export async function create(resource, ctx) {
37
+ return new SqlTransactionResource(resource, ctx);
38
+ }
@@ -0,0 +1,2 @@
1
+ import type { SqliteDb } from "./sqlite-driver-interface.js";
2
+ export declare function openDatabase(file: string): SqliteDb;
@@ -0,0 +1,31 @@
1
+ import { Database } from "bun:sqlite";
2
+ export function openDatabase(file) {
3
+ const db = new Database(file);
4
+ return {
5
+ prepare(sql) {
6
+ const stmt = db.prepare(sql);
7
+ return {
8
+ reader: true,
9
+ all(params) {
10
+ return stmt.all(...params);
11
+ },
12
+ run(params) {
13
+ const result = stmt.run(...params);
14
+ return {
15
+ changes: result.changes,
16
+ lastInsertRowid: result.lastInsertRowid,
17
+ };
18
+ },
19
+ iterate(params) {
20
+ return stmt.iterate(...params);
21
+ },
22
+ };
23
+ },
24
+ exec(sql) {
25
+ db.exec(sql);
26
+ },
27
+ close() {
28
+ db.close();
29
+ },
30
+ };
31
+ }
@@ -0,0 +1,14 @@
1
+ export interface SqliteStatement {
2
+ readonly reader: boolean;
3
+ all(params: ReadonlyArray<unknown>): unknown[];
4
+ run(params: ReadonlyArray<unknown>): {
5
+ changes: number | bigint;
6
+ lastInsertRowid: number | bigint;
7
+ };
8
+ iterate(params: ReadonlyArray<unknown>): IterableIterator<unknown>;
9
+ }
10
+ export interface SqliteDb {
11
+ prepare(sql: string): SqliteStatement;
12
+ exec(sql: string): void;
13
+ close(): void;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { SqliteDb } from "./sqlite-driver-interface.js";
2
+ export declare function openDatabase(file: string): SqliteDb;
@@ -0,0 +1,31 @@
1
+ import Database from "better-sqlite3";
2
+ export function openDatabase(file) {
3
+ const db = new Database(file);
4
+ return {
5
+ prepare(sql) {
6
+ const stmt = db.prepare(sql);
7
+ return {
8
+ reader: stmt.reader,
9
+ all(params) {
10
+ return stmt.all(...params);
11
+ },
12
+ run(params) {
13
+ const result = stmt.run(...params);
14
+ return {
15
+ changes: result.changes,
16
+ lastInsertRowid: result.lastInsertRowid,
17
+ };
18
+ },
19
+ iterate(params) {
20
+ return stmt.iterate(...params);
21
+ },
22
+ };
23
+ },
24
+ exec(sql) {
25
+ db.exec(sql);
26
+ },
27
+ close() {
28
+ db.close();
29
+ },
30
+ };
31
+ }
@@ -0,0 +1,9 @@
1
+ import { AsyncLocalStorage } from "async_hooks";
2
+ export interface TxEntry {
3
+ executor: unknown;
4
+ }
5
+ export declare const txStorage: AsyncLocalStorage<string>;
6
+ export declare const setTx: (id: string, entry: TxEntry) => void;
7
+ export declare const getTx: (id: string) => TxEntry | undefined;
8
+ export declare const deleteTx: (id: string) => void;
9
+ export declare const currentTxId: () => string | undefined;
@@ -0,0 +1,11 @@
1
+ import { AsyncLocalStorage } from "async_hooks";
2
+ const txMap = new Map();
3
+ export const txStorage = new AsyncLocalStorage();
4
+ export const setTx = (id, entry) => {
5
+ txMap.set(id, entry);
6
+ };
7
+ export const getTx = (id) => txMap.get(id);
8
+ export const deleteTx = (id) => {
9
+ txMap.delete(id);
10
+ };
11
+ export const currentTxId = () => txStorage.getStore();
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@telorun/sql",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "exports": {
6
+ "./sql-connection": {
7
+ "bun": "./src/sql-connection-controller.ts",
8
+ "import": "./dist/sql-connection-controller.js"
9
+ },
10
+ "./sql-query": {
11
+ "bun": "./src/sql-query-controller.ts",
12
+ "import": "./dist/sql-query-controller.js"
13
+ },
14
+ "./sql-exec": {
15
+ "bun": "./src/sql-exec-controller.ts",
16
+ "import": "./dist/sql-exec-controller.js"
17
+ },
18
+ "./sql-transaction": {
19
+ "bun": "./src/sql-transaction-controller.ts",
20
+ "import": "./dist/sql-transaction-controller.js"
21
+ },
22
+ "./sqlite-driver": {
23
+ "bun": "./src/sqlite-driver-bun.ts",
24
+ "import": "./dist/sqlite-driver-node.js"
25
+ },
26
+ "./sql-migration": {
27
+ "bun": "./src/sql-migration-controller.ts",
28
+ "import": "./dist/sql-migration-controller.js"
29
+ },
30
+ "./sql-migrations": {
31
+ "bun": "./src/sql-migrations-controller.ts",
32
+ "import": "./dist/sql-migrations-controller.js"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist/**"
37
+ ],
38
+ "dependencies": {
39
+ "better-sqlite3": "^12.8.0",
40
+ "pg": "^8.20.0",
41
+ "kysely": "^0.28.15",
42
+ "@telorun/sdk": "0.2.6"
43
+ },
44
+ "devDependencies": {
45
+ "@types/better-sqlite3": "^7.0.0",
46
+ "@types/bun": "^1.3.10",
47
+ "@types/node": "^20.0.0",
48
+ "@types/pg": "^8.0.0",
49
+ "typescript": "^5.0.0"
50
+ },
51
+ "scripts": {
52
+ "build": "tsc -p tsconfig.lib.json"
53
+ }
54
+ }