kern-orm 0.7.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.
@@ -241,18 +241,29 @@ interface DriverResult {
241
241
  * Physical database access: transport, pooling, and connections.
242
242
  *
243
243
  * A driver sends parameters as text without a declared type, so that the statement text alone determines their types, and returns values as text without parsing them.
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.
244
245
  */
245
246
  interface Driver {
246
- /** Executes a statement on any pooled connection. */
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
+ */
247
252
  execute(statement: SqlStatement): Promise<DriverResult>;
248
- /** 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. */
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
+ */
249
260
  executeScript(text: string): Promise<void>;
250
261
  /** Reserves a dedicated connection, such as for a transaction. */
251
262
  acquire(): Promise<Connection>;
252
263
  /**
253
264
  * Closes the connections once the statements on the pool and the transactions on reserved connections end.
254
265
  *
255
- * From the call, it rejects a new statement or script on the pool and a new connection.
266
+ * From the call, it rejects a new statement or script on the pool and a new connection with `ConnectionError`.
256
267
  */
257
268
  close(): Promise<void>;
258
269
  }
@@ -267,16 +278,12 @@ interface Connection {
267
278
  /** Executes a script of statements without parameters on the connection, in the order of calls with its statements. */
268
279
  executeScript(text: string): Promise<void>;
269
280
  /**
270
- * Returns the connection to the pool after a transaction on it.
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.
271
282
  *
272
- * Without `failure`, the transaction ended with a completed `COMMIT` or `ROLLBACK`, and the connection is idle.
273
- * With `failure`, its `BEGIN`, `COMMIT`, or `ROLLBACK` failed, so the transaction may still be open: the driver returns the connection to the pool only once it is idle, and never returns a connection it lost.
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.
274
285
  */
275
- release(failure?: TransactionFailure): void | Promise<void>;
276
- }
277
- /** Failure of the statement that started or ended a transaction on a connection. */
278
- interface TransactionFailure {
279
- readonly error: unknown;
286
+ release(): void | Promise<void>;
280
287
  }
281
288
  /** Field of a compiled result: the key of a record and how its value is decoded. */
282
289
  type ResultField = ScalarField | NestedField;
@@ -2704,6 +2711,21 @@ interface TestTransactionOptions {
2704
2711
  * Queries that the test has already sent complete before the rollback.
2705
2712
  */
2706
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;
2707
2729
  }
2708
2730
  /** Test transactions and test fixtures of a database created with `test: true`. */
2709
2731
  interface TestHelpers {
@@ -2722,7 +2744,7 @@ interface TestHelpers {
2722
2744
  * Test fixtures nest: a new one opens inside the innermost open one, and test transactions run in the innermost one.
2723
2745
  * A fixture whose `seed` rejects rolls back and closes.
2724
2746
  */
2725
- useTestFixture<T>(seed: () => Promise<T>): TestFixture<T>;
2747
+ useTestFixture<T>(seed: () => Promise<T>, options?: TestFixtureOptions): TestFixture<T>;
2726
2748
  }
2727
2749
  /** Creates the test helpers of a database created with `test: true`, registering fixtures with the hooks of a test runner. */
2728
2750
  declare function createTestHelpers(database: Database, hooks: TestHooks): TestHelpers;
@@ -2736,17 +2758,16 @@ declare class TransactionCoordinator {
2736
2758
  readonly driver: Driver;
2737
2759
  /** Rejects statements and transactions outside a test transaction or the seed of a test fixture instead of running them on the pool. */
2738
2760
  readonly test: boolean;
2739
- constructor(driver: Driver,
2740
- /** Rejects statements and transactions outside a test transaction or the seed of a test fixture instead of running them on the pool. */
2741
- test?: boolean);
2761
+ constructor(driver: Driver, { test, onReleaseError }?: Omit<DatabaseOptions, "driver">);
2742
2762
  execute(statement: SqlStatement): Promise<DriverResult>;
2743
2763
  /** Executes a script of statements without parameters where `execute` executes a statement. */
2744
2764
  executeScript(text: string): Promise<void>;
2745
2765
  /**
2746
2766
  * Runs `callback` in a transaction that commits when it resolves and rolls back when it rejects, with the settings of `options`.
2747
2767
  *
2748
- * 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.
2749
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.
2750
2771
  */
2751
2772
  transaction<T>(callback: () => Promise<T>, options?: TransactionOptions): Promise<T>;
2752
2773
  /**
@@ -2771,21 +2792,21 @@ declare class TransactionCoordinator {
2771
2792
  * A failure to start or end the level after the abort suppresses the reason in a `SuppressedError`.
2772
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`.
2773
2794
  */
2774
- testTransaction<T>(callback: () => Promise<T>, { signal }?: TestTransactionOptions): Promise<T>;
2795
+ testTransaction<T>(callback: () => Promise<T>, options?: TestTransactionOptions): Promise<T>;
2775
2796
  /**
2776
2797
  * Opens a test fixture: a transaction on a reserved connection, or a savepoint in the innermost open fixture, and runs `seed` in it.
2777
2798
  *
2778
2799
  * Test transactions started outside any transaction run in the innermost fixture.
2779
2800
  * A fixture whose `seed` rejects rolls back and closes.
2780
2801
  */
2781
- createTestFixture<T>(seed: () => Promise<T>): Promise<OpenedTestFixture<T>>;
2802
+ createTestFixture<T>(seed: () => Promise<T>, options?: TestFixtureOptions): Promise<OpenedTestFixture<T>>;
2782
2803
  /**
2783
2804
  * Starts opening a test fixture, see `createTestFixture`, and returns it with a `close` that can be called before it opens.
2784
2805
  *
2785
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.
2786
2807
  * Closing an open fixture also closes the fixtures opening in it.
2787
2808
  */
2788
- startTestFixture<T>(seed: () => Promise<T>): PendingTestFixture<T>;
2809
+ startTestFixture<T>(seed: () => Promise<T>, options?: TestFixtureOptions): PendingTestFixture<T>;
2789
2810
  /**
2790
2811
  * Closes the test fixtures, including those still opening, and then the driver, which waits for the running transactions to end.
2791
2812
  *
@@ -2851,8 +2872,16 @@ interface Database extends AsyncDisposable {
2851
2872
  /** Rolls back the open test fixtures and closes the connections of the driver once the running transactions end. */
2852
2873
  close(): Promise<void>;
2853
2874
  }
2875
+ /** Isolation level of a transaction in PostgreSQL. */
2876
+ type IsolationLevel = "read committed" | "repeatable read" | "serializable";
2854
2877
  /** Options of `transaction` of a `Database` and `$transaction` of a `Db`. */
2855
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;
2856
2885
  /**
2857
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.
2858
2887
  *
@@ -2865,9 +2894,15 @@ interface DatabaseOptions {
2865
2894
  driver: Driver;
2866
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. */
2867
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;
2868
2903
  }
2869
2904
  /** Creates a database over a driver; its transactions are shared by every schema bound to it. */
2870
- declare function createDatabase({ driver, test }: DatabaseOptions): Database;
2905
+ declare function createDatabase({ driver, ...options }: DatabaseOptions): Database;
2871
2906
  /** Physical placement of the tables of a schema bound to a database. */
2872
2907
  interface BindOptions {
2873
2908
  /** PostgreSQL schema of the tables; a function is called on every query, such as to resolve the current tenant. */
@@ -3332,6 +3367,362 @@ declare const textOperators: TextOperators;
3332
3367
  declare const TRUE: Expression<boolean>;
3333
3368
  /** Condition that never holds, such as for a branch of `or` built in code: `or(check, isAdmin ? other : FALSE)`. */
3334
3369
  declare const FALSE: Expression<boolean>;
3370
+ /**
3371
+ * Error of a statement that PostgreSQL rejected, such as for a violated constraint; the connection of the statement stays usable.
3372
+ *
3373
+ * A driver whose client gives the severity of an error only in the language of the server, such as node-postgres, tells such an error by its SQLSTATE when the server translates its messages.
3374
+ * An error that ends the session with a code that a statement also gets, such as `40001` of a conflict with recovery on a replica, then rejects with `QueryError`, and the next statement on the connection with `ConnectionError`.
3375
+ */
3376
+ declare class QueryError extends Error {
3377
+ readonly name = "QueryError";
3378
+ /** SQLSTATE of the error, such as `23505` for a violated unique constraint. */
3379
+ readonly code: string;
3380
+ /** Name of the constraint that the statement violated, if any. */
3381
+ readonly constraint: string | undefined;
3382
+ constructor(message: string, fields: {
3383
+ code: string;
3384
+ constraint?: string | undefined;
3385
+ cause?: unknown;
3386
+ });
3387
+ /** Tells whether `value` is an instance of the class, including one of `QueryError` of another copy of kern-orm. */
3388
+ static [Symbol.hasInstance]<T>(this: abstract new (...args: never) => T, value: unknown): value is T;
3389
+ }
3390
+ /**
3391
+ * Error of a statement or connection that failed for another reason than PostgreSQL rejecting a statement, such as a lost connection, a timeout of the client, or a closed driver.
3392
+ *
3393
+ * The statement may have run or not, and its connection may be lost or in an unknown state of its transaction.
3394
+ */
3395
+ declare class ConnectionError extends Error {
3396
+ readonly name: string;
3397
+ constructor(message: string, options?: {
3398
+ cause?: unknown;
3399
+ });
3400
+ /** Tells whether `value` is an instance of the class, including one of `ConnectionError` of another copy of kern-orm. */
3401
+ static [Symbol.hasInstance]<T>(this: abstract new (...args: never) => T, value: unknown): value is T;
3402
+ }
3403
+ /** Fields of the PostgreSQL error that an error of a client carries, by which `toDriverError` classifies it. */
3404
+ interface DriverErrorFields {
3405
+ /**
3406
+ * Severity of the error, such as `ERROR` or `FATAL`.
3407
+ *
3408
+ * Pass the severity in English when the client gives it, and the one in the language of the server otherwise.
3409
+ */
3410
+ readonly severity?: unknown;
3411
+ /** SQLSTATE of the error, such as `23505`. */
3412
+ readonly code?: unknown;
3413
+ /** Name of the constraint that the statement violated. */
3414
+ readonly constraint?: unknown;
3415
+ }
3416
+ /**
3417
+ * Classifies an error of a client as `QueryError` or `ConnectionError`, by the fields of the PostgreSQL error it carries, for a driver to reject with.
3418
+ *
3419
+ * An error that kern-orm has already classified returns as it is.
3420
+ * An error without a severity or a SQLSTATE, such as of a client that lost its connection, is a `ConnectionError`, and so is one of severity `FATAL` or `PANIC`, which ends the session.
3421
+ * An error of severity `ERROR` is a `QueryError`.
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`.
3423
+ */
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
+ };
3335
3726
  /**
3336
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.
3337
3728
  *
@@ -3415,4 +3806,4 @@ declare function param<E extends AnyExpression, V extends (E extends AnyExpressi
3415
3806
  * A run of capital letters is one word, such as `user_id` for `userID`, and digits stay in their word, such as `line2`.
3416
3807
  */
3417
3808
  declare function toSnakeCase(key: string): string;
3418
- export { NoRelations as $, BoundOperators as $i, ResultOf as $n, ScalarQuery as $r, TypedOperandInput as $t, Db as A, ResultMode as Ai, count as An, and as Ar, DecodedFields as At, PendingTestFixture as B, TextValue as Bi, OrderKey as Bn, CountValueType as Br, InitialMutationState as Bt, BaseOperators as C, TableOptions as Ci, CountExpression as Cn, WhereCondition as Cr, AnyRecordQuery as Ct, UntypedExpression as D, NotFoundError as Di, UnfilteredAggregateOptions as Dn, Condition as Dr, AnyQuery as Dt, TypedExpression as E, defineTable as Ei, StringAggOptions as En, CombinedCondition as Er, SelectionState as Et, DatabaseOptions as F, SqlStatement as Fi, some as Fn, OneRow as Fr, AnyMutationQuery as Ft, createTestHelpers as G, TypeOutput as Gi, asc as Gn, InSignature as Gr, HelperEffect as Gt, TestHelpers as H, TypeInput as Hi, OrderTerms as Hn, EqualityOperator as Hr, MutationQuery as Ht, TransactionOptions as I, TransactionFailure as Ii, stringAgg as In, OneValueRows as Ir, ConflictActionRequired as It, SynchronousResult as J, AnyColumn as Ji, ColumnRefs as Jn, ComparisonSignature as Jr, CaseCondition as Jt, AnyTransformedQuery as K, TypeTransform as Ki, desc as Kn, equalityOperators as Kr, defineHelper as Kt, createDatabase as L, createStatement as Li, sum as Ln, QueryResult as Lr, ConflictKeyRequired as Lt, DbOf as M, Connection as Mi, every as Mn, or as Mr, InitialSqlQueryState as Mt, DbQueryState as N, Driver as Ni, max as Nn, ExistsValueType as Nr, SqlQuery as Nt, AnyDb as O, RequiredRelationError as Oi, UnfilteredStringAggOptions as On, ConditionOperand as Or, SelectQueryKind as Ot, Database as P, DriverResult as Pi, min as Pn, FilteredRows as Pr, SqlQueryState as Pt, MergeRelations as Q, ToColumn as Qi, BoundSelectQuery as Qn, OperandUses as Qr, TypedOperand as Qt, TransactionCoordinator as R, AnyType as Ri, OrderColumns as Rn, ResultByRows as Rr, ConflictTarget as Rt, AnyExpression as S, TableKeys as Si, AggregateOptions as Sn, WhereCallback as Sr, defineSchema as St, ExpressionOperators as T, createTableFactory as Ti, GroupValue as Tn, WhereValues as Tr, RecordQueryState as Tt, TestHooks as U, TypeOperators as Ui, Ordering as Un, EqualityOperators as Ur, MutationQueryState as Ut, TestFixture as V, Type as Vi, OrderTerm as Vn, CompileOptions as Vr, InsertMutationState as Vt, TestTransactionOptions as W, TypeOptions as Wi, SelectedRefs as Wn, HasEquality as Wr, Helper as Wt, TransformedQueryState as X, ColumnAttributes as Xi, RelationRefs as Xn, OperandValue as Xr, FollowingOperand as Xt, TransformedQuery as Y, Column as Yi, QueryContext as Yn, Operand as Yr, CaseValue as Yt, DeclaredRelations as Z, KeyKind as Zi, AnySelectQuery as Zn, compare as Zr, NullSkippingResult as Zt, TextOperators as _, ColumnValues as _i, SelectionResult as _n, KeyCheck as _r, Schema as _t, sql as a, OperatorSignature as aa, InitialQueryState as ai, ColumnFieldTypes as an, InsertValues as ar, RelationKeys as at, NumberTypeOperators as b, Table as bi, literal as bn, PrimaryKeyValues as br, SchemaTables as bt, MatchResult as c, QueryValueType as ci, GroupOperandValue as cn, UpsertValues as cr, SchemaContext as ct, defineExpression as d, TableQueryState as di, GroupedRecord as dn, FoundState as dr, TableRelations as dt, MergeOperators as ea, TypedScalarQuery as ei, TypedOperandOperators as en, SelectQuery as er, OneRelationKeys as et, FALSE as f, AnyTable as fi, MergeSelection as fn, GroupedState as fr, UsableRelation as ft, TextLengthSignature as g, ColumnShape as gi, SelectionFieldTypes as gn, GroupTerms as gr, AnySchema as gt, TextConversionSignature as h, ColumnOperators as hi, Selection as hn, GroupTerm as hr, one as ht, param as i, GenericOperatorImplementation as ia, Grouped as ii, least as in, ConflictUpdateSet as ir, RelationKey as it, DbMutationState as j, ResultRows as ji, countDistinct as jn, not as jr, FieldTypes as jt, BindOptions as k, ResultDecodeError as ki, avg as kn, Predicate as kr, AnySqlQuery as kt, NotAColumn as l, SelectQueryState as li, GroupSelectionResult as ln, FilteredStateRows as lr, SchemaRelations as lt, PatternSignature as m, ColumnDefinitions as mi, SelectedFieldTypes as mn, RowLockOptions as mr, many as mt, SqlTemplate as n, OperatorDefinitions as na, EmptyRecord as ni, coalesce as nn, from as nr, RelationDeclaration as nt, ColumnRefKey as o, defineGenericOperator as oa, QueryState as oi, ExpressionInput as on, UpdateSet as or, RelationKind as ot, TRUE as p, AnyTableKeys as pi, NestedQuery as pn, SelectedOperandType as pr, UsedRelation as pt, NotSynchronous as q, defineType as qi, orderBy as qn, BooleanResult as qr, CaseBranch as qt, identifier as r, GenericOperator as ra, FoundKey as ri, greatest as rn, ColumnValue as rr, RelationDeclarations as rt, MatchCheck as s, QueryStateOf as si, ExpressionValue as sn, UpdateValues as sr, RequiredMember as st, toSnakeCase as t, NoOperators as ta, ValuesQuery as ti, caseWhen as tn, SingletonInsertMany as tr, Relation as tt, matches as u, SingletonQueryState as ui, GroupedField as un, FoundQueryState as ur, TableContext as ut, TextTypeOperators as v, KeyColumns as vi, SelectionUses as vn, NotAKey as vr, SchemaPart as vt, Expression as w, ToColumns as wi, GroupAggregateExpression as wn, WhereFilter as wr, RecordQuery as wt, orderingOperators as x, TableFactoryOptions as xi, AggregateExpression as xn, EqValue as xr, Tables as xt, textOperators as y, Selectable as yi, Literal as yn, PrimaryKeyColumn as yr, SchemaPartRelations as yt, OpenedTestFixture as z, BaseType as zi, OrderDirection as zn, ValueRows as zr, InitialInsertState as zt };
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 { $ as NoRelations, $i as BoundOperators, $n as ResultOf, $r as ScalarQuery, $t as TypedOperandInput, A as Db, Ai as ResultMode, An as count, Ar as and, At as DecodedFields, Bi as TextValue, Bn as OrderKey, Br as CountValueType, Bt as InitialMutationState, C as BaseOperators, Ci as TableOptions, Cn as CountExpression, Cr as WhereCondition, Ct as AnyRecordQuery, D as UntypedExpression, Di as NotFoundError, Dn as UnfilteredAggregateOptions, Dr as Condition, Dt as AnyQuery, E as TypedExpression, Ei as defineTable, En as StringAggOptions, Er as CombinedCondition, Et as SelectionState, F as DatabaseOptions, Fi as SqlStatement, Fn as some, Fr as OneRow, Ft as AnyMutationQuery, Gi as TypeOutput, Gn as asc, Gr as InSignature, Gt as HelperEffect, Hi as TypeInput, Hn as OrderTerms, Hr as EqualityOperator, Ht as MutationQuery, I as TransactionOptions, Ii as TransactionFailure, In as stringAgg, Ir as OneValueRows, It as ConflictActionRequired, J as SynchronousResult, Ji as AnyColumn, Jn as ColumnRefs, Jr as ComparisonSignature, Jt as CaseCondition, K as AnyTransformedQuery, Ki as TypeTransform, Kn as desc, Kr as equalityOperators, Kt as defineHelper, L as createDatabase, Li as createStatement, Ln as sum, Lr as QueryResult, Lt as ConflictKeyRequired, M as DbOf, Mi as Connection, Mn as every, Mr as or, Mt as InitialSqlQueryState, N as DbQueryState, Ni as Driver, Nn as max, Nr as ExistsValueType, Nt as SqlQuery, O as AnyDb, Oi as RequiredRelationError, On as UnfilteredStringAggOptions, Or as ConditionOperand, Ot as SelectQueryKind, P as Database, Pi as DriverResult, Pn as min, Pr as FilteredRows, Pt as SqlQueryState, Q as MergeRelations, Qi as ToColumn, Qn as BoundSelectQuery, Qr as OperandUses, Qt as TypedOperand, R as TransactionCoordinator, Ri as AnyType, Rn as OrderColumns, Rr as ResultByRows, Rt as ConflictTarget, S as AnyExpression, Si as TableKeys, Sn as AggregateOptions, Sr as WhereCallback, St as defineSchema, T as ExpressionOperators, Ti as createTableFactory, Tn as GroupValue, Tr as WhereValues, Tt as RecordQueryState, Ui as TypeOperators, Un as Ordering, Ur as EqualityOperators, Ut as MutationQueryState, Vi as Type, Vn as OrderTerm, Vr as CompileOptions, Vt as InsertMutationState, Wi as TypeOptions, Wn as SelectedRefs, Wr as HasEquality, Wt as Helper, X as TransformedQueryState, Xi as ColumnAttributes, Xn as RelationRefs, Xr as OperandValue, Xt as FollowingOperand, Y as TransformedQuery, Yi as Column, Yn as QueryContext, Yr as Operand, Yt as CaseValue, Z as DeclaredRelations, Zi as KeyKind, Zn as AnySelectQuery, Zr as compare, Zt as NullSkippingResult, _ as TextOperators, _i as ColumnValues, _n as SelectionResult, _r as KeyCheck, _t as Schema, a as sql, aa as OperatorSignature, ai as InitialQueryState, an as ColumnFieldTypes, ar as InsertValues, at as RelationKeys, b as NumberTypeOperators, bi as Table, bn as literal, br as PrimaryKeyValues, bt as SchemaTables, c as MatchResult, ci as QueryValueType, cn as GroupOperandValue, cr as UpsertValues, ct as SchemaContext, d as defineExpression, di as TableQueryState, dn as GroupedRecord, dr as FoundState, dt as TableRelations, ea as MergeOperators, ei as TypedScalarQuery, en as TypedOperandOperators, er as SelectQuery, et as OneRelationKeys, f as FALSE, fi as AnyTable, fn as MergeSelection, fr as GroupedState, ft as UsableRelation, g as TextLengthSignature, gi as ColumnShape, gn as SelectionFieldTypes, gr as GroupTerms, gt as AnySchema, h as TextConversionSignature, hi as ColumnOperators, hn as Selection, hr as GroupTerm, ht as one, i as param, ia as GenericOperatorImplementation, ii as Grouped, in as least, ir as ConflictUpdateSet, it as RelationKey, j as DbMutationState, ji as ResultRows, jn as countDistinct, jr as not, jt as FieldTypes, k as BindOptions, ki as ResultDecodeError, kn as avg, kr as Predicate, kt as AnySqlQuery, l as NotAColumn, li as SelectQueryState, ln as GroupSelectionResult, lr as FilteredStateRows, lt as SchemaRelations, m as PatternSignature, mi as ColumnDefinitions, mn as SelectedFieldTypes, mr as RowLockOptions, mt as many, n as SqlTemplate, na as OperatorDefinitions, ni as EmptyRecord, nn as coalesce, nr as from, nt as RelationDeclaration, o as ColumnRefKey, oa as defineGenericOperator, oi as QueryState, on as ExpressionInput, or as UpdateSet, ot as RelationKind, p as TRUE, pi as AnyTableKeys, pn as NestedQuery, pr as SelectedOperandType, pt as UsedRelation, q as NotSynchronous, qi as defineType, qn as orderBy, qr as BooleanResult, qt as CaseBranch, r as identifier, ra as GenericOperator, ri as FoundKey, rn as greatest, rr as ColumnValue, rt as RelationDeclarations, s as MatchCheck, si as QueryStateOf, sn as ExpressionValue, sr as UpdateValues, st as RequiredMember, t as toSnakeCase, ta as NoOperators, ti as ValuesQuery, tn as caseWhen, tr as SingletonInsertMany, tt as Relation, u as matches, ui as SingletonQueryState, un as GroupedField, ur as FoundQueryState, ut as TableContext, v as TextTypeOperators, vi as KeyColumns, vn as SelectionUses, vr as NotAKey, vt as SchemaPart, w as Expression, wi as ToColumns, wn as GroupAggregateExpression, wr as WhereFilter, wt as RecordQuery, x as orderingOperators, xi as TableFactoryOptions, xn as AggregateExpression, xr as EqValue, xt as Tables, y as textOperators, yi as Selectable, yn as Literal, yr as PrimaryKeyColumn, yt as SchemaPartRelations, zi as BaseType, zn as OrderDirection, zr as ValueRows, zt as InitialInsertState } from "./index-CLKi9gZL.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, type CountExpression, type CountValueType, type Database, type DatabaseOptions, type Db, type DbMutationState, type DbOf, type DbQueryState, type DeclaredRelations, type DecodedFields, type Driver, 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, 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, type TransactionCoordinator, type TransactionFailure, 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, least, literal, many, matches, max, min, not, one, or, orderBy, orderingOperators, param, some, sql, stringAgg, sum, textOperators, toSnakeCase };
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 };