mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
add sqlocal connection including example
This commit is contained in:
@@ -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 }]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user