From 0a6ef179f89b71492458134aae4af9cd32b1e70d Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 9 Oct 2023 01:11:29 -0700 Subject: Create postgres.classes.ts --- src/bun.js/api/postgres.classes.ts | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/bun.js/api/postgres.classes.ts (limited to 'src/bun.js/api/postgres.classes.ts') diff --git a/src/bun.js/api/postgres.classes.ts b/src/bun.js/api/postgres.classes.ts new file mode 100644 index 000000000..1423e0da1 --- /dev/null +++ b/src/bun.js/api/postgres.classes.ts @@ -0,0 +1,60 @@ +import { define } from "../scripts/class-definitions"; + +export default [ + define({ + name: "PostgresSQLConnection", + construct: true, + finalize: true, + hasPendingActivity: true, + configurable: false, + klass: { + // escapeString: { + // fn: "escapeString", + // }, + // escapeIdentifier: { + // fn: "escapeIdentifier", + // }, + }, + JSType: "0b11101110", + proto: { + close: { + fn: "doClose", + }, + flush: { + fn: "doFlush", + }, + connected: { + getter: "getConnected", + }, + ref: { + fn: "doRef", + }, + unref: { + fn: "doUnref", + }, + query: { + fn: "createQuery", + }, + }, + }), + define({ + name: "PostgresSQLQuery", + construct: true, + finalize: true, + configurable: false, + JSType: "0b11101110", + klass: {}, + proto: { + run: { + fn: "doRun", + length: 2, + }, + cancel: { + fn: "doCancel", + length: 0, + }, + }, + values: ["instance"], + estimatedSize: true, + }), +]; -- cgit v1.2.3