kern-orm 0.8.0 → 0.9.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/dist/{driver-error-Dx5R83Rp.mjs → database-t66EaIGE.mjs} +359 -177
- package/dist/{index-B1aH5Ht0.d.mts → index-2z5iTzXf.d.mts} +356 -23
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +273 -2
- package/dist/testing.d.mts +2 -2
- package/dist/testing.mjs +85 -58
- package/dist/types.d.mts +1 -1
- package/package.json +1 -1
|
@@ -244,11 +244,19 @@ interface DriverResult {
|
|
|
244
244
|
* It rejects with `QueryError` a statement or script that PostgreSQL rejected, whose connection stays usable, and with `ConnectionError` any other failure of a statement, a script, or a connection.
|
|
245
245
|
*/
|
|
246
246
|
interface Driver {
|
|
247
|
-
/**
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
/**
|
|
248
|
+
* Executes a statement on any pooled connection.
|
|
249
|
+
*
|
|
250
|
+
* It rejects a statement that leaves its connection in a transaction, such as `BEGIN`, with `ConnectionError`, and leaves no transaction open on the pool.
|
|
251
|
+
*/
|
|
250
252
|
execute(statement: SqlStatement): Promise<DriverResult>;
|
|
251
|
-
/**
|
|
253
|
+
/**
|
|
254
|
+
* Executes a script of statements without parameters, such as DDL separated by semicolons, on any pooled connection, where PostgreSQL runs them in one implicit transaction.
|
|
255
|
+
*
|
|
256
|
+
* It rejects a script that leaves its connection in a transaction as `execute` rejects such a statement.
|
|
257
|
+
* A script whose statement PostgreSQL rejected in that transaction may reject with that `QueryError` instead.
|
|
258
|
+
* Either way, no transaction stays open on the pool.
|
|
259
|
+
*/
|
|
252
260
|
executeScript(text: string): Promise<void>;
|
|
253
261
|
/** Reserves a dedicated connection, such as for a transaction. */
|
|
254
262
|
acquire(): Promise<Connection>;
|
|
@@ -270,16 +278,12 @@ interface Connection {
|
|
|
270
278
|
/** Executes a script of statements without parameters on the connection, in the order of calls with its statements. */
|
|
271
279
|
executeScript(text: string): Promise<void>;
|
|
272
280
|
/**
|
|
273
|
-
* Returns the connection to the pool.
|
|
281
|
+
* Returns the connection to the pool once its statements complete, if PostgreSQL reported an idle transaction status after the last statement; otherwise the driver closes it, which rolls back a transaction left on it.
|
|
274
282
|
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
283
|
+
* The driver tells by itself how the statements on the connection ended.
|
|
284
|
+
* After a `ConnectionError`, a statement may still run or the connection may be lost, so the driver closes the connection, unless its client refused the statement without breaking the exchange of messages and still reads the status, such as postgres.js 4 for a statement of too many parameters.
|
|
277
285
|
*/
|
|
278
|
-
release(
|
|
279
|
-
}
|
|
280
|
-
/** Failure of the last statement on a reserved connection, after which the connection may not be idle. */
|
|
281
|
-
interface TransactionFailure {
|
|
282
|
-
readonly error: unknown;
|
|
286
|
+
release(): void | Promise<void>;
|
|
283
287
|
}
|
|
284
288
|
/** Field of a compiled result: the key of a record and how its value is decoded. */
|
|
285
289
|
type ResultField = ScalarField | NestedField;
|
|
@@ -2707,6 +2711,21 @@ interface TestTransactionOptions {
|
|
|
2707
2711
|
* Queries that the test has already sent complete before the rollback.
|
|
2708
2712
|
*/
|
|
2709
2713
|
signal?: AbortSignal;
|
|
2714
|
+
/**
|
|
2715
|
+
* Isolation level of the test transaction, such as `serializable`, for code under test that starts a transaction at that level.
|
|
2716
|
+
*
|
|
2717
|
+
* Inside a test fixture, the test transaction runs at the level of the fixture: given another level, it rejects.
|
|
2718
|
+
*/
|
|
2719
|
+
isolation?: IsolationLevel;
|
|
2720
|
+
}
|
|
2721
|
+
/** Options of `useTestFixture`. */
|
|
2722
|
+
interface TestFixtureOptions {
|
|
2723
|
+
/**
|
|
2724
|
+
* Isolation level of the transaction of the fixture, such as `serializable`, at which the test transactions and fixtures nested in it run.
|
|
2725
|
+
*
|
|
2726
|
+
* A fixture nested in another one runs at the level of that fixture: given another level, it rejects.
|
|
2727
|
+
*/
|
|
2728
|
+
isolation?: IsolationLevel;
|
|
2710
2729
|
}
|
|
2711
2730
|
/** Test transactions and test fixtures of a database created with `test: true`. */
|
|
2712
2731
|
interface TestHelpers {
|
|
@@ -2725,7 +2744,7 @@ interface TestHelpers {
|
|
|
2725
2744
|
* Test fixtures nest: a new one opens inside the innermost open one, and test transactions run in the innermost one.
|
|
2726
2745
|
* A fixture whose `seed` rejects rolls back and closes.
|
|
2727
2746
|
*/
|
|
2728
|
-
useTestFixture<T>(seed: () => Promise<T
|
|
2747
|
+
useTestFixture<T>(seed: () => Promise<T>, options?: TestFixtureOptions): TestFixture<T>;
|
|
2729
2748
|
}
|
|
2730
2749
|
/** Creates the test helpers of a database created with `test: true`, registering fixtures with the hooks of a test runner. */
|
|
2731
2750
|
declare function createTestHelpers(database: Database, hooks: TestHooks): TestHelpers;
|
|
@@ -2739,17 +2758,16 @@ declare class TransactionCoordinator {
|
|
|
2739
2758
|
readonly driver: Driver;
|
|
2740
2759
|
/** Rejects statements and transactions outside a test transaction or the seed of a test fixture instead of running them on the pool. */
|
|
2741
2760
|
readonly test: boolean;
|
|
2742
|
-
constructor(driver: Driver,
|
|
2743
|
-
/** Rejects statements and transactions outside a test transaction or the seed of a test fixture instead of running them on the pool. */
|
|
2744
|
-
test?: boolean);
|
|
2761
|
+
constructor(driver: Driver, { test, onReleaseError }?: Omit<DatabaseOptions, "driver">);
|
|
2745
2762
|
execute(statement: SqlStatement): Promise<DriverResult>;
|
|
2746
2763
|
/** Executes a script of statements without parameters where `execute` executes a statement. */
|
|
2747
2764
|
executeScript(text: string): Promise<void>;
|
|
2748
2765
|
/**
|
|
2749
2766
|
* Runs `callback` in a transaction that commits when it resolves and rolls back when it rejects, with the settings of `options`.
|
|
2750
2767
|
*
|
|
2751
|
-
* Inside a transaction, it runs `callback` in a savepoint nested in it, which restores the settings it changed when it ends.
|
|
2768
|
+
* Inside a transaction, it runs `callback` in a savepoint nested in it, which restores the settings it changed when it ends, and rejects without the savepoint when the isolation level of `options` differs from that of the transaction.
|
|
2752
2769
|
* A failed cleanup after an error rejects with a `SuppressedError` that keeps the original error in its `suppressed` chain.
|
|
2770
|
+
* A transaction that it starts rolls back instead of `COMMIT` after a `ConnectionError` on its connection, and when it rejects after such an error, also of `COMMIT`, it rejects with `TransactionConnectionError` of the phase of the failure, whose `cause` is the error it would reject with otherwise.
|
|
2753
2771
|
*/
|
|
2754
2772
|
transaction<T>(callback: () => Promise<T>, options?: TransactionOptions): Promise<T>;
|
|
2755
2773
|
/**
|
|
@@ -2774,21 +2792,21 @@ declare class TransactionCoordinator {
|
|
|
2774
2792
|
* A failure to start or end the level after the abort suppresses the reason in a `SuppressedError`.
|
|
2775
2793
|
* Aborted while it waits for its turn in the fixture stack or for a connection, it rejects at once; after the abort, it never calls `callback`.
|
|
2776
2794
|
*/
|
|
2777
|
-
testTransaction<T>(callback: () => Promise<T>,
|
|
2795
|
+
testTransaction<T>(callback: () => Promise<T>, options?: TestTransactionOptions): Promise<T>;
|
|
2778
2796
|
/**
|
|
2779
2797
|
* Opens a test fixture: a transaction on a reserved connection, or a savepoint in the innermost open fixture, and runs `seed` in it.
|
|
2780
2798
|
*
|
|
2781
2799
|
* Test transactions started outside any transaction run in the innermost fixture.
|
|
2782
2800
|
* A fixture whose `seed` rejects rolls back and closes.
|
|
2783
2801
|
*/
|
|
2784
|
-
createTestFixture<T>(seed: () => Promise<T
|
|
2802
|
+
createTestFixture<T>(seed: () => Promise<T>, options?: TestFixtureOptions): Promise<OpenedTestFixture<T>>;
|
|
2785
2803
|
/**
|
|
2786
2804
|
* Starts opening a test fixture, see `createTestFixture`, and returns it with a `close` that can be called before it opens.
|
|
2787
2805
|
*
|
|
2788
2806
|
* Closing before the fixture opens rejects the opening without waiting for `seed` and rolls the fixture back, so a fixture or test transaction started after `close` never nests in it, even when its `seed` never settles.
|
|
2789
2807
|
* Closing an open fixture also closes the fixtures opening in it.
|
|
2790
2808
|
*/
|
|
2791
|
-
startTestFixture<T>(seed: () => Promise<T
|
|
2809
|
+
startTestFixture<T>(seed: () => Promise<T>, options?: TestFixtureOptions): PendingTestFixture<T>;
|
|
2792
2810
|
/**
|
|
2793
2811
|
* Closes the test fixtures, including those still opening, and then the driver, which waits for the running transactions to end.
|
|
2794
2812
|
*
|
|
@@ -2854,8 +2872,16 @@ interface Database extends AsyncDisposable {
|
|
|
2854
2872
|
/** Rolls back the open test fixtures and closes the connections of the driver once the running transactions end. */
|
|
2855
2873
|
close(): Promise<void>;
|
|
2856
2874
|
}
|
|
2875
|
+
/** Isolation level of a transaction in PostgreSQL. */
|
|
2876
|
+
type IsolationLevel = "read committed" | "repeatable read" | "serializable";
|
|
2857
2877
|
/** Options of `transaction` of a `Database` and `$transaction` of a `Db`. */
|
|
2858
2878
|
interface TransactionOptions {
|
|
2879
|
+
/**
|
|
2880
|
+
* Isolation level of the transaction, such as `serializable`.
|
|
2881
|
+
*
|
|
2882
|
+
* A nested transaction runs at the level of its transaction: given another level, it rejects.
|
|
2883
|
+
*/
|
|
2884
|
+
isolation?: IsolationLevel;
|
|
2859
2885
|
/**
|
|
2860
2886
|
* PostgreSQL schemas where the unqualified names of the statements of the transaction resolve, in their order, such as the schema of a tenant followed by the schema of extensions.
|
|
2861
2887
|
*
|
|
@@ -2868,9 +2894,15 @@ interface DatabaseOptions {
|
|
|
2868
2894
|
driver: Driver;
|
|
2869
2895
|
/** Rejects queries and transactions outside the test transactions and the seeds of test fixtures of `kern-orm/testing`, so that every statement of the tests runs in a transaction that rolls back. */
|
|
2870
2896
|
test?: boolean;
|
|
2897
|
+
/**
|
|
2898
|
+
* Receives a failure to release the connection of a transaction, such as to log it; the failure does not change the result or error of the transaction.
|
|
2899
|
+
*
|
|
2900
|
+
* Without it, the failure goes to `console.error`.
|
|
2901
|
+
*/
|
|
2902
|
+
onReleaseError?: (error: unknown) => void;
|
|
2871
2903
|
}
|
|
2872
2904
|
/** Creates a database over a driver; its transactions are shared by every schema bound to it. */
|
|
2873
|
-
declare function createDatabase({ driver,
|
|
2905
|
+
declare function createDatabase({ driver, ...options }: DatabaseOptions): Database;
|
|
2874
2906
|
/** Physical placement of the tables of a schema bound to a database. */
|
|
2875
2907
|
interface BindOptions {
|
|
2876
2908
|
/** PostgreSQL schema of the tables; a function is called on every query, such as to resolve the current tenant. */
|
|
@@ -3361,7 +3393,7 @@ declare class QueryError extends Error {
|
|
|
3361
3393
|
* The statement may have run or not, and its connection may be lost or in an unknown state of its transaction.
|
|
3362
3394
|
*/
|
|
3363
3395
|
declare class ConnectionError extends Error {
|
|
3364
|
-
readonly name
|
|
3396
|
+
readonly name: string;
|
|
3365
3397
|
constructor(message: string, options?: {
|
|
3366
3398
|
cause?: unknown;
|
|
3367
3399
|
});
|
|
@@ -3390,6 +3422,307 @@ interface DriverErrorFields {
|
|
|
3390
3422
|
* With a translated severity, the SQLSTATE tells an error that ends the session, so a few errors of other codes that end it give `QueryError`.
|
|
3391
3423
|
*/
|
|
3392
3424
|
declare function toDriverError(error: unknown, fields?: DriverErrorFields): QueryError | ConnectionError;
|
|
3425
|
+
/** Phase of a transaction in which its connection failed. */
|
|
3426
|
+
type TransactionPhase = TransactionConnectionError["phase"];
|
|
3427
|
+
/**
|
|
3428
|
+
* Error of a transaction whose connection failed, which tells whether the transaction may have been committed.
|
|
3429
|
+
*
|
|
3430
|
+
* Its `cause` is the error that the transaction would reject with otherwise, such as the error of the callback, or a `SuppressedError` of a failed rollback that keeps it.
|
|
3431
|
+
*/
|
|
3432
|
+
declare class TransactionConnectionError extends ConnectionError {
|
|
3433
|
+
readonly name: string;
|
|
3434
|
+
/**
|
|
3435
|
+
* Phase of the transaction in which its connection failed:
|
|
3436
|
+
*
|
|
3437
|
+
* - `begin`: before the callback, such as getting the connection or `BEGIN`, so the transaction applied nothing;
|
|
3438
|
+
* - `transaction`: in the callback or its rollback, so the transaction was rolled back;
|
|
3439
|
+
* - `commit`: during `COMMIT`, so whether the transaction was committed is unknown.
|
|
3440
|
+
*/
|
|
3441
|
+
readonly phase: "begin" | "transaction" | "commit";
|
|
3442
|
+
constructor(phase: TransactionPhase, options?: {
|
|
3443
|
+
cause?: unknown;
|
|
3444
|
+
});
|
|
3445
|
+
/** Tells whether `value` is an instance of the class, including one of `TransactionConnectionError` of another copy of kern-orm. */
|
|
3446
|
+
static [Symbol.hasInstance]<T>(this: abstract new (...args: never) => T, value: unknown): value is T;
|
|
3447
|
+
}
|
|
3448
|
+
/**
|
|
3449
|
+
* Condition names of the SQLSTATE codes of PostgreSQL errors, by code: the codes of type `E` with a condition name, which PL/pgSQL takes in `EXCEPTION WHEN`, under the headings of their classes.
|
|
3450
|
+
*
|
|
3451
|
+
* A code that ends in `000` is the condition of its class.
|
|
3452
|
+
* A few names have two codes, such as `null_value_not_allowed`.
|
|
3453
|
+
*/
|
|
3454
|
+
declare const conditionsByCode: {
|
|
3455
|
+
readonly "03000": "sql_statement_not_yet_complete";
|
|
3456
|
+
readonly "08000": "connection_exception";
|
|
3457
|
+
readonly "08003": "connection_does_not_exist";
|
|
3458
|
+
readonly "08006": "connection_failure";
|
|
3459
|
+
readonly "08001": "sqlclient_unable_to_establish_sqlconnection";
|
|
3460
|
+
readonly "08004": "sqlserver_rejected_establishment_of_sqlconnection";
|
|
3461
|
+
readonly "08007": "transaction_resolution_unknown";
|
|
3462
|
+
readonly "08P01": "protocol_violation";
|
|
3463
|
+
readonly "09000": "triggered_action_exception";
|
|
3464
|
+
readonly "0A000": "feature_not_supported";
|
|
3465
|
+
readonly "0B000": "invalid_transaction_initiation";
|
|
3466
|
+
readonly "0F000": "locator_exception";
|
|
3467
|
+
readonly "0F001": "invalid_locator_specification";
|
|
3468
|
+
readonly "0L000": "invalid_grantor";
|
|
3469
|
+
readonly "0LP01": "invalid_grant_operation";
|
|
3470
|
+
readonly "0P000": "invalid_role_specification";
|
|
3471
|
+
readonly "0Z000": "diagnostics_exception";
|
|
3472
|
+
readonly "0Z002": "stacked_diagnostics_accessed_without_active_handler";
|
|
3473
|
+
readonly "10608": "invalid_argument_for_xquery";
|
|
3474
|
+
readonly "20000": "case_not_found";
|
|
3475
|
+
readonly "21000": "cardinality_violation";
|
|
3476
|
+
readonly "22000": "data_exception";
|
|
3477
|
+
readonly "2202E": "array_subscript_error";
|
|
3478
|
+
readonly "22021": "character_not_in_repertoire";
|
|
3479
|
+
readonly "22008": "datetime_field_overflow";
|
|
3480
|
+
readonly "22012": "division_by_zero";
|
|
3481
|
+
readonly "22005": "error_in_assignment";
|
|
3482
|
+
readonly "2200B": "escape_character_conflict";
|
|
3483
|
+
readonly "22022": "indicator_overflow";
|
|
3484
|
+
readonly "22015": "interval_field_overflow";
|
|
3485
|
+
readonly "2201E": "invalid_argument_for_logarithm";
|
|
3486
|
+
readonly "22014": "invalid_argument_for_ntile_function";
|
|
3487
|
+
readonly "22016": "invalid_argument_for_nth_value_function";
|
|
3488
|
+
readonly "2201F": "invalid_argument_for_power_function";
|
|
3489
|
+
readonly "2201G": "invalid_argument_for_width_bucket_function";
|
|
3490
|
+
readonly "22018": "invalid_character_value_for_cast";
|
|
3491
|
+
readonly "22007": "invalid_datetime_format";
|
|
3492
|
+
readonly "22019": "invalid_escape_character";
|
|
3493
|
+
readonly "2200D": "invalid_escape_octet";
|
|
3494
|
+
readonly "22025": "invalid_escape_sequence";
|
|
3495
|
+
readonly "22P06": "nonstandard_use_of_escape_character";
|
|
3496
|
+
readonly "22010": "invalid_indicator_parameter_value";
|
|
3497
|
+
readonly "22023": "invalid_parameter_value";
|
|
3498
|
+
readonly "22013": "invalid_preceding_or_following_size";
|
|
3499
|
+
readonly "2201B": "invalid_regular_expression";
|
|
3500
|
+
readonly "2201W": "invalid_row_count_in_limit_clause";
|
|
3501
|
+
readonly "2201X": "invalid_row_count_in_result_offset_clause";
|
|
3502
|
+
readonly "2202H": "invalid_tablesample_argument";
|
|
3503
|
+
readonly "2202G": "invalid_tablesample_repeat";
|
|
3504
|
+
readonly "22009": "invalid_time_zone_displacement_value";
|
|
3505
|
+
readonly "2200C": "invalid_use_of_escape_character";
|
|
3506
|
+
readonly "2200G": "most_specific_type_mismatch";
|
|
3507
|
+
readonly "22004": "null_value_not_allowed";
|
|
3508
|
+
readonly "22002": "null_value_no_indicator_parameter";
|
|
3509
|
+
readonly "22003": "numeric_value_out_of_range";
|
|
3510
|
+
readonly "2200H": "sequence_generator_limit_exceeded";
|
|
3511
|
+
readonly "22026": "string_data_length_mismatch";
|
|
3512
|
+
readonly "22001": "string_data_right_truncation";
|
|
3513
|
+
readonly "22011": "substring_error";
|
|
3514
|
+
readonly "22027": "trim_error";
|
|
3515
|
+
readonly "22024": "unterminated_c_string";
|
|
3516
|
+
readonly "2200F": "zero_length_character_string";
|
|
3517
|
+
readonly "22P01": "floating_point_exception";
|
|
3518
|
+
readonly "22P02": "invalid_text_representation";
|
|
3519
|
+
readonly "22P03": "invalid_binary_representation";
|
|
3520
|
+
readonly "22P04": "bad_copy_file_format";
|
|
3521
|
+
readonly "22P05": "untranslatable_character";
|
|
3522
|
+
readonly "2200L": "not_an_xml_document";
|
|
3523
|
+
readonly "2200M": "invalid_xml_document";
|
|
3524
|
+
readonly "2200N": "invalid_xml_content";
|
|
3525
|
+
readonly "2200S": "invalid_xml_comment";
|
|
3526
|
+
readonly "2200T": "invalid_xml_processing_instruction";
|
|
3527
|
+
readonly "22030": "duplicate_json_object_key_value";
|
|
3528
|
+
readonly "22031": "invalid_argument_for_sql_json_datetime_function";
|
|
3529
|
+
readonly "22032": "invalid_json_text";
|
|
3530
|
+
readonly "22033": "invalid_sql_json_subscript";
|
|
3531
|
+
readonly "22034": "more_than_one_sql_json_item";
|
|
3532
|
+
readonly "22035": "no_sql_json_item";
|
|
3533
|
+
readonly "22036": "non_numeric_sql_json_item";
|
|
3534
|
+
readonly "22037": "non_unique_keys_in_a_json_object";
|
|
3535
|
+
readonly "22038": "singleton_sql_json_item_required";
|
|
3536
|
+
readonly "22039": "sql_json_array_not_found";
|
|
3537
|
+
readonly "2203A": "sql_json_member_not_found";
|
|
3538
|
+
readonly "2203B": "sql_json_number_not_found";
|
|
3539
|
+
readonly "2203C": "sql_json_object_not_found";
|
|
3540
|
+
readonly "2203D": "too_many_json_array_elements";
|
|
3541
|
+
readonly "2203E": "too_many_json_object_members";
|
|
3542
|
+
readonly "2203F": "sql_json_scalar_required";
|
|
3543
|
+
readonly "2203G": "sql_json_item_cannot_be_cast_to_target_type";
|
|
3544
|
+
readonly "23000": "integrity_constraint_violation";
|
|
3545
|
+
readonly "23001": "restrict_violation";
|
|
3546
|
+
readonly "23502": "not_null_violation";
|
|
3547
|
+
readonly "23503": "foreign_key_violation";
|
|
3548
|
+
readonly "23505": "unique_violation";
|
|
3549
|
+
readonly "23514": "check_violation";
|
|
3550
|
+
readonly "23P01": "exclusion_violation";
|
|
3551
|
+
readonly "24000": "invalid_cursor_state";
|
|
3552
|
+
readonly "25000": "invalid_transaction_state";
|
|
3553
|
+
readonly "25001": "active_sql_transaction";
|
|
3554
|
+
readonly "25002": "branch_transaction_already_active";
|
|
3555
|
+
readonly "25008": "held_cursor_requires_same_isolation_level";
|
|
3556
|
+
readonly "25003": "inappropriate_access_mode_for_branch_transaction";
|
|
3557
|
+
readonly "25004": "inappropriate_isolation_level_for_branch_transaction";
|
|
3558
|
+
readonly "25005": "no_active_sql_transaction_for_branch_transaction";
|
|
3559
|
+
readonly "25006": "read_only_sql_transaction";
|
|
3560
|
+
readonly "25007": "schema_and_data_statement_mixing_not_supported";
|
|
3561
|
+
readonly "25P01": "no_active_sql_transaction";
|
|
3562
|
+
readonly "25P02": "in_failed_sql_transaction";
|
|
3563
|
+
readonly "25P03": "idle_in_transaction_session_timeout";
|
|
3564
|
+
readonly "25P04": "transaction_timeout";
|
|
3565
|
+
readonly "26000": "invalid_sql_statement_name";
|
|
3566
|
+
readonly "27000": "triggered_data_change_violation";
|
|
3567
|
+
readonly "28000": "invalid_authorization_specification";
|
|
3568
|
+
readonly "28P01": "invalid_password";
|
|
3569
|
+
readonly "2B000": "dependent_privilege_descriptors_still_exist";
|
|
3570
|
+
readonly "2BP01": "dependent_objects_still_exist";
|
|
3571
|
+
readonly "2D000": "invalid_transaction_termination";
|
|
3572
|
+
readonly "2F000": "sql_routine_exception";
|
|
3573
|
+
readonly "2F005": "function_executed_no_return_statement";
|
|
3574
|
+
readonly "2F002": "modifying_sql_data_not_permitted";
|
|
3575
|
+
readonly "2F003": "prohibited_sql_statement_attempted";
|
|
3576
|
+
readonly "2F004": "reading_sql_data_not_permitted";
|
|
3577
|
+
readonly "34000": "invalid_cursor_name";
|
|
3578
|
+
readonly "38000": "external_routine_exception";
|
|
3579
|
+
readonly "38001": "containing_sql_not_permitted";
|
|
3580
|
+
readonly "38002": "modifying_sql_data_not_permitted";
|
|
3581
|
+
readonly "38003": "prohibited_sql_statement_attempted";
|
|
3582
|
+
readonly "38004": "reading_sql_data_not_permitted";
|
|
3583
|
+
readonly "39000": "external_routine_invocation_exception";
|
|
3584
|
+
readonly "39001": "invalid_sqlstate_returned";
|
|
3585
|
+
readonly "39004": "null_value_not_allowed";
|
|
3586
|
+
readonly "39P01": "trigger_protocol_violated";
|
|
3587
|
+
readonly "39P02": "srf_protocol_violated";
|
|
3588
|
+
readonly "39P03": "event_trigger_protocol_violated";
|
|
3589
|
+
readonly "3B000": "savepoint_exception";
|
|
3590
|
+
readonly "3B001": "invalid_savepoint_specification";
|
|
3591
|
+
readonly "3D000": "invalid_catalog_name";
|
|
3592
|
+
readonly "3F000": "invalid_schema_name";
|
|
3593
|
+
readonly "40000": "transaction_rollback";
|
|
3594
|
+
readonly "40002": "transaction_integrity_constraint_violation";
|
|
3595
|
+
readonly "40001": "serialization_failure";
|
|
3596
|
+
readonly "40003": "statement_completion_unknown";
|
|
3597
|
+
readonly "40P01": "deadlock_detected";
|
|
3598
|
+
readonly "42000": "syntax_error_or_access_rule_violation";
|
|
3599
|
+
readonly "42601": "syntax_error";
|
|
3600
|
+
readonly "42501": "insufficient_privilege";
|
|
3601
|
+
readonly "42846": "cannot_coerce";
|
|
3602
|
+
readonly "42803": "grouping_error";
|
|
3603
|
+
readonly "42P20": "windowing_error";
|
|
3604
|
+
readonly "42P19": "invalid_recursion";
|
|
3605
|
+
readonly "42830": "invalid_foreign_key";
|
|
3606
|
+
readonly "42602": "invalid_name";
|
|
3607
|
+
readonly "42622": "name_too_long";
|
|
3608
|
+
readonly "42939": "reserved_name";
|
|
3609
|
+
readonly "42804": "datatype_mismatch";
|
|
3610
|
+
readonly "42P18": "indeterminate_datatype";
|
|
3611
|
+
readonly "42P21": "collation_mismatch";
|
|
3612
|
+
readonly "42P22": "indeterminate_collation";
|
|
3613
|
+
readonly "42809": "wrong_object_type";
|
|
3614
|
+
readonly "428C9": "generated_always";
|
|
3615
|
+
readonly "42703": "undefined_column";
|
|
3616
|
+
readonly "42883": "undefined_function";
|
|
3617
|
+
readonly "42P01": "undefined_table";
|
|
3618
|
+
readonly "42P02": "undefined_parameter";
|
|
3619
|
+
readonly "42704": "undefined_object";
|
|
3620
|
+
readonly "42701": "duplicate_column";
|
|
3621
|
+
readonly "42P03": "duplicate_cursor";
|
|
3622
|
+
readonly "42P04": "duplicate_database";
|
|
3623
|
+
readonly "42723": "duplicate_function";
|
|
3624
|
+
readonly "42P05": "duplicate_prepared_statement";
|
|
3625
|
+
readonly "42P06": "duplicate_schema";
|
|
3626
|
+
readonly "42P07": "duplicate_table";
|
|
3627
|
+
readonly "42712": "duplicate_alias";
|
|
3628
|
+
readonly "42710": "duplicate_object";
|
|
3629
|
+
readonly "42702": "ambiguous_column";
|
|
3630
|
+
readonly "42725": "ambiguous_function";
|
|
3631
|
+
readonly "42P08": "ambiguous_parameter";
|
|
3632
|
+
readonly "42P09": "ambiguous_alias";
|
|
3633
|
+
readonly "42P10": "invalid_column_reference";
|
|
3634
|
+
readonly "42611": "invalid_column_definition";
|
|
3635
|
+
readonly "42P11": "invalid_cursor_definition";
|
|
3636
|
+
readonly "42P12": "invalid_database_definition";
|
|
3637
|
+
readonly "42P13": "invalid_function_definition";
|
|
3638
|
+
readonly "42P14": "invalid_prepared_statement_definition";
|
|
3639
|
+
readonly "42P15": "invalid_schema_definition";
|
|
3640
|
+
readonly "42P16": "invalid_table_definition";
|
|
3641
|
+
readonly "42P17": "invalid_object_definition";
|
|
3642
|
+
readonly "44000": "with_check_option_violation";
|
|
3643
|
+
readonly "53000": "insufficient_resources";
|
|
3644
|
+
readonly "53100": "disk_full";
|
|
3645
|
+
readonly "53200": "out_of_memory";
|
|
3646
|
+
readonly "53300": "too_many_connections";
|
|
3647
|
+
readonly "53400": "configuration_limit_exceeded";
|
|
3648
|
+
readonly "54000": "program_limit_exceeded";
|
|
3649
|
+
readonly "54001": "statement_too_complex";
|
|
3650
|
+
readonly "54011": "too_many_columns";
|
|
3651
|
+
readonly "54023": "too_many_arguments";
|
|
3652
|
+
readonly "55000": "object_not_in_prerequisite_state";
|
|
3653
|
+
readonly "55006": "object_in_use";
|
|
3654
|
+
readonly "55P02": "cant_change_runtime_param";
|
|
3655
|
+
readonly "55P03": "lock_not_available";
|
|
3656
|
+
readonly "55P04": "unsafe_new_enum_value_usage";
|
|
3657
|
+
readonly "57000": "operator_intervention";
|
|
3658
|
+
readonly "57014": "query_canceled";
|
|
3659
|
+
readonly "57P01": "admin_shutdown";
|
|
3660
|
+
readonly "57P02": "crash_shutdown";
|
|
3661
|
+
readonly "57P03": "cannot_connect_now";
|
|
3662
|
+
readonly "57P04": "database_dropped";
|
|
3663
|
+
readonly "57P05": "idle_session_timeout";
|
|
3664
|
+
readonly "58000": "system_error";
|
|
3665
|
+
readonly "58030": "io_error";
|
|
3666
|
+
readonly "58P01": "undefined_file";
|
|
3667
|
+
readonly "58P02": "duplicate_file";
|
|
3668
|
+
readonly "58P03": "file_name_too_long";
|
|
3669
|
+
readonly F0000: "config_file_error";
|
|
3670
|
+
readonly F0001: "lock_file_exists";
|
|
3671
|
+
readonly HV000: "fdw_error";
|
|
3672
|
+
readonly HV005: "fdw_column_name_not_found";
|
|
3673
|
+
readonly HV002: "fdw_dynamic_parameter_value_needed";
|
|
3674
|
+
readonly HV010: "fdw_function_sequence_error";
|
|
3675
|
+
readonly HV021: "fdw_inconsistent_descriptor_information";
|
|
3676
|
+
readonly HV024: "fdw_invalid_attribute_value";
|
|
3677
|
+
readonly HV007: "fdw_invalid_column_name";
|
|
3678
|
+
readonly HV008: "fdw_invalid_column_number";
|
|
3679
|
+
readonly HV004: "fdw_invalid_data_type";
|
|
3680
|
+
readonly HV006: "fdw_invalid_data_type_descriptors";
|
|
3681
|
+
readonly HV091: "fdw_invalid_descriptor_field_identifier";
|
|
3682
|
+
readonly HV00B: "fdw_invalid_handle";
|
|
3683
|
+
readonly HV00C: "fdw_invalid_option_index";
|
|
3684
|
+
readonly HV00D: "fdw_invalid_option_name";
|
|
3685
|
+
readonly HV090: "fdw_invalid_string_length_or_buffer_length";
|
|
3686
|
+
readonly HV00A: "fdw_invalid_string_format";
|
|
3687
|
+
readonly HV009: "fdw_invalid_use_of_null_pointer";
|
|
3688
|
+
readonly HV014: "fdw_too_many_handles";
|
|
3689
|
+
readonly HV001: "fdw_out_of_memory";
|
|
3690
|
+
readonly HV00P: "fdw_no_schemas";
|
|
3691
|
+
readonly HV00J: "fdw_option_name_not_found";
|
|
3692
|
+
readonly HV00K: "fdw_reply_handle";
|
|
3693
|
+
readonly HV00Q: "fdw_schema_not_found";
|
|
3694
|
+
readonly HV00R: "fdw_table_not_found";
|
|
3695
|
+
readonly HV00L: "fdw_unable_to_create_execution";
|
|
3696
|
+
readonly HV00M: "fdw_unable_to_create_reply";
|
|
3697
|
+
readonly HV00N: "fdw_unable_to_establish_connection";
|
|
3698
|
+
readonly P0000: "plpgsql_error";
|
|
3699
|
+
readonly P0001: "raise_exception";
|
|
3700
|
+
readonly P0002: "no_data_found";
|
|
3701
|
+
readonly P0003: "too_many_rows";
|
|
3702
|
+
readonly P0004: "assert_failure";
|
|
3703
|
+
readonly XX000: "internal_error";
|
|
3704
|
+
readonly XX001: "data_corrupted";
|
|
3705
|
+
readonly XX002: "index_corrupted";
|
|
3706
|
+
};
|
|
3707
|
+
type ConditionsByCode = typeof conditionsByCode;
|
|
3708
|
+
/** Name of a condition of PostgreSQL errors, such as `unique_violation`, or of a class of them, such as `integrity_constraint_violation`. */
|
|
3709
|
+
type QueryErrorCondition = ConditionsByCode[keyof ConditionsByCode];
|
|
3710
|
+
/**
|
|
3711
|
+
* SQLSTATE codes of each condition, with every code of its class for the condition of a class.
|
|
3712
|
+
*
|
|
3713
|
+
* TypeScript computes the map once, whereas a mapped type of the table for each condition would cost a check of another condition about 70 times as many instantiations.
|
|
3714
|
+
*/
|
|
3715
|
+
type CodesByCondition = { [K in keyof ConditionsByCode as ConditionsByCode[K]]: K extends `${infer Class}000` ? `${Class}${string}` : K; };
|
|
3716
|
+
/** SQLSTATE codes of the condition `C`, with every code of its class for the condition of a class. */
|
|
3717
|
+
type QueryErrorCode<C extends QueryErrorCondition> = CodesByCondition[C];
|
|
3718
|
+
/**
|
|
3719
|
+
* Tells whether `error` is a `QueryError` of `condition`, including a `QueryError` of another copy of kern-orm.
|
|
3720
|
+
*
|
|
3721
|
+
* The condition of a class, such as `integrity_constraint_violation`, matches every error of its class, as in PL/pgSQL.
|
|
3722
|
+
*/
|
|
3723
|
+
declare function isQueryError<C extends QueryErrorCondition>(error: unknown, condition: C): error is QueryError & {
|
|
3724
|
+
readonly code: QueryErrorCode<C>;
|
|
3725
|
+
};
|
|
3393
3726
|
/**
|
|
3394
3727
|
* Defines a reusable expression of a table, which the callbacks of queries over the table call with their columns and any further arguments, such as to filter by it and select it in one query.
|
|
3395
3728
|
*
|
|
@@ -3473,4 +3806,4 @@ declare function param<E extends AnyExpression, V extends (E extends AnyExpressi
|
|
|
3473
3806
|
* A run of capital letters is one word, such as `user_id` for `userID`, and digits stay in their word, such as `line2`.
|
|
3474
3807
|
*/
|
|
3475
3808
|
declare function toSnakeCase(key: string): string;
|
|
3476
|
-
export {
|
|
3809
|
+
export { TestHooks as $, TypeOptions as $i, Ordering as $n, EqualityOperators as $r, MutationQueryState as $t, AnyExpression as A, Table as Ai, literal as An, PrimaryKeyValues as Ar, SchemaTables as At, DbOf as B, ResultMode as Bi, count as Bn, and as Br, DecodedFields as Bt, TextConversionSignature as C, AnyTableKeys as Ci, NestedQuery as Cn, SelectedOperandType as Cr, UsedRelation as Ct, textOperators as D, ColumnValues as Di, SelectionResult as Dn, KeyCheck as Dr, Schema as Dt, TextTypeOperators as E, ColumnShape as Ei, SelectionFieldTypes as En, GroupTerms as Er, AnySchema as Et, UntypedExpression as F, createTableFactory as Fi, GroupValue as Fn, WhereValues as Fr, RecordQueryState as Ft, TransactionOptions as G, SqlStatement as Gi, some as Gn, OneRow as Gr, AnyMutationQuery as Gt, Database as H, Connection as Hi, every as Hn, or as Hr, InitialSqlQueryState as Ht, AnyDb as I, defineTable as Ii, StringAggOptions as In, CombinedCondition as Ir, SelectionState as It, OpenedTestFixture as J, BaseType as Ji, OrderColumns as Jn, ResultByRows as Jr, ConflictTarget as Jt, createDatabase as K, createStatement as Ki, stringAgg as Kn, OneValueRows as Kr, ConflictActionRequired as Kt, BindOptions as L, NotFoundError as Li, UnfilteredAggregateOptions as Ln, Condition as Lr, AnyQuery as Lt, Expression as M, TableKeys as Mi, AggregateOptions as Mn, WhereCallback as Mr, defineSchema as Mt, ExpressionOperators as N, TableOptions as Ni, CountExpression as Nn, WhereCondition as Nr, AnyRecordQuery as Nt, NumberTypeOperators as O, KeyColumns as Oi, SelectionUses as On, NotAKey as Or, SchemaPart as Ot, TypedExpression as P, ToColumns as Pi, GroupAggregateExpression as Pn, WhereFilter as Pr, RecordQuery as Pt, TestHelpers as Q, TypeOperators as Qi, OrderTerms as Qn, EqualityOperator as Qr, MutationQuery as Qt, Db as R, RequiredRelationError as Ri, UnfilteredStringAggOptions as Rn, ConditionOperand as Rr, SelectQueryKind as Rt, PatternSignature as S, AnyTable as Si, MergeSelection as Sn, GroupedState as Sr, UsableRelation as St, TextOperators as T, ColumnOperators as Ti, Selection as Tn, GroupTerm as Tr, one as Tt, DatabaseOptions as U, Driver as Ui, max as Un, ExistsValueType as Ur, SqlQuery as Ut, DbQueryState as V, ResultRows as Vi, countDistinct as Vn, not as Vr, FieldTypes as Vt, IsolationLevel as W, DriverResult as Wi, min as Wn, FilteredRows as Wr, SqlQueryState as Wt, TestFixture as X, Type as Xi, OrderKey as Xn, CountValueType as Xr, InitialMutationState as Xt, PendingTestFixture as Y, TextValue as Yi, OrderDirection as Yn, ValueRows as Yr, InitialInsertState as Yt, TestFixtureOptions as Z, TypeInput as Zi, OrderTerm as Zn, CompileOptions as Zr, InsertMutationState as Zt, DriverErrorFields as _, QueryStateOf as _i, ExpressionValue as _n, UpdateValues as _r, RequiredMember as _t, sql as a, ColumnAttributes as aa, Operand as ai, CaseValue as an, QueryContext as ar, TransformedQuery as at, FALSE as b, SingletonQueryState as bi, GroupedField as bn, FoundQueryState as br, TableContext as bt, MatchResult as c, BoundOperators as ca, OperandUses as ci, TypedOperand as cn, BoundSelectQuery as cr, MergeRelations as ct, defineExpression as d, OperatorDefinitions as da, ValuesQuery as di, caseWhen as dn, SingletonInsertMany as dr, Relation as dt, TypeOutput as ea, HasEquality as ei, Helper as en, SelectedRefs as er, TestTransactionOptions as et, QueryErrorCode as f, GenericOperator as fa, EmptyRecord as fi, coalesce as fn, from as fr, RelationDeclaration as ft, ConnectionError as g, QueryState as gi, ExpressionInput as gn, UpdateSet as gr, RelationKind as gt, TransactionConnectionError as h, defineGenericOperator as ha, InitialQueryState as hi, ColumnFieldTypes as hn, InsertValues as hr, RelationKeys as ht, param as i, Column as ia, ComparisonSignature as ii, CaseCondition as in, ColumnRefs as ir, SynchronousResult as it, BaseOperators as j, TableFactoryOptions as ji, AggregateExpression as jn, EqValue as jr, Tables as jt, orderingOperators as k, Selectable as ki, Literal as kn, PrimaryKeyColumn as kr, SchemaPartRelations as kt, NotAColumn as l, MergeOperators as la, ScalarQuery as li, TypedOperandInput as ln, ResultOf as lr, NoRelations as lt, isQueryError as m, OperatorSignature as ma, Grouped as mi, least as mn, ConflictUpdateSet as mr, RelationKey as mt, SqlTemplate as n, defineType as na, equalityOperators as ni, defineHelper as nn, desc as nr, AnyTransformedQuery as nt, ColumnRefKey as o, KeyKind as oa, OperandValue as oi, FollowingOperand as on, RelationRefs as or, TransformedQueryState as ot, QueryErrorCondition as p, GenericOperatorImplementation as pa, FoundKey as pi, greatest as pn, ColumnValue as pr, RelationDeclarations as pt, TransactionCoordinator as q, AnyType as qi, sum as qn, QueryResult as qr, ConflictKeyRequired as qt, identifier as r, AnyColumn as ra, BooleanResult as ri, CaseBranch as rn, orderBy as rr, NotSynchronous as rt, MatchCheck as s, ToColumn as sa, compare as si, NullSkippingResult as sn, AnySelectQuery as sr, DeclaredRelations as st, toSnakeCase as t, TypeTransform as ta, InSignature as ti, HelperEffect as tn, asc as tr, createTestHelpers as tt, matches as u, NoOperators as ua, TypedScalarQuery as ui, TypedOperandOperators as un, SelectQuery as ur, OneRelationKeys as ut, QueryError as v, QueryValueType as vi, GroupOperandValue as vn, UpsertValues as vr, SchemaContext as vt, TextLengthSignature as w, ColumnDefinitions as wi, SelectedFieldTypes as wn, RowLockOptions as wr, many as wt, TRUE as x, TableQueryState as xi, GroupedRecord as xn, FoundState as xr, TableRelations as xt, toDriverError as y, SelectQueryState as yi, GroupSelectionResult as yn, FilteredStateRows as yr, SchemaRelations as yt, DbMutationState as z, ResultDecodeError as zi, avg as zn, Predicate as zr, AnySqlQuery as zt };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
export { type AggregateExpression, type AggregateOptions, type AnyColumn, type AnyDb, type AnyExpression, type AnyMutationQuery, type AnyQuery, type AnyRecordQuery, type AnySchema, type AnySelectQuery, type AnySqlQuery, type AnyTable, type AnyTableKeys, type AnyTransformedQuery, type AnyType, type BaseOperators, type BaseType, type BindOptions, type BooleanResult, type BoundOperators, type BoundSelectQuery, type CaseBranch, type CaseCondition, type CaseValue, type Column, type ColumnAttributes, type ColumnDefinitions, type ColumnFieldTypes, type ColumnOperators, type ColumnRefKey, type ColumnRefs, type ColumnShape, type ColumnValue, type ColumnValues, type CombinedCondition, type ComparisonSignature, type CompileOptions, type Condition, type ConditionOperand, type ConflictActionRequired, type ConflictKeyRequired, type ConflictTarget, type ConflictUpdateSet, type Connection, ConnectionError, type CountExpression, type CountValueType, type Database, type DatabaseOptions, type Db, type DbMutationState, type DbOf, type DbQueryState, type DeclaredRelations, type DecodedFields, type Driver, type DriverErrorFields, type DriverResult, type EmptyRecord, type EqValue, type EqualityOperator, type EqualityOperators, type ExistsValueType, type Expression, type ExpressionInput, type ExpressionOperators, type ExpressionValue, FALSE, type FieldTypes, type FilteredRows, type FilteredStateRows, type FollowingOperand, type FoundKey, type FoundQueryState, type FoundState, type GenericOperator, type GenericOperatorImplementation, type GroupAggregateExpression, type GroupOperandValue, type GroupSelectionResult, type GroupTerm, type GroupTerms, type GroupValue, type Grouped, type GroupedField, type GroupedRecord, type GroupedState, type HasEquality, type Helper, type HelperEffect, type InSignature, type InitialInsertState, type InitialMutationState, type InitialQueryState, type InitialSqlQueryState, type InsertMutationState, type InsertValues, type KeyCheck, type KeyColumns, type KeyKind, type Literal, type MatchCheck, type MatchResult, type MergeOperators, type MergeRelations, type MergeSelection, type MutationQuery, type MutationQueryState, type NestedQuery, type NoOperators, type NoRelations, type NotAColumn, type NotAKey, NotFoundError, type NotSynchronous, type NullSkippingResult, type NumberTypeOperators, type OneRelationKeys, type OneRow, type OneValueRows, type Operand, type OperandUses, type OperandValue, type OperatorDefinitions, type OperatorSignature, type OrderColumns, type OrderDirection, type OrderKey, type OrderTerm, type OrderTerms, type Ordering, type PatternSignature, type Predicate, type PrimaryKeyColumn, type PrimaryKeyValues, type QueryContext, QueryError, type QueryResult, type QueryState, type QueryStateOf, type QueryValueType, type RecordQuery, type RecordQueryState, type Relation, type RelationDeclaration, type RelationDeclarations, type RelationKey, type RelationKeys, type RelationKind, type RelationRefs, type RequiredMember, RequiredRelationError, type ResultByRows, ResultDecodeError, type ResultMode, type ResultOf, type ResultRows, type RowLockOptions, type ScalarQuery, type Schema, type SchemaContext, type SchemaPart, type SchemaPartRelations, type SchemaRelations, type SchemaTables, type SelectQuery, type SelectQueryKind, type SelectQueryState, type Selectable, type SelectedFieldTypes, type SelectedOperandType, type SelectedRefs, type Selection, type SelectionFieldTypes, type SelectionResult, type SelectionState, type SelectionUses, type SingletonInsertMany, type SingletonQueryState, type SqlQuery, type SqlQueryState, type SqlStatement, type SqlTemplate, type StringAggOptions, type SynchronousResult, TRUE, type Table, type TableContext, type TableFactoryOptions, type TableKeys, type TableOptions, type TableQueryState, type TableRelations, type Tables, type TextConversionSignature, type TextLengthSignature, type TextOperators, type TextTypeOperators, type TextValue, type ToColumn, type ToColumns,
|
|
1
|
+
import { $i as TypeOptions, $n as Ordering, $r as EqualityOperators, $t as MutationQueryState, A as AnyExpression, Ai as Table, An as literal, Ar as PrimaryKeyValues, At as SchemaTables, B as DbOf, Bi as ResultMode, Bn as count, Br as and, Bt as DecodedFields, C as TextConversionSignature, Ci as AnyTableKeys, Cn as NestedQuery, Cr as SelectedOperandType, Ct as UsedRelation, D as textOperators, Di as ColumnValues, Dn as SelectionResult, Dr as KeyCheck, Dt as Schema, E as TextTypeOperators, Ei as ColumnShape, En as SelectionFieldTypes, Er as GroupTerms, Et as AnySchema, F as UntypedExpression, Fi as createTableFactory, Fn as GroupValue, Fr as WhereValues, Ft as RecordQueryState, G as TransactionOptions, Gi as SqlStatement, Gn as some, Gr as OneRow, Gt as AnyMutationQuery, H as Database, Hi as Connection, Hn as every, Hr as or, Ht as InitialSqlQueryState, I as AnyDb, Ii as defineTable, In as StringAggOptions, Ir as CombinedCondition, It as SelectionState, Ji as BaseType, Jn as OrderColumns, Jr as ResultByRows, Jt as ConflictTarget, K as createDatabase, Ki as createStatement, Kn as stringAgg, Kr as OneValueRows, Kt as ConflictActionRequired, L as BindOptions, Li as NotFoundError, Ln as UnfilteredAggregateOptions, Lr as Condition, Lt as AnyQuery, M as Expression, Mi as TableKeys, Mn as AggregateOptions, Mr as WhereCallback, Mt as defineSchema, N as ExpressionOperators, Ni as TableOptions, Nn as CountExpression, Nr as WhereCondition, Nt as AnyRecordQuery, O as NumberTypeOperators, Oi as KeyColumns, On as SelectionUses, Or as NotAKey, Ot as SchemaPart, P as TypedExpression, Pi as ToColumns, Pn as GroupAggregateExpression, Pr as WhereFilter, Pt as RecordQuery, Qi as TypeOperators, Qn as OrderTerms, Qr as EqualityOperator, Qt as MutationQuery, R as Db, Ri as RequiredRelationError, Rn as UnfilteredStringAggOptions, Rr as ConditionOperand, Rt as SelectQueryKind, S as PatternSignature, Si as AnyTable, Sn as MergeSelection, Sr as GroupedState, St as UsableRelation, T as TextOperators, Ti as ColumnOperators, Tn as Selection, Tr as GroupTerm, Tt as one, U as DatabaseOptions, Ui as Driver, Un as max, Ur as ExistsValueType, Ut as SqlQuery, V as DbQueryState, Vi as ResultRows, Vn as countDistinct, Vr as not, Vt as FieldTypes, W as IsolationLevel, Wi as DriverResult, Wn as min, Wr as FilteredRows, Wt as SqlQueryState, Xi as Type, Xn as OrderKey, Xr as CountValueType, Xt as InitialMutationState, Yi as TextValue, Yn as OrderDirection, Yr as ValueRows, Yt as InitialInsertState, Zi as TypeInput, Zn as OrderTerm, Zr as CompileOptions, Zt as InsertMutationState, _ as DriverErrorFields, _i as QueryStateOf, _n as ExpressionValue, _r as UpdateValues, _t as RequiredMember, a as sql, aa as ColumnAttributes, ai as Operand, an as CaseValue, ar as QueryContext, at as TransformedQuery, b as FALSE, bi as SingletonQueryState, bn as GroupedField, br as FoundQueryState, bt as TableContext, c as MatchResult, ca as BoundOperators, ci as OperandUses, cn as TypedOperand, cr as BoundSelectQuery, ct as MergeRelations, d as defineExpression, da as OperatorDefinitions, di as ValuesQuery, dn as caseWhen, dr as SingletonInsertMany, dt as Relation, ea as TypeOutput, ei as HasEquality, en as Helper, er as SelectedRefs, f as QueryErrorCode, fa as GenericOperator, fi as EmptyRecord, fn as coalesce, fr as from, ft as RelationDeclaration, g as ConnectionError, gi as QueryState, gn as ExpressionInput, gr as UpdateSet, gt as RelationKind, h as TransactionConnectionError, ha as defineGenericOperator, hi as InitialQueryState, hn as ColumnFieldTypes, hr as InsertValues, ht as RelationKeys, i as param, ia as Column, ii as ComparisonSignature, in as CaseCondition, ir as ColumnRefs, it as SynchronousResult, j as BaseOperators, ji as TableFactoryOptions, jn as AggregateExpression, jr as EqValue, jt as Tables, k as orderingOperators, ki as Selectable, kn as Literal, kr as PrimaryKeyColumn, kt as SchemaPartRelations, l as NotAColumn, la as MergeOperators, li as ScalarQuery, ln as TypedOperandInput, lr as ResultOf, lt as NoRelations, m as isQueryError, ma as OperatorSignature, mi as Grouped, mn as least, mr as ConflictUpdateSet, mt as RelationKey, n as SqlTemplate, na as defineType, ni as equalityOperators, nn as defineHelper, nr as desc, nt as AnyTransformedQuery, o as ColumnRefKey, oa as KeyKind, oi as OperandValue, on as FollowingOperand, or as RelationRefs, ot as TransformedQueryState, p as QueryErrorCondition, pa as GenericOperatorImplementation, pi as FoundKey, pn as greatest, pr as ColumnValue, pt as RelationDeclarations, q as TransactionCoordinator, qi as AnyType, qn as sum, qr as QueryResult, qt as ConflictKeyRequired, r as identifier, ra as AnyColumn, ri as BooleanResult, rn as CaseBranch, rr as orderBy, rt as NotSynchronous, s as MatchCheck, sa as ToColumn, si as compare, sn as NullSkippingResult, sr as AnySelectQuery, st as DeclaredRelations, t as toSnakeCase, ta as TypeTransform, ti as InSignature, tn as HelperEffect, tr as asc, u as matches, ua as NoOperators, ui as TypedScalarQuery, un as TypedOperandOperators, ur as SelectQuery, ut as OneRelationKeys, v as QueryError, vi as QueryValueType, vn as GroupOperandValue, vr as UpsertValues, vt as SchemaContext, w as TextLengthSignature, wi as ColumnDefinitions, wn as SelectedFieldTypes, wr as RowLockOptions, wt as many, x as TRUE, xi as TableQueryState, xn as GroupedRecord, xr as FoundState, xt as TableRelations, y as toDriverError, yi as SelectQueryState, yn as GroupSelectionResult, yr as FilteredStateRows, yt as SchemaRelations, z as DbMutationState, zi as ResultDecodeError, zn as avg, zr as Predicate, zt as AnySqlQuery } from "./index-2z5iTzXf.mjs";
|
|
2
|
+
export { type AggregateExpression, type AggregateOptions, type AnyColumn, type AnyDb, type AnyExpression, type AnyMutationQuery, type AnyQuery, type AnyRecordQuery, type AnySchema, type AnySelectQuery, type AnySqlQuery, type AnyTable, type AnyTableKeys, type AnyTransformedQuery, type AnyType, type BaseOperators, type BaseType, type BindOptions, type BooleanResult, type BoundOperators, type BoundSelectQuery, type CaseBranch, type CaseCondition, type CaseValue, type Column, type ColumnAttributes, type ColumnDefinitions, type ColumnFieldTypes, type ColumnOperators, type ColumnRefKey, type ColumnRefs, type ColumnShape, type ColumnValue, type ColumnValues, type CombinedCondition, type ComparisonSignature, type CompileOptions, type Condition, type ConditionOperand, type ConflictActionRequired, type ConflictKeyRequired, type ConflictTarget, type ConflictUpdateSet, type Connection, ConnectionError, type CountExpression, type CountValueType, type Database, type DatabaseOptions, type Db, type DbMutationState, type DbOf, type DbQueryState, type DeclaredRelations, type DecodedFields, type Driver, type DriverErrorFields, type DriverResult, type EmptyRecord, type EqValue, type EqualityOperator, type EqualityOperators, type ExistsValueType, type Expression, type ExpressionInput, type ExpressionOperators, type ExpressionValue, FALSE, type FieldTypes, type FilteredRows, type FilteredStateRows, type FollowingOperand, type FoundKey, type FoundQueryState, type FoundState, type GenericOperator, type GenericOperatorImplementation, type GroupAggregateExpression, type GroupOperandValue, type GroupSelectionResult, type GroupTerm, type GroupTerms, type GroupValue, type Grouped, type GroupedField, type GroupedRecord, type GroupedState, type HasEquality, type Helper, type HelperEffect, type InSignature, type InitialInsertState, type InitialMutationState, type InitialQueryState, type InitialSqlQueryState, type InsertMutationState, type InsertValues, type IsolationLevel, type KeyCheck, type KeyColumns, type KeyKind, type Literal, type MatchCheck, type MatchResult, type MergeOperators, type MergeRelations, type MergeSelection, type MutationQuery, type MutationQueryState, type NestedQuery, type NoOperators, type NoRelations, type NotAColumn, type NotAKey, NotFoundError, type NotSynchronous, type NullSkippingResult, type NumberTypeOperators, type OneRelationKeys, type OneRow, type OneValueRows, type Operand, type OperandUses, type OperandValue, type OperatorDefinitions, type OperatorSignature, type OrderColumns, type OrderDirection, type OrderKey, type OrderTerm, type OrderTerms, type Ordering, type PatternSignature, type Predicate, type PrimaryKeyColumn, type PrimaryKeyValues, type QueryContext, QueryError, type QueryErrorCode, type QueryErrorCondition, type QueryResult, type QueryState, type QueryStateOf, type QueryValueType, type RecordQuery, type RecordQueryState, type Relation, type RelationDeclaration, type RelationDeclarations, type RelationKey, type RelationKeys, type RelationKind, type RelationRefs, type RequiredMember, RequiredRelationError, type ResultByRows, ResultDecodeError, type ResultMode, type ResultOf, type ResultRows, type RowLockOptions, type ScalarQuery, type Schema, type SchemaContext, type SchemaPart, type SchemaPartRelations, type SchemaRelations, type SchemaTables, type SelectQuery, type SelectQueryKind, type SelectQueryState, type Selectable, type SelectedFieldTypes, type SelectedOperandType, type SelectedRefs, type Selection, type SelectionFieldTypes, type SelectionResult, type SelectionState, type SelectionUses, type SingletonInsertMany, type SingletonQueryState, type SqlQuery, type SqlQueryState, type SqlStatement, type SqlTemplate, type StringAggOptions, type SynchronousResult, TRUE, type Table, type TableContext, type TableFactoryOptions, type TableKeys, type TableOptions, type TableQueryState, type TableRelations, type Tables, type TextConversionSignature, type TextLengthSignature, type TextOperators, type TextTypeOperators, type TextValue, type ToColumn, type ToColumns, TransactionConnectionError, type TransactionCoordinator, type TransactionOptions, type TransformedQuery, type TransformedQueryState, type Type, type TypeInput, type TypeOperators, type TypeOptions, type TypeOutput, type TypeTransform, type TypedExpression, type TypedOperand, type TypedOperandInput, type TypedOperandOperators, type TypedScalarQuery, type UnfilteredAggregateOptions, type UnfilteredStringAggOptions, type UntypedExpression, type UpdateSet, type UpdateValues, type UpsertValues, type UsableRelation, type UsedRelation, type ValueRows, type ValuesQuery, type WhereCallback, type WhereCondition, type WhereFilter, type WhereValues, and, asc, avg, caseWhen, coalesce, compare, count, countDistinct, createDatabase, createStatement, createTableFactory, defineExpression, defineGenericOperator, defineHelper, defineSchema, defineTable, defineType, desc, equalityOperators, every, from, greatest, identifier, isQueryError, least, literal, many, matches, max, min, not, one, or, orderBy, orderingOperators, param, some, sql, stringAgg, sum, textOperators, toDriverError, toSnakeCase };
|