@happyvertical/sql 0.115.1 → 0.116.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/README.md +38 -0
- package/dist/chunks/{duckdb-aMJ05d68.js → duckdb-ddmnqn5l.js} +9 -3
- package/dist/chunks/duckdb-ddmnqn5l.js.map +1 -0
- package/dist/chunks/postgres-dbGVT9aR.js +610 -0
- package/dist/chunks/postgres-dbGVT9aR.js.map +1 -0
- package/dist/chunks/{postgres-dialect-C8GwYO-9.js → postgres-dialect-uyqX-KB-.js} +76 -458
- package/dist/chunks/postgres-dialect-uyqX-KB-.js.map +1 -0
- package/dist/chunks/{query-CcLSVKOo.js → query-DFAYXNk-.js} +47 -2
- package/dist/chunks/{query-CcLSVKOo.js.map → query-DFAYXNk-.js.map} +1 -1
- package/dist/chunks/{sqlite-DAzuB3Hb.js → sqlite-DQXS8fAo.js} +12 -11
- package/dist/chunks/sqlite-DQXS8fAo.js.map +1 -0
- package/dist/chunks/{sqlite-engine-ByvkAlrK.js → sqlite-engine-DpcUbF-P.js} +2 -2
- package/dist/chunks/{sqlite-engine-ByvkAlrK.js.map → sqlite-engine-DpcUbF-P.js.map} +1 -1
- package/dist/chunks/{sqlite-native-Dj0hF4qn.js → sqlite-native-BJcrl8b4.js} +7 -5
- package/dist/chunks/sqlite-native-BJcrl8b4.js.map +1 -0
- package/dist/chunks/transaction-lock-BX2GJ4ei.js +415 -0
- package/dist/chunks/transaction-lock-BX2GJ4ei.js.map +1 -0
- package/dist/chunks/types-DihIt7ez.js.map +1 -1
- package/dist/doctor.d.ts +30 -5
- package/dist/doctor.d.ts.map +1 -1
- package/dist/duckdb.d.ts.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -632
- package/dist/index.js.map +1 -1
- package/dist/pglite.d.ts.map +1 -1
- package/dist/pglite.js +4 -6
- package/dist/pglite.js.map +1 -1
- package/dist/postgres.d.ts.map +1 -1
- package/dist/query.js +1 -1
- package/dist/shared/duckdb-schema-utils.d.ts +13 -0
- package/dist/shared/duckdb-schema-utils.d.ts.map +1 -1
- package/dist/shared/postgres-dialect.d.ts +16 -1
- package/dist/shared/postgres-dialect.d.ts.map +1 -1
- package/dist/shared/types.d.ts +35 -4
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/sqlite-native.d.ts.map +1 -1
- package/dist/sqlite.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/duckdb-aMJ05d68.js.map +0 -1
- package/dist/chunks/postgres-dialect-C8GwYO-9.js.map +0 -1
- package/dist/chunks/sqlite-DAzuB3Hb.js.map +0 -1
- package/dist/chunks/sqlite-native-Dj0hF4qn.js.map +0 -1
package/dist/doctor.d.ts
CHANGED
|
@@ -3,15 +3,39 @@ export type DoctorLevel = 'fail' | 'warn';
|
|
|
3
3
|
export interface DoctorIssue {
|
|
4
4
|
level: DoctorLevel;
|
|
5
5
|
message: string;
|
|
6
|
+
/**
|
|
7
|
+
* Schema the issue was found in. Set only when `schemas` or `allSchemas` was
|
|
8
|
+
* passed to {@link runDoctor}; the message is then prefixed `[schema] `.
|
|
9
|
+
*/
|
|
10
|
+
schema?: string;
|
|
6
11
|
}
|
|
7
12
|
export interface DoctorContext {
|
|
8
13
|
db: DatabaseInterface;
|
|
14
|
+
/** Names of the tables in the schema being checked. */
|
|
9
15
|
tables: Set<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Schema being checked. Table names in checks resolve against it: when
|
|
18
|
+
* `schemas` or `allSchemas` was passed, `db` is a transaction whose
|
|
19
|
+
* `search_path` is set to this schema alone.
|
|
20
|
+
*/
|
|
21
|
+
schema: string;
|
|
10
22
|
}
|
|
11
23
|
export type DoctorCheck = (ctx: DoctorContext) => Promise<DoctorIssue[]>;
|
|
12
24
|
export interface RunDoctorOptions {
|
|
13
25
|
db: DatabaseInterface;
|
|
14
26
|
checks: DoctorCheck[];
|
|
27
|
+
/**
|
|
28
|
+
* Schema, or list of schemas, to check. Every check runs once per schema,
|
|
29
|
+
* with unqualified table names resolving to that schema, so two schemas that
|
|
30
|
+
* each hold a table of the same name are checked separately. Defaults to
|
|
31
|
+
* `public`.
|
|
32
|
+
*/
|
|
33
|
+
schemas?: string | readonly string[];
|
|
34
|
+
/**
|
|
35
|
+
* Check every non-system schema (everything except `information_schema` and
|
|
36
|
+
* `pg_*`) instead of `schemas`. Takes precedence over `schemas`.
|
|
37
|
+
*/
|
|
38
|
+
allSchemas?: boolean;
|
|
15
39
|
}
|
|
16
40
|
export interface DoctorResult {
|
|
17
41
|
failures: DoctorIssue[];
|
|
@@ -19,12 +43,13 @@ export interface DoctorResult {
|
|
|
19
43
|
issues: DoctorIssue[];
|
|
20
44
|
}
|
|
21
45
|
/**
|
|
22
|
-
* Execute every check against the
|
|
23
|
-
*
|
|
24
|
-
* format/exit as they see fit.
|
|
46
|
+
* Execute every check against the tables of `db` and partition the results by
|
|
47
|
+
* severity. Returns the aggregate; callers format/exit as they see fit.
|
|
25
48
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
49
|
+
* By default only the `public` schema is checked, exactly as before. Pass
|
|
50
|
+
* `schemas` or `allSchemas` to check others: each schema's table set is
|
|
51
|
+
* enumerated once and shared across that schema's checks, which run in a
|
|
52
|
+
* transaction with `search_path` set to the schema.
|
|
28
53
|
*/
|
|
29
54
|
export declare function runDoctor(options: RunDoctorOptions): Promise<DoctorResult>;
|
|
30
55
|
/**
|
package/dist/doctor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAC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Q,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CAa5E;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,CAkBrE;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,CAsBrE"}
|
package/dist/duckdb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duckdb.d.ts","sourceRoot":"","sources":["../src/duckdb.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"duckdb.d.ts","sourceRoot":"","sources":["../src/duckdb.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAEV,iBAAiB,EACjB,aAAa,EASd,MAAM,mBAAgB,CAAC;AAuQxB;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAuyC5B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -54,7 +54,14 @@ export type { AggregateArithmeticOp, AggregateComparisonOp, AggregateExpression,
|
|
|
54
54
|
export { checkExpectedTables, checkRelationship, checkUniqueColumn, type DoctorCheck, type DoctorContext, type DoctorIssue, type DoctorLevel, type DoctorResult, type RelationshipSpec, type RunDoctorOptions, runDoctor, type UniqueColumnSpec, } from "./doctor.js";
|
|
55
55
|
export { clearConnectionCache } from './json.js';
|
|
56
56
|
export type { PGliteLike, PGliteOptions } from "./pglite.js";
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Clears the PostgreSQL connection cache.
|
|
59
|
+
* Useful for test isolation and reconnection scenarios.
|
|
60
|
+
*
|
|
61
|
+
* The PostgreSQL adapter (and its `pg` driver) loads on first call, so the
|
|
62
|
+
* root entry does not pull the driver in for callers that never use it.
|
|
63
|
+
*/
|
|
64
|
+
export declare function clearPostgresConnectionCache(): Promise<void>;
|
|
58
65
|
export { assertCanExportDatabase, assertCanImportDatabase, type CreateDropOptions, createPostgresDatabase, type DumpOptions, databaseNameFromUrl, dropPostgresDatabase, dumpPostgresDatabase, isLocalDatabaseUrl, type PostgresImportLocalityOptions, type PostgresLocalityOptions, postgresEnvFromUrl, type RestoreOptions, redactDatabaseUrl, restorePostgresDatabase, } from "./postgres-cli.js";
|
|
59
66
|
export { type AggregateBuildResult, type AggregateFunction, type AggregateSelectExpr, type AggregateSpec, type AggregateTimeBucketUnit, bucketExpr, buildAggregate, buildWhere, convertUniqueIndexesToInlineConstraints, DatabaseSchemaManager, ExpressionError, type ExpressionErrorCode, type ExpressionResultType, escapeSqlValue, formatDbError, type PortableExpression, type RawSqlKey, type RenderExpressionOptions, type RenderExpressionResult, raw, renderExpression, type SchemaInitializationResult, type SqlAdapterType, syncSchema, type TypedDateLiteral, tableExists, validateColumnName, } from './query.js';
|
|
60
67
|
export type { SecureSqliteWindowsCustody } from './secure-sqlite-client.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAY,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,aAAa,EACd,MAAM,mBAA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