uql-orm 0.53.0 → 0.55.0
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/README.md +2 -2
- package/dist/browser/uql-browser.min.js.map +2 -2
- package/dist/bunSql/bunSql.util.d.ts +3 -14
- package/dist/bunSql/bunSql.util.js +33 -56
- package/dist/bunSql/bunSqlQuerier.d.ts +3 -6
- package/dist/bunSql/bunSqlQuerier.js +7 -13
- package/dist/bunSql/bunSqlQuerierPool.d.ts +10 -5
- package/dist/bunSql/bunSqlQuerierPool.js +25 -10
- package/dist/cockroachdb/cockroachDialect.d.ts +2 -5
- package/dist/cockroachdb/cockroachDialect.js +2 -5
- package/dist/cockroachdb/crdbQuerierPool.d.ts +1 -3
- package/dist/cockroachdb/crdbQuerierPool.js +0 -4
- package/dist/cockroachdb/index.d.ts +0 -1
- package/dist/cockroachdb/index.js +0 -1
- package/dist/d1/d1SqliteDialect.d.ts +5 -0
- package/dist/d1/d1SqliteDialect.js +7 -0
- package/dist/dialect/abstractSqlDialect.d.ts +15 -9
- package/dist/dialect/abstractSqlDialect.js +47 -54
- package/dist/dialect/hydrateColumn.js +2 -2
- package/dist/dialect/mergeSqlDialect.d.ts +2 -2
- package/dist/dialect/mergeSqlDialect.js +0 -4
- package/dist/dialect/mysqlLikeSqlDialect.d.ts +0 -3
- package/dist/dialect/mysqlLikeSqlDialect.js +0 -3
- package/dist/dialect/pgLikeSqlDialect.d.ts +5 -0
- package/dist/dialect/pgLikeSqlDialect.js +12 -2
- package/dist/entity/decorator/members.d.ts +3 -10
- package/dist/entity/index.d.ts +1 -1
- package/dist/entity/index.js +1 -1
- package/dist/entity/metadata/definition.d.ts +3 -1
- package/dist/entity/metadata/definition.js +8 -4
- package/dist/libsql/index.d.ts +0 -1
- package/dist/libsql/index.js +0 -1
- package/dist/libsql/libsqlQuerierPool.d.ts +3 -5
- package/dist/libsql/libsqlQuerierPool.js +2 -5
- package/dist/maria/mariadbQuerier.d.ts +0 -3
- package/dist/maria/mariadbQuerier.js +6 -7
- package/dist/maria/mariadbQuerierPool.js +4 -7
- package/dist/migrate/builder/migrationBuilder.js +0 -4
- package/dist/migrate/ddl/index.d.ts +3 -3
- package/dist/migrate/ddl/index.js +3 -3
- package/dist/migrate/migrator.d.ts +3 -7
- package/dist/migrate/migrator.js +3 -7
- package/dist/migrate/schemaGenerator.d.ts +0 -13
- package/dist/migrate/schemaGenerator.js +0 -13
- package/dist/migrate/storage/databaseStorage.d.ts +2 -2
- package/dist/migrate/storage/databaseStorage.js +2 -2
- package/dist/mongo/index.d.ts +0 -1
- package/dist/mongo/index.js +0 -1
- package/dist/mongo/mongoDialect.d.ts +0 -1
- package/dist/mongo/mongoDialect.js +3 -14
- package/dist/mongo/mongodbQuerier.d.ts +3 -5
- package/dist/mongo/mongodbQuerier.js +23 -23
- package/dist/mongo/mongodbQuerierPool.d.ts +2 -2
- package/dist/mongo/mongodbQuerierPool.js +2 -2
- package/dist/mssql/mssqlDialect.d.ts +5 -5
- package/dist/mssql/mssqlDialect.js +11 -8
- package/dist/mssql/mssqlQuerier.d.ts +13 -6
- package/dist/mssql/mssqlQuerier.js +30 -75
- package/dist/mssql/mssqlQuerierPool.js +2 -0
- package/dist/mssql/mssqlWireTypes.d.ts +3 -4
- package/dist/mssql/mssqlWireTypes.js +5 -8
- package/dist/mysql/index.d.ts +0 -1
- package/dist/mysql/index.js +0 -1
- package/dist/mysql/mysql2Querier.d.ts +1 -4
- package/dist/mysql/mysql2Querier.js +0 -3
- package/dist/mysql/mysql2QuerierPool.d.ts +2 -2
- package/dist/mysql/mysql2QuerierPool.js +5 -3
- package/dist/neon/index.d.ts +0 -2
- package/dist/neon/index.js +0 -2
- package/dist/neon/neonQuerierPool.d.ts +2 -4
- package/dist/neon/neonQuerierPool.js +2 -6
- package/dist/pglite/index.d.ts +0 -1
- package/dist/pglite/index.js +0 -1
- package/dist/pglite/pgliteQuerier.d.ts +3 -3
- package/dist/pglite/pgliteQuerier.js +1 -1
- package/dist/pglite/pgliteQuerierPool.d.ts +7 -2
- package/dist/pglite/pgliteQuerierPool.js +16 -6
- package/dist/postgres/abstractPgQuerierPool.d.ts +8 -12
- package/dist/postgres/abstractPgQuerierPool.js +8 -6
- package/dist/postgres/index.d.ts +0 -1
- package/dist/postgres/index.js +0 -1
- package/dist/postgres/pgNumericTypes.d.ts +5 -5
- package/dist/postgres/pgNumericTypes.js +11 -7
- package/dist/postgres/pgQuerier.d.ts +22 -4
- package/dist/postgres/pgQuerier.js +29 -2
- package/dist/postgres/pgQuerierPool.d.ts +2 -4
- package/dist/postgres/pgQuerierPool.js +2 -6
- package/dist/postgres/postgresDialect.d.ts +5 -5
- package/dist/postgres/postgresDialect.js +5 -5
- package/dist/postgres/postgresWireDriverCapabilities.d.ts +2 -2
- package/dist/postgres/postgresWireDriverCapabilities.js +2 -2
- package/dist/querier/abstractPoolQuerier.d.ts +1 -1
- package/dist/querier/abstractPoolQuerier.js +1 -1
- package/dist/querier/abstractQuerier.d.ts +17 -22
- package/dist/querier/abstractQuerier.js +80 -57
- package/dist/querier/abstractSqlQuerier.d.ts +20 -13
- package/dist/querier/abstractSqlQuerier.js +96 -100
- package/dist/schema/schemaASTBuilder.js +7 -7
- package/dist/sqlite/hranaQuerier.d.ts +6 -8
- package/dist/sqlite/hranaQuerier.js +13 -30
- package/dist/sqlite/hranaQuerierPool.d.ts +3 -4
- package/dist/sqlite/hranaQuerierPool.js +2 -1
- package/dist/sqlite/localSqliteQuerierPool.d.ts +3 -3
- package/dist/sqlite/localSqliteQuerierPool.js +4 -2
- package/dist/sqlite/nodeSqliteAdapter.d.ts +0 -1
- package/dist/sqlite/nodeSqliteQuerierPool.js +0 -2
- package/dist/sqlite/sqlitePragmas.d.ts +12 -0
- package/dist/sqlite/sqlitePragmas.js +15 -0
- package/dist/sqlite/sqliteQuerierPool.d.ts +0 -5
- package/dist/sqlite/sqliteQuerierPool.js +2 -13
- package/dist/turso/index.d.ts +0 -1
- package/dist/turso/index.js +0 -1
- package/dist/turso/tursoLocalQuerier.d.ts +0 -1
- package/dist/turso/tursoLocalQuerierPool.js +2 -2
- package/dist/turso/tursoQuerierPool.d.ts +1 -3
- package/dist/turso/tursoQuerierPool.js +0 -4
- package/dist/type/dialect.d.ts +1 -1
- package/dist/type/entity.d.ts +6 -11
- package/dist/type/migration.d.ts +0 -3
- package/dist/type/query.d.ts +12 -12
- package/dist/type/query.js +0 -6
- package/dist/type/universalQuerier.d.ts +3 -3
- package/dist/util/dialect.util.d.ts +4 -3
- package/dist/util/dialect.util.js +2 -1
- package/dist/util/field.util.d.ts +4 -16
- package/dist/util/field.util.js +6 -19
- package/dist/util/fieldOption.util.d.ts +1 -4
- package/dist/util/fieldOption.util.js +0 -2
- package/dist/util/logger.d.ts +10 -11
- package/dist/util/logger.js +21 -11
- package/dist/util/raw.d.ts +3 -10
- package/dist/util/raw.js +3 -3
- package/dist/util/sql.util.js +2 -2
- package/dist/util/sqlLiteral.js +3 -8
- package/dist/util/string.util.js +2 -6
- package/dist/util/wideNumber.d.ts +14 -0
- package/dist/util/wideNumber.js +24 -0
- package/package.json +1 -1
- package/dist/cockroachdb/crdbQuerier.d.ts +0 -8
- package/dist/cockroachdb/crdbQuerier.js +0 -6
- package/dist/libsql/libsqlQuerier.d.ts +0 -10
- package/dist/libsql/libsqlQuerier.js +0 -10
- package/dist/mongo/mongodbNativeDialect.d.ts +0 -9
- package/dist/mongo/mongodbNativeDialect.js +0 -9
- package/dist/mysql/mysql2Dialect.d.ts +0 -9
- package/dist/mysql/mysql2Dialect.js +0 -9
- package/dist/neon/neonDialect.d.ts +0 -10
- package/dist/neon/neonDialect.js +0 -10
- package/dist/neon/neonQuerier.d.ts +0 -5
- package/dist/neon/neonQuerier.js +0 -3
- package/dist/pglite/pgliteDialect.d.ts +0 -14
- package/dist/pglite/pgliteDialect.js +0 -14
- package/dist/postgres/abstractPgQuerier.d.ts +0 -24
- package/dist/postgres/abstractPgQuerier.js +0 -32
- package/dist/postgres/pgDialect.d.ts +0 -10
- package/dist/postgres/pgDialect.js +0 -10
- package/dist/turso/tursoQuerier.d.ts +0 -10
- package/dist/turso/tursoQuerier.js +0 -10
package/dist/util/string.util.js
CHANGED
|
@@ -6,14 +6,10 @@ export function kebabCase(val) {
|
|
|
6
6
|
return resp;
|
|
7
7
|
}
|
|
8
8
|
export function upperFirst(text) {
|
|
9
|
-
|
|
10
|
-
return text;
|
|
11
|
-
return text[0].toUpperCase() + text.slice(1);
|
|
9
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
12
10
|
}
|
|
13
11
|
export function lowerFirst(text) {
|
|
14
|
-
|
|
15
|
-
return text;
|
|
16
|
-
return text[0].toLowerCase() + text.slice(1);
|
|
12
|
+
return text.charAt(0).toLowerCase() + text.slice(1);
|
|
17
13
|
}
|
|
18
14
|
export function snakeCase(val) {
|
|
19
15
|
if (val === null || val === undefined)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RawRow } from '../type/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* A wide number as a JS number where that number is exact, and as its exact decimal text where it is
|
|
4
|
+
* not - past 2^53, where a number silently rounds. The one rule every driver decodes a BIGINT by, and
|
|
5
|
+
* hydration a numeric column a driver handed back as text: never a wrong number. `type: BigInt` is the
|
|
6
|
+
* declared way to a typed exact integer.
|
|
7
|
+
*/
|
|
8
|
+
export declare function decodeWideNumber(value: string | bigint): number | string;
|
|
9
|
+
/**
|
|
10
|
+
* {@link decodeWideNumber} over every `bigint` cell of a row, for the drivers that hand a BIGINT back
|
|
11
|
+
* as one (`bun:sql` with `bigint: true`, `mariadb`). In place: the row is the driver's fresh object, and
|
|
12
|
+
* a copy per row cost more than the decode it carried.
|
|
13
|
+
*/
|
|
14
|
+
export declare function decodeBigInts(row: RawRow): RawRow;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A wide number as a JS number where that number is exact, and as its exact decimal text where it is
|
|
3
|
+
* not - past 2^53, where a number silently rounds. The one rule every driver decodes a BIGINT by, and
|
|
4
|
+
* hydration a numeric column a driver handed back as text: never a wrong number. `type: BigInt` is the
|
|
5
|
+
* declared way to a typed exact integer.
|
|
6
|
+
*/
|
|
7
|
+
export function decodeWideNumber(value) {
|
|
8
|
+
const decoded = Number(value);
|
|
9
|
+
return Math.abs(decoded) <= Number.MAX_SAFE_INTEGER ? decoded : String(value);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* {@link decodeWideNumber} over every `bigint` cell of a row, for the drivers that hand a BIGINT back
|
|
13
|
+
* as one (`bun:sql` with `bigint: true`, `mariadb`). In place: the row is the driver's fresh object, and
|
|
14
|
+
* a copy per row cost more than the decode it carried.
|
|
15
|
+
*/
|
|
16
|
+
export function decodeBigInts(row) {
|
|
17
|
+
for (const key in row) {
|
|
18
|
+
const value = row[key];
|
|
19
|
+
if (typeof value === 'bigint') {
|
|
20
|
+
row[key] = decodeWideNumber(value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return row;
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"homepage": "https://uql-orm.dev",
|
|
4
4
|
"description": "The JSON-native TypeScript ORM for Bun, Browsers, Edge, Deno, Node, Workers. Supports PostgreSQL, PGlite, MySQL, MariaDB, SQLite, CockroachDB, SQL Server, Turso, Neon, Cloudflare D1 and MongoDB. Queries are plain JSON, typed to the leaf.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.55.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=24"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { PoolClient } from 'pg';
|
|
2
|
-
import { AbstractPgQuerier } from '../postgres/abstractPgQuerier.js';
|
|
3
|
-
import type { CockroachDialect } from './cockroachDialect.js';
|
|
4
|
-
/**
|
|
5
|
-
* Querier for CockroachDB utilizing the standard `pg` PoolClient.
|
|
6
|
-
*/
|
|
7
|
-
export declare class CrdbQuerier extends AbstractPgQuerier<PoolClient, CockroachDialect> {
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HranaQuerier } from '../sqlite/hranaQuerier.js';
|
|
2
|
-
/**
|
|
3
|
-
* Querier for the `@libsql/client` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Empty subclass by design: that client speaks the Hrana protocol, so the whole
|
|
6
|
-
* implementation is inherited. Kept as a distinct type for `LibsqlQuerierPool` and as a hook for
|
|
7
|
-
* future libsql-specific behavior.
|
|
8
|
-
*/
|
|
9
|
-
export declare class LibsqlQuerier extends HranaQuerier {
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HranaQuerier } from '../sqlite/hranaQuerier.js';
|
|
2
|
-
/**
|
|
3
|
-
* Querier for the `@libsql/client` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Empty subclass by design: that client speaks the Hrana protocol, so the whole
|
|
6
|
-
* implementation is inherited. Kept as a distinct type for `LibsqlQuerierPool` and as a hook for
|
|
7
|
-
* future libsql-specific behavior.
|
|
8
|
-
*/
|
|
9
|
-
export class LibsqlQuerier extends HranaQuerier {
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MongoDialect } from './mongoDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* MongoDB Dialect specialization for the official `mongodb` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Empty subclass by design: distinct type for `MongodbQuerierPool` and a hook
|
|
6
|
-
* for future driver-specific behavior.
|
|
7
|
-
*/
|
|
8
|
-
export declare class MongodbNativeDialect extends MongoDialect {
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MongoDialect } from './mongoDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* MongoDB Dialect specialization for the official `mongodb` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Empty subclass by design: distinct type for `MongodbQuerierPool` and a hook
|
|
6
|
-
* for future driver-specific behavior.
|
|
7
|
-
*/
|
|
8
|
-
export class MongodbNativeDialect extends MongoDialect {
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MySqlDialect } from './mysqlDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* MySQL Dialect specialization for the `mysql2` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Empty subclass by design: distinct type for `Mysql2QuerierPool` and a place
|
|
6
|
-
* for future mysql2-specific query or capability overrides.
|
|
7
|
-
*/
|
|
8
|
-
export declare class MySql2Dialect extends MySqlDialect {
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MySqlDialect } from './mysqlDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* MySQL Dialect specialization for the `mysql2` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Empty subclass by design: distinct type for `Mysql2QuerierPool` and a place
|
|
6
|
-
* for future mysql2-specific query or capability overrides.
|
|
7
|
-
*/
|
|
8
|
-
export class MySql2Dialect extends MySqlDialect {
|
|
9
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PostgresDialect } from '../postgres/postgresDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* Postgres dialect marker for the `@neondatabase/serverless` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Extends {@link PostgresDialect} with identical defaults (`explicitJsonCast: false`,
|
|
6
|
-
* `nativeArrays: true`, etc.). Kept as a distinct class for `NeonQuerierPool` typing and for
|
|
7
|
-
* Neon-only capability tweaks later without affecting `pg` or Bun pools.
|
|
8
|
-
*/
|
|
9
|
-
export declare class NeonDialect extends PostgresDialect {
|
|
10
|
-
}
|
package/dist/neon/neonDialect.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PostgresDialect } from '../postgres/postgresDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* Postgres dialect marker for the `@neondatabase/serverless` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Extends {@link PostgresDialect} with identical defaults (`explicitJsonCast: false`,
|
|
6
|
-
* `nativeArrays: true`, etc.). Kept as a distinct class for `NeonQuerierPool` typing and for
|
|
7
|
-
* Neon-only capability tweaks later without affecting `pg` or Bun pools.
|
|
8
|
-
*/
|
|
9
|
-
export class NeonDialect extends PostgresDialect {
|
|
10
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PoolClient } from '@neondatabase/serverless';
|
|
2
|
-
import { AbstractPgQuerier } from '../postgres/abstractPgQuerier.js';
|
|
3
|
-
import type { PostgresDialect } from '../postgres/postgresDialect.js';
|
|
4
|
-
export declare class NeonQuerier extends AbstractPgQuerier<PoolClient, PostgresDialect> {
|
|
5
|
-
}
|
package/dist/neon/neonQuerier.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PostgresDialect } from '../postgres/postgresDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* Postgres dialect for PGlite, the WASM Postgres build.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Keeps every {@link PostgresDialect} default, `dialectName` included: PGlite *is* Postgres,
|
|
6
|
-
* so the introspector, schema generator and CLI must all resolve to the Postgres ones. Both driver
|
|
7
|
-
* capabilities are inherited deliberately rather than by omission. `nativeArrays: true` holds because
|
|
8
|
-
* PGlite registers an array serializer for every built-in array type at boot and resolves each
|
|
9
|
-
* parameter's type from a server-side `Describe` before binding; `explicitJsonCast: false` holds
|
|
10
|
-
* because `PgLikeSqlDialect` already emits `$n::jsonb`, which is what makes that `Describe` report
|
|
11
|
-
* JSONB and select PGlite's `JSON.stringify` serializer. A bare `$n` would bind `[object Object]`.
|
|
12
|
-
*/
|
|
13
|
-
export declare class PgliteDialect extends PostgresDialect {
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PostgresDialect } from '../postgres/postgresDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* Postgres dialect for PGlite, the WASM Postgres build.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Keeps every {@link PostgresDialect} default, `dialectName` included: PGlite *is* Postgres,
|
|
6
|
-
* so the introspector, schema generator and CLI must all resolve to the Postgres ones. Both driver
|
|
7
|
-
* capabilities are inherited deliberately rather than by omission. `nativeArrays: true` holds because
|
|
8
|
-
* PGlite registers an array serializer for every built-in array type at boot and resolves each
|
|
9
|
-
* parameter's type from a server-side `Describe` before binding; `explicitJsonCast: false` holds
|
|
10
|
-
* because `PgLikeSqlDialect` already emits `$n::jsonb`, which is what makes that `Describe` report
|
|
11
|
-
* JSONB and select PGlite's `JSON.stringify` serializer. A bare `$n` would bind `[object Object]`.
|
|
12
|
-
*/
|
|
13
|
-
export class PgliteDialect extends PostgresDialect {
|
|
14
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { AbstractSqlDialect } from '../dialect/index.js';
|
|
2
|
-
import { AbstractPoolQuerier } from '../querier/abstractPoolQuerier.js';
|
|
3
|
-
import type { ExtraOptions, RawRow } from '../type/index.js';
|
|
4
|
-
export interface PgAnyClient {
|
|
5
|
-
query(text: string, values?: unknown[]): Promise<{
|
|
6
|
-
rows: RawRow[];
|
|
7
|
-
rowCount: number | null;
|
|
8
|
-
}>;
|
|
9
|
-
query(stream: object): AsyncIterable<RawRow> & {
|
|
10
|
-
destroy(): void;
|
|
11
|
-
};
|
|
12
|
-
/** Any truthy argument makes `pg-pool` evict the client instead of returning it to the idle list. */
|
|
13
|
-
release(discard?: boolean): void | Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Shared base class for Postgres-compatible queriers (standard pg, CockroachDB, Neon).
|
|
17
|
-
*/
|
|
18
|
-
export declare abstract class AbstractPgQuerier<C extends PgAnyClient, D extends AbstractSqlDialect> extends AbstractPoolQuerier<C> {
|
|
19
|
-
constructor(connect: () => Promise<C>, dialect: D, extra?: ExtraOptions);
|
|
20
|
-
internalAll<T>(query: string, values?: unknown[]): Promise<T[]>;
|
|
21
|
-
internalRun(query: string, values?: unknown[]): Promise<import("../type/query.js").QueryUpdateResult>;
|
|
22
|
-
internalStream<T>(query: string, values?: unknown[]): AsyncGenerator<Awaited<T>, void, unknown>;
|
|
23
|
-
protected releaseConn(conn: C, discard: boolean): Promise<void>;
|
|
24
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { AbstractPoolQuerier } from '../querier/abstractPoolQuerier.js';
|
|
2
|
-
/**
|
|
3
|
-
* Shared base class for Postgres-compatible queriers (standard pg, CockroachDB, Neon).
|
|
4
|
-
*/
|
|
5
|
-
export class AbstractPgQuerier extends AbstractPoolQuerier {
|
|
6
|
-
constructor(connect, dialect, extra) {
|
|
7
|
-
super(dialect, connect, extra);
|
|
8
|
-
}
|
|
9
|
-
async internalAll(query, values) {
|
|
10
|
-
const res = await this.getConn().query(query, values);
|
|
11
|
-
return res.rows;
|
|
12
|
-
}
|
|
13
|
-
async internalRun(query, values) {
|
|
14
|
-
const res = await this.getConn().query(query, values);
|
|
15
|
-
return this.buildUpdateResult({ rows: res.rows, changes: res.rowCount ?? 0 });
|
|
16
|
-
}
|
|
17
|
-
async *internalStream(query, values) {
|
|
18
|
-
const { default: QueryStream } = await import('pg-query-stream');
|
|
19
|
-
const stream = this.getConn().query(new QueryStream(query, values));
|
|
20
|
-
try {
|
|
21
|
-
for await (const row of stream) {
|
|
22
|
-
yield row;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
finally {
|
|
26
|
-
stream.destroy();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
async releaseConn(conn, discard) {
|
|
30
|
-
await conn.release(discard);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PostgresDialect } from './postgresDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* Postgres dialect for the Node.js `pg` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Uses base {@link PostgresDialect} capabilities: native JS arrays for `ANY` / `ALL`
|
|
6
|
-
* (`nativeArrays: true`) and `$n::jsonb` without a text re-cast. Bun SQL Postgres needs
|
|
7
|
-
* `BunSqlQuerierPool` from `uql-orm/bunSql` instead (wire array literals + text json cast).
|
|
8
|
-
*/
|
|
9
|
-
export declare class PgDialect extends PostgresDialect {
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PostgresDialect } from './postgresDialect.js';
|
|
2
|
-
/**
|
|
3
|
-
* Postgres dialect for the Node.js `pg` driver.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Uses base {@link PostgresDialect} capabilities: native JS arrays for `ANY` / `ALL`
|
|
6
|
-
* (`nativeArrays: true`) and `$n::jsonb` without a text re-cast. Bun SQL Postgres needs
|
|
7
|
-
* `BunSqlQuerierPool` from `uql-orm/bunSql` instead (wire array literals + text json cast).
|
|
8
|
-
*/
|
|
9
|
-
export class PgDialect extends PostgresDialect {
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HranaQuerier } from '../sqlite/hranaQuerier.js';
|
|
2
|
-
/**
|
|
3
|
-
* Querier for remote Turso Cloud databases over `@tursodatabase/serverless/compat`.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Empty subclass by design: that compat client speaks the Hrana protocol, so the whole
|
|
6
|
-
* implementation is inherited. Kept as a distinct type so `TursoQuerierPool` does not expose a
|
|
7
|
-
* libsql-named class.
|
|
8
|
-
*/
|
|
9
|
-
export declare class TursoQuerier extends HranaQuerier {
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HranaQuerier } from '../sqlite/hranaQuerier.js';
|
|
2
|
-
/**
|
|
3
|
-
* Querier for remote Turso Cloud databases over `@tursodatabase/serverless/compat`.
|
|
4
|
-
*
|
|
5
|
-
* @remarks Empty subclass by design: that compat client speaks the Hrana protocol, so the whole
|
|
6
|
-
* implementation is inherited. Kept as a distinct type so `TursoQuerierPool` does not expose a
|
|
7
|
-
* libsql-named class.
|
|
8
|
-
*/
|
|
9
|
-
export class TursoQuerier extends HranaQuerier {
|
|
10
|
-
}
|