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

@@ -0,0 +1,16 @@
import { describe, expect, it } from "vitest";
import { SQLocalConnection, type SQLocalConnectionConfig } from "../src";
describe(SQLocalConnection, () => {
function create(config: SQLocalConnectionConfig = {}) {
return new SQLocalConnection(config);
}
it("constructs", async () => {
const connection = create();
expect(() => connection.client).toThrow();
await connection.init();
expect(connection.client).toBeDefined();
expect(await connection.client.sql`SELECT 1`).toEqual([{ "1": 1 }]);
});
});