postgrelize 0.0.0-stage → 1.0.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/CHANGELOG.md +269 -0
- package/LICENSE +21 -0
- package/README.md +131 -2
- package/dist/associations/association-accessors.d.ts +21 -0
- package/dist/associations/association-key-types.d.ts +44 -0
- package/dist/associations/association-keys.d.ts +98 -0
- package/dist/associations/association-lookup.d.ts +26 -0
- package/dist/associations/association-shape.d.ts +25 -0
- package/dist/associations/association.d.ts +95 -0
- package/dist/associations/belongs-to-many.d.ts +86 -0
- package/dist/associations/belongs-to.d.ts +45 -0
- package/dist/associations/has-many.d.ts +79 -0
- package/dist/associations/has-one.d.ts +44 -0
- package/dist/associations/include-assembler.d.ts +21 -0
- package/dist/associations/include-columns.d.ts +24 -0
- package/dist/associations/include-joins.d.ts +17 -0
- package/dist/associations/include-loader.d.ts +48 -0
- package/dist/associations/include-order.d.ts +22 -0
- package/dist/associations/include-query-builder.d.ts +54 -0
- package/dist/associations/include-resolver.d.ts +29 -0
- package/dist/associations/include-rows.d.ts +47 -0
- package/dist/associations/include-sub-query.d.ts +35 -0
- package/dist/associations/include.d.ts +112 -0
- package/dist/associations/junction-keys.d.ts +23 -0
- package/dist/associations/nested-creator.d.ts +44 -0
- package/dist/associations/nested-saver.d.ts +30 -0
- package/dist/associations/owner-keys.d.ts +34 -0
- package/dist/associations/separate-include-loader.d.ts +24 -0
- package/dist/associations/types.d.ts +139 -0
- package/dist/connection/connection-config.d.ts +33 -0
- package/dist/connection/connection-manager.d.ts +65 -0
- package/dist/connection/connection-types.d.ts +21 -0
- package/dist/connection/copy-from-stdin.d.ts +52 -0
- package/dist/connection/copy-runner.d.ts +30 -0
- package/dist/connection/copy-to-stdout.d.ts +49 -0
- package/dist/connection/copy.d.ts +22 -0
- package/dist/connection/notifications.d.ts +28 -0
- package/dist/connection/options.d.ts +158 -0
- package/dist/connection/query-logger.d.ts +41 -0
- package/dist/connection/replica-router.d.ts +20 -0
- package/dist/connection/statement-cache.d.ts +36 -0
- package/dist/connection/statement-timeout.d.ts +22 -0
- package/dist/data-types/abstract-data-type.d.ts +58 -0
- package/dist/data-types/array-literal-parser.d.ts +17 -0
- package/dist/data-types/array-type.d.ts +18 -0
- package/dist/data-types/bit-type.d.ts +14 -0
- package/dist/data-types/blob-type.d.ts +12 -0
- package/dist/data-types/char-type.d.ts +12 -0
- package/dist/data-types/composite-fields.d.ts +26 -0
- package/dist/data-types/composite-type.d.ts +32 -0
- package/dist/data-types/data-types.d.ts +172 -0
- package/dist/data-types/date-type.d.ts +14 -0
- package/dist/data-types/decimal-type.d.ts +13 -0
- package/dist/data-types/default-value-generator.d.ts +15 -0
- package/dist/data-types/enum-type.d.ts +19 -0
- package/dist/data-types/ewkb-reader.d.ts +18 -0
- package/dist/data-types/ewkb-writer.d.ts +17 -0
- package/dist/data-types/float-type.d.ts +12 -0
- package/dist/data-types/geometric-text.d.ts +65 -0
- package/dist/data-types/geometric-type.d.ts +46 -0
- package/dist/data-types/hstore-type.d.ts +16 -0
- package/dist/data-types/integer-type.d.ts +24 -0
- package/dist/data-types/json-type.d.ts +16 -0
- package/dist/data-types/multirange-type.d.ts +19 -0
- package/dist/data-types/range-type.d.ts +28 -0
- package/dist/data-types/record-text.d.ts +29 -0
- package/dist/data-types/scalar-type.d.ts +13 -0
- package/dist/data-types/spatial-type.d.ts +20 -0
- package/dist/data-types/string-type.d.ts +12 -0
- package/dist/data-types/text-type.d.ts +12 -0
- package/dist/data-types/timestamp-type.d.ts +15 -0
- package/dist/data-types/virtual-type.d.ts +15 -0
- package/dist/data-types/wall-clock.d.ts +14 -0
- package/dist/ddl/column-ddl.d.ts +73 -0
- package/dist/ddl/constraint-ddl.d.ts +30 -0
- package/dist/ddl/ddl-generator.d.ts +181 -0
- package/dist/ddl/ddl-guards.d.ts +60 -0
- package/dist/ddl/ddl-types.d.ts +193 -0
- package/dist/ddl/enum-ddl.d.ts +42 -0
- package/dist/ddl/extension-ddl.d.ts +57 -0
- package/dist/ddl/function-ddl.d.ts +98 -0
- package/dist/ddl/index-ddl.d.ts +29 -0
- package/dist/ddl/index-element-ddl.d.ts +19 -0
- package/dist/ddl/partition-ddl.d.ts +88 -0
- package/dist/ddl/partition-types.d.ts +94 -0
- package/dist/ddl/policy-ddl.d.ts +137 -0
- package/dist/ddl/routine-guards.d.ts +63 -0
- package/dist/ddl/sequence-ddl.d.ts +103 -0
- package/dist/ddl/sql-literal.d.ts +61 -0
- package/dist/ddl/table-ddl.d.ts +35 -0
- package/dist/ddl/trigger-ddl.d.ts +81 -0
- package/dist/ddl/view-ddl.d.ts +122 -0
- package/dist/decorators/association-applier.d.ts +18 -0
- package/dist/decorators/association-decorators.d.ts +72 -0
- package/dist/decorators/column-decorators.d.ts +147 -0
- package/dist/decorators/decorator-factory.d.ts +45 -0
- package/dist/decorators/decorator-signature.d.ts +26 -0
- package/dist/decorators/decorator-types.d.ts +24 -0
- package/dist/decorators/foreign-key-decorator.d.ts +21 -0
- package/dist/decorators/hook-decorators.d.ts +393 -0
- package/dist/decorators/init-arguments.d.ts +29 -0
- package/dist/decorators/model-decorators.d.ts +18 -0
- package/dist/decorators/model-metadata.d.ts +70 -0
- package/dist/decorators/table-decorators.d.ts +43 -0
- package/dist/decorators/timestamp-decorators.d.ts +38 -0
- package/dist/errors/base-error.d.ts +40 -0
- package/dist/errors/connection-errors.d.ts +152 -0
- package/dist/errors/database-errors.d.ts +152 -0
- package/dist/errors/errors.d.ts +5 -0
- package/dist/errors/map-pg-error.d.ts +27 -0
- package/dist/errors/misc-errors.d.ts +188 -0
- package/dist/errors/validation-errors.d.ts +117 -0
- package/dist/exports-core.d.ts +15 -0
- package/dist/exports-decorators.d.ts +8 -0
- package/dist/exports-errors.d.ts +2 -0
- package/dist/exports-model.d.ts +21 -0
- package/dist/exports-schema.d.ts +19 -0
- package/dist/expressions/call-expressions.d.ts +54 -0
- package/dist/expressions/condition-expressions.d.ts +51 -0
- package/dist/expressions/expression.d.ts +52 -0
- package/dist/expressions/jsonpath-helpers.d.ts +37 -0
- package/dist/expressions/methods.d.ts +188 -0
- package/dist/expressions/op.d.ts +182 -0
- package/dist/expressions/query-expressions.d.ts +110 -0
- package/dist/expressions/row-expressions.d.ts +35 -0
- package/dist/expressions/search-helpers.d.ts +138 -0
- package/dist/expressions/trigram-helpers.d.ts +40 -0
- package/dist/hooks/hooks.d.ts +125 -0
- package/dist/index.cjs +20461 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +20332 -0
- package/dist/index.js.map +1 -0
- package/dist/model/attribute-columns.d.ts +85 -0
- package/dist/model/attribute-normalizer.d.ts +42 -0
- package/dist/model/attribute-options.d.ts +121 -0
- package/dist/model/bulk-insert-builder.d.ts +24 -0
- package/dist/model/bulk-options.d.ts +173 -0
- package/dist/model/copy-options.d.ts +51 -0
- package/dist/model/cte-builder.d.ts +134 -0
- package/dist/model/definition-normalizer.d.ts +26 -0
- package/dist/model/delete-query-builder.d.ts +42 -0
- package/dist/model/find-options.d.ts +144 -0
- package/dist/model/find-query-builder.d.ts +38 -0
- package/dist/model/insert-query-builder.d.ts +41 -0
- package/dist/model/instance-destroyer.d.ts +44 -0
- package/dist/model/instance-lifecycle-services.d.ts +61 -0
- package/dist/model/instance-lifecycle.d.ts +128 -0
- package/dist/model/instance-saver.d.ts +25 -0
- package/dist/model/instance-state.d.ts +48 -0
- package/dist/model/instance-validation.d.ts +35 -0
- package/dist/model/instance-values.d.ts +80 -0
- package/dist/model/instance-writer.d.ts +59 -0
- package/dist/model/join-source-builder.d.ts +25 -0
- package/dist/model/lateral-keys-builder.d.ts +25 -0
- package/dist/model/merge-action-builder.d.ts +31 -0
- package/dist/model/merge-options.d.ts +72 -0
- package/dist/model/merge-query-builder.d.ts +29 -0
- package/dist/model/merge-source-builder.d.ts +22 -0
- package/dist/model/mixins/model-aggregates.d.ts +69 -0
- package/dist/model/mixins/model-associations.d.ts +73 -0
- package/dist/model/mixins/model-constructor.d.ts +7 -0
- package/dist/model/mixins/model-finders.d.ts +124 -0
- package/dist/model/mixins/model-hooks.d.ts +138 -0
- package/dist/model/mixins/model-postgres.d.ts +198 -0
- package/dist/model/mixins/model-schema-binding.d.ts +36 -0
- package/dist/model/mixins/model-schema.d.ts +55 -0
- package/dist/model/mixins/model-scopes.d.ts +57 -0
- package/dist/model/mixins/model-writers.d.ts +175 -0
- package/dist/model/mixins/named-hooks.d.ts +28 -0
- package/dist/model/model-accessors.d.ts +22 -0
- package/dist/model/model-base.d.ts +83 -0
- package/dist/model/model-definition.d.ts +130 -0
- package/dist/model/model-instance-persistence.d.ts +132 -0
- package/dist/model/model-instance-values.d.ts +154 -0
- package/dist/model/model-operations.d.ts +22 -0
- package/dist/model/model-registry.d.ts +139 -0
- package/dist/model/model-services.d.ts +46 -0
- package/dist/model/model-state.d.ts +60 -0
- package/dist/model/model-values.d.ts +86 -0
- package/dist/model/model.d.ts +560 -0
- package/dist/model/on-conflict-builder.d.ts +111 -0
- package/dist/model/operations/bulk-create-operation.d.ts +40 -0
- package/dist/model/operations/copy-from-source.d.ts +51 -0
- package/dist/model/operations/copy-operation.d.ts +54 -0
- package/dist/model/operations/count-operation.d.ts +52 -0
- package/dist/model/operations/create-operation.d.ts +31 -0
- package/dist/model/operations/destroy-operation.d.ts +65 -0
- package/dist/model/operations/find-cursor.d.ts +23 -0
- package/dist/model/operations/find-lookups.d.ts +89 -0
- package/dist/model/operations/find-operation.d.ts +47 -0
- package/dist/model/operations/increment-operation.d.ts +40 -0
- package/dist/model/operations/insert-operation.d.ts +71 -0
- package/dist/model/operations/merge-operation.d.ts +56 -0
- package/dist/model/operations/model-operation.d.ts +33 -0
- package/dist/model/operations/update-operation.d.ts +45 -0
- package/dist/model/operations/upsert-operation.d.ts +39 -0
- package/dist/model/options.d.ts +103 -0
- package/dist/model/returning-old.d.ts +52 -0
- package/dist/model/row-mapper.d.ts +78 -0
- package/dist/model/row-plan.d.ts +31 -0
- package/dist/model/runtime.d.ts +54 -0
- package/dist/model/scope-registry.d.ts +81 -0
- package/dist/model/select-aggregates.d.ts +37 -0
- package/dist/model/select-lock.d.ts +13 -0
- package/dist/model/select-options.d.ts +92 -0
- package/dist/model/select-query-builder.d.ts +73 -0
- package/dist/model/select-targets.d.ts +77 -0
- package/dist/model/source-option-builder.d.ts +23 -0
- package/dist/model/source-options.d.ts +108 -0
- package/dist/model/statement-builder.d.ts +77 -0
- package/dist/model/statement-services.d.ts +2 -0
- package/dist/model/sync-hooks.d.ts +18 -0
- package/dist/model/table-sample-builder.d.ts +13 -0
- package/dist/model/types.d.ts +85 -0
- package/dist/model/unnest-insert-builder.d.ts +24 -0
- package/dist/model/update-query-builder.d.ts +39 -0
- package/dist/model/v6-conflict-builder.d.ts +37 -0
- package/dist/model/value-cloner.d.ts +17 -0
- package/dist/model/values-writer.d.ts +12 -0
- package/dist/model/where-options.d.ts +164 -0
- package/dist/model/write-options.d.ts +160 -0
- package/dist/model/written-rows.d.ts +56 -0
- package/dist/query/query-result-shaper.d.ts +91 -0
- package/dist/query/raw-query.d.ts +27 -0
- package/dist/query-interface/alter-planner.d.ts +40 -0
- package/dist/query-interface/bulk-data.d.ts +44 -0
- package/dist/query-interface/column-commands.d.ts +52 -0
- package/dist/query-interface/column-describer.d.ts +17 -0
- package/dist/query-interface/enum-commands.d.ts +36 -0
- package/dist/query-interface/index-commands.d.ts +57 -0
- package/dist/query-interface/model-tables.d.ts +58 -0
- package/dist/query-interface/object-commands.d.ts +71 -0
- package/dist/query-interface/partition-commands.d.ts +43 -0
- package/dist/query-interface/policy-commands.d.ts +54 -0
- package/dist/query-interface/query-interface-objects.d.ts +108 -0
- package/dist/query-interface/query-interface-partitions.d.ts +66 -0
- package/dist/query-interface/query-interface-policies.d.ts +86 -0
- package/dist/query-interface/query-interface-routines.d.ts +120 -0
- package/dist/query-interface/query-interface-tables.d.ts +179 -0
- package/dist/query-interface/query-interface-types.d.ts +62 -0
- package/dist/query-interface/query-interface-views.d.ts +84 -0
- package/dist/query-interface/query-interface.d.ts +256 -0
- package/dist/query-interface/routine-commands.d.ts +71 -0
- package/dist/query-interface/schema-synchronizer.d.ts +99 -0
- package/dist/query-interface/statement-runner.d.ts +40 -0
- package/dist/query-interface/sync-planner.d.ts +26 -0
- package/dist/query-interface/table-commands.d.ts +63 -0
- package/dist/query-interface/table-introspector.d.ts +58 -0
- package/dist/query-interface/view-commands.d.ts +47 -0
- package/dist/sequelize/sequelize-base.d.ts +196 -0
- package/dist/sequelize/sequelize-constructor.d.ts +7 -0
- package/dist/sequelize/sequelize-hooks.d.ts +86 -0
- package/dist/sequelize/sequelize-internals.d.ts +87 -0
- package/dist/sequelize/sequelize-notifications.d.ts +66 -0
- package/dist/sequelize/sequelize-schema.d.ts +106 -0
- package/dist/sequelize/sequelize-transactions.d.ts +96 -0
- package/dist/sequelize.d.ts +790 -0
- package/dist/sql/ast-clauses.d.ts +137 -0
- package/dist/sql/ast-expressions.d.ts +88 -0
- package/dist/sql/ast-statements.d.ts +80 -0
- package/dist/sql/ast.d.ts +21 -0
- package/dist/sql/compile.d.ts +21 -0
- package/dist/sql/dml-compiler.d.ts +54 -0
- package/dist/sql/expression-compiler.d.ts +56 -0
- package/dist/sql/from-compiler.d.ts +39 -0
- package/dist/sql/identifier-quoter.d.ts +15 -0
- package/dist/sql/merge-compiler.d.ts +20 -0
- package/dist/sql/order.d.ts +15 -0
- package/dist/sql/query-compiler.d.ts +45 -0
- package/dist/sql/sql-chunks.d.ts +50 -0
- package/dist/sql/with-compiler.d.ts +19 -0
- package/dist/transaction/advisory-locks.d.ts +28 -0
- package/dist/transaction/transaction-constants.d.ts +35 -0
- package/dist/transaction/transaction-runner.d.ts +60 -0
- package/dist/transaction/transaction-starter.d.ts +25 -0
- package/dist/transaction/transaction-statements.d.ts +28 -0
- package/dist/transaction/transaction.d.ts +198 -0
- package/dist/validation/attribute-validators.d.ts +23 -0
- package/dist/validation/builtin-attribute-validator.d.ts +19 -0
- package/dist/validation/builtin-validators.d.ts +16 -0
- package/dist/validation/core-validator.d.ts +16 -0
- package/dist/validation/custom-validators.d.ts +13 -0
- package/dist/validation/instance-validator.d.ts +25 -0
- package/dist/validation/schema-items.d.ts +22 -0
- package/dist/validation/standard-schema-validator.d.ts +30 -0
- package/dist/validation/standard-schema.d.ts +39 -0
- package/dist/validation/types.d.ts +36 -0
- package/dist/validation/validation-target.d.ts +13 -0
- package/dist/where/comparison-compiler.d.ts +27 -0
- package/dist/where/condition-compiler.d.ts +18 -0
- package/dist/where/operand-resolver.d.ts +10 -0
- package/dist/where/operator-allowlist.d.ts +14 -0
- package/dist/where/where-support.d.ts +52 -0
- package/dist/where/where.d.ts +46 -0
- package/dist/where/window-compiler.d.ts +14 -0
- package/llm/USAGE.md +423 -0
- package/package.json +102 -4
- package/skills/postgrelize/SKILL.md +57 -0
- package/skills/postgrelize/reference/associations.md +108 -0
- package/skills/postgrelize/reference/errors.md +37 -0
- package/skills/postgrelize/reference/migrating-from-sequelize.md +15 -0
- package/skills/postgrelize/reference/postgresql-features.md +157 -0
- package/skills/postgrelize/reference/querying.md +111 -0
- package/skills/postgrelize/reference/schema.md +135 -0
- package/skills/postgrelize/reference/security.md +34 -0
- package/skills/postgrelize/reference/transactions-and-sessions.md +122 -0
- package/skills/postgrelize/reference/writing.md +198 -0
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
import { Op } from './expressions/op.ts';
|
|
2
|
+
import { Model } from './model/model.ts';
|
|
3
|
+
import { RuntimeOwner } from './model/runtime.ts';
|
|
4
|
+
import { SequelizeBase } from './sequelize/sequelize-base.ts';
|
|
5
|
+
import { SequelizeOptions } from './connection/options.ts';
|
|
6
|
+
import { Transaction } from './transaction/transaction.ts';
|
|
7
|
+
export { QueryTypes } from './query/query-result-shaper.ts';
|
|
8
|
+
export type { QueryOptions, QueryType } from './query/query-result-shaper.ts';
|
|
9
|
+
export type { DefineOptions } from './sequelize/sequelize-base.ts';
|
|
10
|
+
declare const SequelizeMembers: {
|
|
11
|
+
new (...args: any[]): {
|
|
12
|
+
listen(channel: string, handler: import('./exports-schema.ts').NotificationHandler): Promise<() => Promise<void>>;
|
|
13
|
+
notify(channel: string, payload?: unknown, options?: Readonly<{
|
|
14
|
+
transaction?: Transaction | null;
|
|
15
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
16
|
+
benchmark?: boolean;
|
|
17
|
+
statementTimeout?: number;
|
|
18
|
+
useMaster?: boolean;
|
|
19
|
+
}>): Promise<void>;
|
|
20
|
+
readonly options: Readonly<{
|
|
21
|
+
dialect?: "postgres";
|
|
22
|
+
database?: string;
|
|
23
|
+
username?: string;
|
|
24
|
+
password?: string;
|
|
25
|
+
host?: string;
|
|
26
|
+
port?: number;
|
|
27
|
+
ssl?: import('pg').PoolConfig["ssl"];
|
|
28
|
+
dialectOptions?: Readonly<Omit<import('pg').PoolConfig, "types">>;
|
|
29
|
+
pool?: Readonly<{
|
|
30
|
+
max?: number;
|
|
31
|
+
min?: number;
|
|
32
|
+
idle?: number;
|
|
33
|
+
acquire?: number;
|
|
34
|
+
evict?: number;
|
|
35
|
+
maxUses?: number;
|
|
36
|
+
}>;
|
|
37
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
38
|
+
benchmark?: boolean;
|
|
39
|
+
timezone?: string;
|
|
40
|
+
define?: Readonly<{
|
|
41
|
+
timestamps?: boolean;
|
|
42
|
+
underscored?: boolean;
|
|
43
|
+
freezeTableName?: boolean;
|
|
44
|
+
schema?: string;
|
|
45
|
+
paranoid?: boolean;
|
|
46
|
+
hooks?: Partial<Readonly<Record<"beforeValidate" | "afterValidate" | "validationFailed" | "beforeCreate" | "afterCreate" | "beforeUpdate" | "afterUpdate" | "beforeSave" | "afterSave" | "beforeDestroy" | "afterDestroy" | "beforeRestore" | "afterRestore" | "beforeUpsert" | "afterUpsert" | "beforeBulkCreate" | "afterBulkCreate" | "beforeBulkUpdate" | "afterBulkUpdate" | "beforeBulkDestroy" | "afterBulkDestroy" | "beforeBulkRestore" | "afterBulkRestore" | "beforeFind" | "beforeFindAfterExpandIncludeAll" | "beforeFindAfterOptions" | "afterFind" | "beforeCount" | "beforeConnect" | "afterConnect" | "beforeDisconnect" | "afterDisconnect" | "beforePoolAcquire" | "afterPoolAcquire" | "beforeQuery" | "afterQuery" | "beforeSync" | "afterSync" | "beforeBulkSync" | "afterBulkSync" | "beforeDefine" | "afterDefine" | "beforeInit" | "afterInit" | "beforeAssociate" | "afterAssociate", import('./exports-model.ts').HookFunction | readonly import('./exports-model.ts').HookFunction[]>>>;
|
|
47
|
+
}>;
|
|
48
|
+
replication?: Readonly<{
|
|
49
|
+
read: Readonly<{
|
|
50
|
+
host?: string;
|
|
51
|
+
port?: number;
|
|
52
|
+
username?: string;
|
|
53
|
+
password?: string;
|
|
54
|
+
database?: string;
|
|
55
|
+
}> | readonly Readonly<{
|
|
56
|
+
host?: string;
|
|
57
|
+
port?: number;
|
|
58
|
+
username?: string;
|
|
59
|
+
password?: string;
|
|
60
|
+
database?: string;
|
|
61
|
+
}>[];
|
|
62
|
+
write?: Readonly<{
|
|
63
|
+
host?: string;
|
|
64
|
+
port?: number;
|
|
65
|
+
username?: string;
|
|
66
|
+
password?: string;
|
|
67
|
+
database?: string;
|
|
68
|
+
}>;
|
|
69
|
+
}>;
|
|
70
|
+
hooks?: Partial<Readonly<Record<"beforeValidate" | "afterValidate" | "validationFailed" | "beforeCreate" | "afterCreate" | "beforeUpdate" | "afterUpdate" | "beforeSave" | "afterSave" | "beforeDestroy" | "afterDestroy" | "beforeRestore" | "afterRestore" | "beforeUpsert" | "afterUpsert" | "beforeBulkCreate" | "afterBulkCreate" | "beforeBulkUpdate" | "afterBulkUpdate" | "beforeBulkDestroy" | "afterBulkDestroy" | "beforeBulkRestore" | "afterBulkRestore" | "beforeFind" | "beforeFindAfterExpandIncludeAll" | "beforeFindAfterOptions" | "afterFind" | "beforeCount" | "beforeConnect" | "afterConnect" | "beforeDisconnect" | "afterDisconnect" | "beforePoolAcquire" | "afterPoolAcquire" | "beforeQuery" | "afterQuery" | "beforeSync" | "afterSync" | "beforeBulkSync" | "afterBulkSync" | "beforeDefine" | "afterDefine" | "beforeInit" | "afterInit" | "beforeAssociate" | "afterAssociate", import('./exports-model.ts').HookFunction | readonly import('./exports-model.ts').HookFunction[]>>>;
|
|
71
|
+
inAsAnyThreshold?: number;
|
|
72
|
+
statementCache?: boolean | Readonly<{
|
|
73
|
+
max?: number;
|
|
74
|
+
}>;
|
|
75
|
+
}>;
|
|
76
|
+
readonly config: Readonly<{
|
|
77
|
+
database: string | undefined;
|
|
78
|
+
username: string | undefined;
|
|
79
|
+
password: string | undefined;
|
|
80
|
+
host: string;
|
|
81
|
+
port: number;
|
|
82
|
+
}>;
|
|
83
|
+
readonly models: Record<string, import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>>;
|
|
84
|
+
readonly literal: (val: string) => import('./exports-core.ts').Literal;
|
|
85
|
+
readonly fn: (name: string, ...args: readonly unknown[]) => import('./exports-core.ts').Fn;
|
|
86
|
+
readonly col: (name: string) => import('./exports-core.ts').Col;
|
|
87
|
+
readonly cast: (val: unknown, type: string) => import('./exports-core.ts').Cast;
|
|
88
|
+
readonly where: import('./exports-core.ts').WhereFactory;
|
|
89
|
+
readonly json: (conditionsOrPath: string | object, value?: unknown) => import('./exports-core.ts').Json;
|
|
90
|
+
readonly internals: import('./sequelize/sequelize-internals.ts').SequelizeInternals;
|
|
91
|
+
getDialect(): "postgres";
|
|
92
|
+
define<M extends import('./exports-model.ts').AnyModel = Model<import('./exports-model.ts').Values, import('./exports-model.ts').Values>>(modelName: string, attributes: Readonly<Record<string, import('./exports-core.ts').DataTypeInput | Readonly<{
|
|
93
|
+
type: import('./exports-core.ts').DataTypeInput;
|
|
94
|
+
allowNull?: boolean;
|
|
95
|
+
defaultValue?: unknown;
|
|
96
|
+
primaryKey?: boolean;
|
|
97
|
+
autoIncrement?: boolean;
|
|
98
|
+
identity?: "always" | "byDefault";
|
|
99
|
+
generated?: Readonly<{
|
|
100
|
+
as: unknown;
|
|
101
|
+
stored?: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
field?: string;
|
|
104
|
+
unique?: string | boolean | Readonly<{
|
|
105
|
+
name?: string;
|
|
106
|
+
msg?: string;
|
|
107
|
+
nullsNotDistinct?: boolean;
|
|
108
|
+
}>;
|
|
109
|
+
comment?: string;
|
|
110
|
+
references?: string | Readonly<{
|
|
111
|
+
model: string | Readonly<{
|
|
112
|
+
tableName: string;
|
|
113
|
+
schema?: string;
|
|
114
|
+
}>;
|
|
115
|
+
key?: string;
|
|
116
|
+
deferrable?: Readonly<{
|
|
117
|
+
sql: string;
|
|
118
|
+
}>;
|
|
119
|
+
}>;
|
|
120
|
+
onDelete?: string;
|
|
121
|
+
onUpdate?: string;
|
|
122
|
+
validate?: Readonly<Record<string, unknown> & {
|
|
123
|
+
schema?: Readonly<{
|
|
124
|
+
'~standard': Readonly<{
|
|
125
|
+
version: 1;
|
|
126
|
+
vendor: string;
|
|
127
|
+
validate: (value: unknown) => import('./exports-model.ts').StandardSchemaResult | Promise<import('./exports-model.ts').StandardSchemaResult>;
|
|
128
|
+
}>;
|
|
129
|
+
}>;
|
|
130
|
+
notNull?: boolean | Readonly<{
|
|
131
|
+
args?: unknown;
|
|
132
|
+
msg?: string;
|
|
133
|
+
}>;
|
|
134
|
+
}>;
|
|
135
|
+
get?: (this: never) => unknown;
|
|
136
|
+
set?: (this: never, value: never) => void;
|
|
137
|
+
}>>>, options?: import('./sequelize.ts').DefineOptions): import('./exports-model.ts').ModelStatic<M>;
|
|
138
|
+
addModels(models: readonly import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>[]): /*elided*/ any;
|
|
139
|
+
model(modelName: string): import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>;
|
|
140
|
+
isDefined(modelName: string): boolean;
|
|
141
|
+
query(sql: string | import('./exports-core.ts').Literal, options?: import('./sequelize.ts').QueryOptions): Promise<unknown>;
|
|
142
|
+
getQueryInterface(): import('./exports-schema.ts').QueryInterface;
|
|
143
|
+
authenticate(options?: Readonly<{
|
|
144
|
+
transaction?: Transaction | null;
|
|
145
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
146
|
+
benchmark?: boolean;
|
|
147
|
+
statementTimeout?: number;
|
|
148
|
+
useMaster?: boolean;
|
|
149
|
+
}>): Promise<void>;
|
|
150
|
+
databaseVersion(options?: Readonly<{
|
|
151
|
+
transaction?: Transaction | null;
|
|
152
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
153
|
+
benchmark?: boolean;
|
|
154
|
+
statementTimeout?: number;
|
|
155
|
+
useMaster?: boolean;
|
|
156
|
+
}>): Promise<string>;
|
|
157
|
+
close(): Promise<void>;
|
|
158
|
+
};
|
|
159
|
+
} & {
|
|
160
|
+
new (...args: any[]): {
|
|
161
|
+
transaction(options?: Readonly<{
|
|
162
|
+
isolationLevel?: import('./exports-core.ts').IsolationLevel;
|
|
163
|
+
type?: typeof import('./exports-core.ts').TRANSACTION_TYPES[keyof typeof import('./exports-core.ts').TRANSACTION_TYPES];
|
|
164
|
+
readOnly?: boolean;
|
|
165
|
+
deferrable?: boolean;
|
|
166
|
+
transaction?: Transaction | null;
|
|
167
|
+
settings?: Readonly<Record<string, string | number | boolean>>;
|
|
168
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
169
|
+
}>): Promise<Transaction>;
|
|
170
|
+
transaction<T>(run: (transaction: Transaction) => Promise<T>): Promise<T>;
|
|
171
|
+
transaction<T>(options: Readonly<{
|
|
172
|
+
isolationLevel?: import('./exports-core.ts').IsolationLevel;
|
|
173
|
+
type?: typeof import('./exports-core.ts').TRANSACTION_TYPES[keyof typeof import('./exports-core.ts').TRANSACTION_TYPES];
|
|
174
|
+
readOnly?: boolean;
|
|
175
|
+
deferrable?: boolean;
|
|
176
|
+
transaction?: Transaction | null;
|
|
177
|
+
settings?: Readonly<Record<string, string | number | boolean>>;
|
|
178
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
179
|
+
}>, run: (transaction: Transaction) => Promise<T>): Promise<T>;
|
|
180
|
+
withAdvisoryLock<T>(key: import('./exports-core.ts').AdvisoryLockKey, run: (transaction: Transaction) => Promise<T>, options?: Readonly<{
|
|
181
|
+
isolationLevel?: import('./exports-core.ts').IsolationLevel;
|
|
182
|
+
type?: typeof import('./exports-core.ts').TRANSACTION_TYPES[keyof typeof import('./exports-core.ts').TRANSACTION_TYPES];
|
|
183
|
+
readOnly?: boolean;
|
|
184
|
+
deferrable?: boolean;
|
|
185
|
+
transaction?: Transaction | null;
|
|
186
|
+
settings?: Readonly<Record<string, string | number | boolean>>;
|
|
187
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
188
|
+
}>): Promise<T>;
|
|
189
|
+
readonly options: Readonly<{
|
|
190
|
+
dialect?: "postgres";
|
|
191
|
+
database?: string;
|
|
192
|
+
username?: string;
|
|
193
|
+
password?: string;
|
|
194
|
+
host?: string;
|
|
195
|
+
port?: number;
|
|
196
|
+
ssl?: import('pg').PoolConfig["ssl"];
|
|
197
|
+
dialectOptions?: Readonly<Omit<import('pg').PoolConfig, "types">>;
|
|
198
|
+
pool?: Readonly<{
|
|
199
|
+
max?: number;
|
|
200
|
+
min?: number;
|
|
201
|
+
idle?: number;
|
|
202
|
+
acquire?: number;
|
|
203
|
+
evict?: number;
|
|
204
|
+
maxUses?: number;
|
|
205
|
+
}>;
|
|
206
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
207
|
+
benchmark?: boolean;
|
|
208
|
+
timezone?: string;
|
|
209
|
+
define?: Readonly<{
|
|
210
|
+
timestamps?: boolean;
|
|
211
|
+
underscored?: boolean;
|
|
212
|
+
freezeTableName?: boolean;
|
|
213
|
+
schema?: string;
|
|
214
|
+
paranoid?: boolean;
|
|
215
|
+
hooks?: Partial<Readonly<Record<"beforeValidate" | "afterValidate" | "validationFailed" | "beforeCreate" | "afterCreate" | "beforeUpdate" | "afterUpdate" | "beforeSave" | "afterSave" | "beforeDestroy" | "afterDestroy" | "beforeRestore" | "afterRestore" | "beforeUpsert" | "afterUpsert" | "beforeBulkCreate" | "afterBulkCreate" | "beforeBulkUpdate" | "afterBulkUpdate" | "beforeBulkDestroy" | "afterBulkDestroy" | "beforeBulkRestore" | "afterBulkRestore" | "beforeFind" | "beforeFindAfterExpandIncludeAll" | "beforeFindAfterOptions" | "afterFind" | "beforeCount" | "beforeConnect" | "afterConnect" | "beforeDisconnect" | "afterDisconnect" | "beforePoolAcquire" | "afterPoolAcquire" | "beforeQuery" | "afterQuery" | "beforeSync" | "afterSync" | "beforeBulkSync" | "afterBulkSync" | "beforeDefine" | "afterDefine" | "beforeInit" | "afterInit" | "beforeAssociate" | "afterAssociate", import('./exports-model.ts').HookFunction | readonly import('./exports-model.ts').HookFunction[]>>>;
|
|
216
|
+
}>;
|
|
217
|
+
replication?: Readonly<{
|
|
218
|
+
read: Readonly<{
|
|
219
|
+
host?: string;
|
|
220
|
+
port?: number;
|
|
221
|
+
username?: string;
|
|
222
|
+
password?: string;
|
|
223
|
+
database?: string;
|
|
224
|
+
}> | readonly Readonly<{
|
|
225
|
+
host?: string;
|
|
226
|
+
port?: number;
|
|
227
|
+
username?: string;
|
|
228
|
+
password?: string;
|
|
229
|
+
database?: string;
|
|
230
|
+
}>[];
|
|
231
|
+
write?: Readonly<{
|
|
232
|
+
host?: string;
|
|
233
|
+
port?: number;
|
|
234
|
+
username?: string;
|
|
235
|
+
password?: string;
|
|
236
|
+
database?: string;
|
|
237
|
+
}>;
|
|
238
|
+
}>;
|
|
239
|
+
hooks?: Partial<Readonly<Record<"beforeValidate" | "afterValidate" | "validationFailed" | "beforeCreate" | "afterCreate" | "beforeUpdate" | "afterUpdate" | "beforeSave" | "afterSave" | "beforeDestroy" | "afterDestroy" | "beforeRestore" | "afterRestore" | "beforeUpsert" | "afterUpsert" | "beforeBulkCreate" | "afterBulkCreate" | "beforeBulkUpdate" | "afterBulkUpdate" | "beforeBulkDestroy" | "afterBulkDestroy" | "beforeBulkRestore" | "afterBulkRestore" | "beforeFind" | "beforeFindAfterExpandIncludeAll" | "beforeFindAfterOptions" | "afterFind" | "beforeCount" | "beforeConnect" | "afterConnect" | "beforeDisconnect" | "afterDisconnect" | "beforePoolAcquire" | "afterPoolAcquire" | "beforeQuery" | "afterQuery" | "beforeSync" | "afterSync" | "beforeBulkSync" | "afterBulkSync" | "beforeDefine" | "afterDefine" | "beforeInit" | "afterInit" | "beforeAssociate" | "afterAssociate", import('./exports-model.ts').HookFunction | readonly import('./exports-model.ts').HookFunction[]>>>;
|
|
240
|
+
inAsAnyThreshold?: number;
|
|
241
|
+
statementCache?: boolean | Readonly<{
|
|
242
|
+
max?: number;
|
|
243
|
+
}>;
|
|
244
|
+
}>;
|
|
245
|
+
readonly config: Readonly<{
|
|
246
|
+
database: string | undefined;
|
|
247
|
+
username: string | undefined;
|
|
248
|
+
password: string | undefined;
|
|
249
|
+
host: string;
|
|
250
|
+
port: number;
|
|
251
|
+
}>;
|
|
252
|
+
readonly models: Record<string, import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>>;
|
|
253
|
+
readonly literal: (val: string) => import('./exports-core.ts').Literal;
|
|
254
|
+
readonly fn: (name: string, ...args: readonly unknown[]) => import('./exports-core.ts').Fn;
|
|
255
|
+
readonly col: (name: string) => import('./exports-core.ts').Col;
|
|
256
|
+
readonly cast: (val: unknown, type: string) => import('./exports-core.ts').Cast;
|
|
257
|
+
readonly where: import('./exports-core.ts').WhereFactory;
|
|
258
|
+
readonly json: (conditionsOrPath: string | object, value?: unknown) => import('./exports-core.ts').Json;
|
|
259
|
+
readonly internals: import('./sequelize/sequelize-internals.ts').SequelizeInternals;
|
|
260
|
+
getDialect(): "postgres";
|
|
261
|
+
define<M extends import('./exports-model.ts').AnyModel = Model<import('./exports-model.ts').Values, import('./exports-model.ts').Values>>(modelName: string, attributes: Readonly<Record<string, import('./exports-core.ts').DataTypeInput | Readonly<{
|
|
262
|
+
type: import('./exports-core.ts').DataTypeInput;
|
|
263
|
+
allowNull?: boolean;
|
|
264
|
+
defaultValue?: unknown;
|
|
265
|
+
primaryKey?: boolean;
|
|
266
|
+
autoIncrement?: boolean;
|
|
267
|
+
identity?: "always" | "byDefault";
|
|
268
|
+
generated?: Readonly<{
|
|
269
|
+
as: unknown;
|
|
270
|
+
stored?: boolean;
|
|
271
|
+
}>;
|
|
272
|
+
field?: string;
|
|
273
|
+
unique?: string | boolean | Readonly<{
|
|
274
|
+
name?: string;
|
|
275
|
+
msg?: string;
|
|
276
|
+
nullsNotDistinct?: boolean;
|
|
277
|
+
}>;
|
|
278
|
+
comment?: string;
|
|
279
|
+
references?: string | Readonly<{
|
|
280
|
+
model: string | Readonly<{
|
|
281
|
+
tableName: string;
|
|
282
|
+
schema?: string;
|
|
283
|
+
}>;
|
|
284
|
+
key?: string;
|
|
285
|
+
deferrable?: Readonly<{
|
|
286
|
+
sql: string;
|
|
287
|
+
}>;
|
|
288
|
+
}>;
|
|
289
|
+
onDelete?: string;
|
|
290
|
+
onUpdate?: string;
|
|
291
|
+
validate?: Readonly<Record<string, unknown> & {
|
|
292
|
+
schema?: Readonly<{
|
|
293
|
+
'~standard': Readonly<{
|
|
294
|
+
version: 1;
|
|
295
|
+
vendor: string;
|
|
296
|
+
validate: (value: unknown) => import('./exports-model.ts').StandardSchemaResult | Promise<import('./exports-model.ts').StandardSchemaResult>;
|
|
297
|
+
}>;
|
|
298
|
+
}>;
|
|
299
|
+
notNull?: boolean | Readonly<{
|
|
300
|
+
args?: unknown;
|
|
301
|
+
msg?: string;
|
|
302
|
+
}>;
|
|
303
|
+
}>;
|
|
304
|
+
get?: (this: never) => unknown;
|
|
305
|
+
set?: (this: never, value: never) => void;
|
|
306
|
+
}>>>, options?: import('./sequelize.ts').DefineOptions): import('./exports-model.ts').ModelStatic<M>;
|
|
307
|
+
addModels(models: readonly import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>[]): /*elided*/ any;
|
|
308
|
+
model(modelName: string): import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>;
|
|
309
|
+
isDefined(modelName: string): boolean;
|
|
310
|
+
query(sql: string | import('./exports-core.ts').Literal, options?: import('./sequelize.ts').QueryOptions): Promise<unknown>;
|
|
311
|
+
getQueryInterface(): import('./exports-schema.ts').QueryInterface;
|
|
312
|
+
authenticate(options?: Readonly<{
|
|
313
|
+
transaction?: Transaction | null;
|
|
314
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
315
|
+
benchmark?: boolean;
|
|
316
|
+
statementTimeout?: number;
|
|
317
|
+
useMaster?: boolean;
|
|
318
|
+
}>): Promise<void>;
|
|
319
|
+
databaseVersion(options?: Readonly<{
|
|
320
|
+
transaction?: Transaction | null;
|
|
321
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
322
|
+
benchmark?: boolean;
|
|
323
|
+
statementTimeout?: number;
|
|
324
|
+
useMaster?: boolean;
|
|
325
|
+
}>): Promise<string>;
|
|
326
|
+
close(): Promise<void>;
|
|
327
|
+
};
|
|
328
|
+
} & {
|
|
329
|
+
new (...args: any[]): {
|
|
330
|
+
createSchema(schema: string, options?: Readonly<{
|
|
331
|
+
transaction?: Transaction | null;
|
|
332
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
333
|
+
benchmark?: boolean;
|
|
334
|
+
statementTimeout?: number;
|
|
335
|
+
useMaster?: boolean;
|
|
336
|
+
}>): Promise<void>;
|
|
337
|
+
showAllSchemas(options?: Readonly<{
|
|
338
|
+
transaction?: Transaction | null;
|
|
339
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
340
|
+
benchmark?: boolean;
|
|
341
|
+
statementTimeout?: number;
|
|
342
|
+
useMaster?: boolean;
|
|
343
|
+
}>): Promise<string[]>;
|
|
344
|
+
dropSchema(schema: string, options?: Readonly<{
|
|
345
|
+
transaction?: Transaction | null;
|
|
346
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
347
|
+
benchmark?: boolean;
|
|
348
|
+
statementTimeout?: number;
|
|
349
|
+
useMaster?: boolean;
|
|
350
|
+
}>): Promise<void>;
|
|
351
|
+
dropAllSchemas(options?: Readonly<{
|
|
352
|
+
transaction?: Transaction | null;
|
|
353
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
354
|
+
benchmark?: boolean;
|
|
355
|
+
statementTimeout?: number;
|
|
356
|
+
useMaster?: boolean;
|
|
357
|
+
}>): Promise<void>;
|
|
358
|
+
sync(options?: import('./exports-schema.ts').SyncOptions): Promise</*elided*/ any>;
|
|
359
|
+
drop(options?: import('./exports-schema.ts').DropOptions): Promise<void>;
|
|
360
|
+
readonly options: Readonly<{
|
|
361
|
+
dialect?: "postgres";
|
|
362
|
+
database?: string;
|
|
363
|
+
username?: string;
|
|
364
|
+
password?: string;
|
|
365
|
+
host?: string;
|
|
366
|
+
port?: number;
|
|
367
|
+
ssl?: import('pg').PoolConfig["ssl"];
|
|
368
|
+
dialectOptions?: Readonly<Omit<import('pg').PoolConfig, "types">>;
|
|
369
|
+
pool?: Readonly<{
|
|
370
|
+
max?: number;
|
|
371
|
+
min?: number;
|
|
372
|
+
idle?: number;
|
|
373
|
+
acquire?: number;
|
|
374
|
+
evict?: number;
|
|
375
|
+
maxUses?: number;
|
|
376
|
+
}>;
|
|
377
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
378
|
+
benchmark?: boolean;
|
|
379
|
+
timezone?: string;
|
|
380
|
+
define?: Readonly<{
|
|
381
|
+
timestamps?: boolean;
|
|
382
|
+
underscored?: boolean;
|
|
383
|
+
freezeTableName?: boolean;
|
|
384
|
+
schema?: string;
|
|
385
|
+
paranoid?: boolean;
|
|
386
|
+
hooks?: Partial<Readonly<Record<"beforeValidate" | "afterValidate" | "validationFailed" | "beforeCreate" | "afterCreate" | "beforeUpdate" | "afterUpdate" | "beforeSave" | "afterSave" | "beforeDestroy" | "afterDestroy" | "beforeRestore" | "afterRestore" | "beforeUpsert" | "afterUpsert" | "beforeBulkCreate" | "afterBulkCreate" | "beforeBulkUpdate" | "afterBulkUpdate" | "beforeBulkDestroy" | "afterBulkDestroy" | "beforeBulkRestore" | "afterBulkRestore" | "beforeFind" | "beforeFindAfterExpandIncludeAll" | "beforeFindAfterOptions" | "afterFind" | "beforeCount" | "beforeConnect" | "afterConnect" | "beforeDisconnect" | "afterDisconnect" | "beforePoolAcquire" | "afterPoolAcquire" | "beforeQuery" | "afterQuery" | "beforeSync" | "afterSync" | "beforeBulkSync" | "afterBulkSync" | "beforeDefine" | "afterDefine" | "beforeInit" | "afterInit" | "beforeAssociate" | "afterAssociate", import('./exports-model.ts').HookFunction | readonly import('./exports-model.ts').HookFunction[]>>>;
|
|
387
|
+
}>;
|
|
388
|
+
replication?: Readonly<{
|
|
389
|
+
read: Readonly<{
|
|
390
|
+
host?: string;
|
|
391
|
+
port?: number;
|
|
392
|
+
username?: string;
|
|
393
|
+
password?: string;
|
|
394
|
+
database?: string;
|
|
395
|
+
}> | readonly Readonly<{
|
|
396
|
+
host?: string;
|
|
397
|
+
port?: number;
|
|
398
|
+
username?: string;
|
|
399
|
+
password?: string;
|
|
400
|
+
database?: string;
|
|
401
|
+
}>[];
|
|
402
|
+
write?: Readonly<{
|
|
403
|
+
host?: string;
|
|
404
|
+
port?: number;
|
|
405
|
+
username?: string;
|
|
406
|
+
password?: string;
|
|
407
|
+
database?: string;
|
|
408
|
+
}>;
|
|
409
|
+
}>;
|
|
410
|
+
hooks?: Partial<Readonly<Record<"beforeValidate" | "afterValidate" | "validationFailed" | "beforeCreate" | "afterCreate" | "beforeUpdate" | "afterUpdate" | "beforeSave" | "afterSave" | "beforeDestroy" | "afterDestroy" | "beforeRestore" | "afterRestore" | "beforeUpsert" | "afterUpsert" | "beforeBulkCreate" | "afterBulkCreate" | "beforeBulkUpdate" | "afterBulkUpdate" | "beforeBulkDestroy" | "afterBulkDestroy" | "beforeBulkRestore" | "afterBulkRestore" | "beforeFind" | "beforeFindAfterExpandIncludeAll" | "beforeFindAfterOptions" | "afterFind" | "beforeCount" | "beforeConnect" | "afterConnect" | "beforeDisconnect" | "afterDisconnect" | "beforePoolAcquire" | "afterPoolAcquire" | "beforeQuery" | "afterQuery" | "beforeSync" | "afterSync" | "beforeBulkSync" | "afterBulkSync" | "beforeDefine" | "afterDefine" | "beforeInit" | "afterInit" | "beforeAssociate" | "afterAssociate", import('./exports-model.ts').HookFunction | readonly import('./exports-model.ts').HookFunction[]>>>;
|
|
411
|
+
inAsAnyThreshold?: number;
|
|
412
|
+
statementCache?: boolean | Readonly<{
|
|
413
|
+
max?: number;
|
|
414
|
+
}>;
|
|
415
|
+
}>;
|
|
416
|
+
readonly config: Readonly<{
|
|
417
|
+
database: string | undefined;
|
|
418
|
+
username: string | undefined;
|
|
419
|
+
password: string | undefined;
|
|
420
|
+
host: string;
|
|
421
|
+
port: number;
|
|
422
|
+
}>;
|
|
423
|
+
readonly models: Record<string, import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>>;
|
|
424
|
+
readonly literal: (val: string) => import('./exports-core.ts').Literal;
|
|
425
|
+
readonly fn: (name: string, ...args: readonly unknown[]) => import('./exports-core.ts').Fn;
|
|
426
|
+
readonly col: (name: string) => import('./exports-core.ts').Col;
|
|
427
|
+
readonly cast: (val: unknown, type: string) => import('./exports-core.ts').Cast;
|
|
428
|
+
readonly where: import('./exports-core.ts').WhereFactory;
|
|
429
|
+
readonly json: (conditionsOrPath: string | object, value?: unknown) => import('./exports-core.ts').Json;
|
|
430
|
+
readonly internals: import('./sequelize/sequelize-internals.ts').SequelizeInternals;
|
|
431
|
+
getDialect(): "postgres";
|
|
432
|
+
define<M extends import('./exports-model.ts').AnyModel = Model<import('./exports-model.ts').Values, import('./exports-model.ts').Values>>(modelName: string, attributes: Readonly<Record<string, import('./exports-core.ts').DataTypeInput | Readonly<{
|
|
433
|
+
type: import('./exports-core.ts').DataTypeInput;
|
|
434
|
+
allowNull?: boolean;
|
|
435
|
+
defaultValue?: unknown;
|
|
436
|
+
primaryKey?: boolean;
|
|
437
|
+
autoIncrement?: boolean;
|
|
438
|
+
identity?: "always" | "byDefault";
|
|
439
|
+
generated?: Readonly<{
|
|
440
|
+
as: unknown;
|
|
441
|
+
stored?: boolean;
|
|
442
|
+
}>;
|
|
443
|
+
field?: string;
|
|
444
|
+
unique?: string | boolean | Readonly<{
|
|
445
|
+
name?: string;
|
|
446
|
+
msg?: string;
|
|
447
|
+
nullsNotDistinct?: boolean;
|
|
448
|
+
}>;
|
|
449
|
+
comment?: string;
|
|
450
|
+
references?: string | Readonly<{
|
|
451
|
+
model: string | Readonly<{
|
|
452
|
+
tableName: string;
|
|
453
|
+
schema?: string;
|
|
454
|
+
}>;
|
|
455
|
+
key?: string;
|
|
456
|
+
deferrable?: Readonly<{
|
|
457
|
+
sql: string;
|
|
458
|
+
}>;
|
|
459
|
+
}>;
|
|
460
|
+
onDelete?: string;
|
|
461
|
+
onUpdate?: string;
|
|
462
|
+
validate?: Readonly<Record<string, unknown> & {
|
|
463
|
+
schema?: Readonly<{
|
|
464
|
+
'~standard': Readonly<{
|
|
465
|
+
version: 1;
|
|
466
|
+
vendor: string;
|
|
467
|
+
validate: (value: unknown) => import('./exports-model.ts').StandardSchemaResult | Promise<import('./exports-model.ts').StandardSchemaResult>;
|
|
468
|
+
}>;
|
|
469
|
+
}>;
|
|
470
|
+
notNull?: boolean | Readonly<{
|
|
471
|
+
args?: unknown;
|
|
472
|
+
msg?: string;
|
|
473
|
+
}>;
|
|
474
|
+
}>;
|
|
475
|
+
get?: (this: never) => unknown;
|
|
476
|
+
set?: (this: never, value: never) => void;
|
|
477
|
+
}>>>, options?: import('./sequelize.ts').DefineOptions): import('./exports-model.ts').ModelStatic<M>;
|
|
478
|
+
addModels(models: readonly import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>[]): /*elided*/ any;
|
|
479
|
+
model(modelName: string): import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>;
|
|
480
|
+
isDefined(modelName: string): boolean;
|
|
481
|
+
query(sql: string | import('./exports-core.ts').Literal, options?: import('./sequelize.ts').QueryOptions): Promise<unknown>;
|
|
482
|
+
getQueryInterface(): import('./exports-schema.ts').QueryInterface;
|
|
483
|
+
authenticate(options?: Readonly<{
|
|
484
|
+
transaction?: Transaction | null;
|
|
485
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
486
|
+
benchmark?: boolean;
|
|
487
|
+
statementTimeout?: number;
|
|
488
|
+
useMaster?: boolean;
|
|
489
|
+
}>): Promise<void>;
|
|
490
|
+
databaseVersion(options?: Readonly<{
|
|
491
|
+
transaction?: Transaction | null;
|
|
492
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
493
|
+
benchmark?: boolean;
|
|
494
|
+
statementTimeout?: number;
|
|
495
|
+
useMaster?: boolean;
|
|
496
|
+
}>): Promise<string>;
|
|
497
|
+
close(): Promise<void>;
|
|
498
|
+
};
|
|
499
|
+
} & {
|
|
500
|
+
new (...args: any[]): {
|
|
501
|
+
addHook(type: string, nameOrFn: string | import('./exports-model.ts').HookFunction, hook?: import('./exports-model.ts').HookFunction): /*elided*/ any;
|
|
502
|
+
removeHook(type: string, nameOrFn?: string | import('./exports-model.ts').HookFunction): /*elided*/ any;
|
|
503
|
+
hasHook(type: string): boolean;
|
|
504
|
+
hasHooks(type: string): boolean;
|
|
505
|
+
readonly options: Readonly<{
|
|
506
|
+
dialect?: "postgres";
|
|
507
|
+
database?: string;
|
|
508
|
+
username?: string;
|
|
509
|
+
password?: string;
|
|
510
|
+
host?: string;
|
|
511
|
+
port?: number;
|
|
512
|
+
ssl?: import('pg').PoolConfig["ssl"];
|
|
513
|
+
dialectOptions?: Readonly<Omit<import('pg').PoolConfig, "types">>;
|
|
514
|
+
pool?: Readonly<{
|
|
515
|
+
max?: number;
|
|
516
|
+
min?: number;
|
|
517
|
+
idle?: number;
|
|
518
|
+
acquire?: number;
|
|
519
|
+
evict?: number;
|
|
520
|
+
maxUses?: number;
|
|
521
|
+
}>;
|
|
522
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
523
|
+
benchmark?: boolean;
|
|
524
|
+
timezone?: string;
|
|
525
|
+
define?: Readonly<{
|
|
526
|
+
timestamps?: boolean;
|
|
527
|
+
underscored?: boolean;
|
|
528
|
+
freezeTableName?: boolean;
|
|
529
|
+
schema?: string;
|
|
530
|
+
paranoid?: boolean;
|
|
531
|
+
hooks?: Partial<Readonly<Record<"beforeValidate" | "afterValidate" | "validationFailed" | "beforeCreate" | "afterCreate" | "beforeUpdate" | "afterUpdate" | "beforeSave" | "afterSave" | "beforeDestroy" | "afterDestroy" | "beforeRestore" | "afterRestore" | "beforeUpsert" | "afterUpsert" | "beforeBulkCreate" | "afterBulkCreate" | "beforeBulkUpdate" | "afterBulkUpdate" | "beforeBulkDestroy" | "afterBulkDestroy" | "beforeBulkRestore" | "afterBulkRestore" | "beforeFind" | "beforeFindAfterExpandIncludeAll" | "beforeFindAfterOptions" | "afterFind" | "beforeCount" | "beforeConnect" | "afterConnect" | "beforeDisconnect" | "afterDisconnect" | "beforePoolAcquire" | "afterPoolAcquire" | "beforeQuery" | "afterQuery" | "beforeSync" | "afterSync" | "beforeBulkSync" | "afterBulkSync" | "beforeDefine" | "afterDefine" | "beforeInit" | "afterInit" | "beforeAssociate" | "afterAssociate", import('./exports-model.ts').HookFunction | readonly import('./exports-model.ts').HookFunction[]>>>;
|
|
532
|
+
}>;
|
|
533
|
+
replication?: Readonly<{
|
|
534
|
+
read: Readonly<{
|
|
535
|
+
host?: string;
|
|
536
|
+
port?: number;
|
|
537
|
+
username?: string;
|
|
538
|
+
password?: string;
|
|
539
|
+
database?: string;
|
|
540
|
+
}> | readonly Readonly<{
|
|
541
|
+
host?: string;
|
|
542
|
+
port?: number;
|
|
543
|
+
username?: string;
|
|
544
|
+
password?: string;
|
|
545
|
+
database?: string;
|
|
546
|
+
}>[];
|
|
547
|
+
write?: Readonly<{
|
|
548
|
+
host?: string;
|
|
549
|
+
port?: number;
|
|
550
|
+
username?: string;
|
|
551
|
+
password?: string;
|
|
552
|
+
database?: string;
|
|
553
|
+
}>;
|
|
554
|
+
}>;
|
|
555
|
+
hooks?: Partial<Readonly<Record<"beforeValidate" | "afterValidate" | "validationFailed" | "beforeCreate" | "afterCreate" | "beforeUpdate" | "afterUpdate" | "beforeSave" | "afterSave" | "beforeDestroy" | "afterDestroy" | "beforeRestore" | "afterRestore" | "beforeUpsert" | "afterUpsert" | "beforeBulkCreate" | "afterBulkCreate" | "beforeBulkUpdate" | "afterBulkUpdate" | "beforeBulkDestroy" | "afterBulkDestroy" | "beforeBulkRestore" | "afterBulkRestore" | "beforeFind" | "beforeFindAfterExpandIncludeAll" | "beforeFindAfterOptions" | "afterFind" | "beforeCount" | "beforeConnect" | "afterConnect" | "beforeDisconnect" | "afterDisconnect" | "beforePoolAcquire" | "afterPoolAcquire" | "beforeQuery" | "afterQuery" | "beforeSync" | "afterSync" | "beforeBulkSync" | "afterBulkSync" | "beforeDefine" | "afterDefine" | "beforeInit" | "afterInit" | "beforeAssociate" | "afterAssociate", import('./exports-model.ts').HookFunction | readonly import('./exports-model.ts').HookFunction[]>>>;
|
|
556
|
+
inAsAnyThreshold?: number;
|
|
557
|
+
statementCache?: boolean | Readonly<{
|
|
558
|
+
max?: number;
|
|
559
|
+
}>;
|
|
560
|
+
}>;
|
|
561
|
+
readonly config: Readonly<{
|
|
562
|
+
database: string | undefined;
|
|
563
|
+
username: string | undefined;
|
|
564
|
+
password: string | undefined;
|
|
565
|
+
host: string;
|
|
566
|
+
port: number;
|
|
567
|
+
}>;
|
|
568
|
+
readonly models: Record<string, import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>>;
|
|
569
|
+
readonly literal: (val: string) => import('./exports-core.ts').Literal;
|
|
570
|
+
readonly fn: (name: string, ...args: readonly unknown[]) => import('./exports-core.ts').Fn;
|
|
571
|
+
readonly col: (name: string) => import('./exports-core.ts').Col;
|
|
572
|
+
readonly cast: (val: unknown, type: string) => import('./exports-core.ts').Cast;
|
|
573
|
+
readonly where: import('./exports-core.ts').WhereFactory;
|
|
574
|
+
readonly json: (conditionsOrPath: string | object, value?: unknown) => import('./exports-core.ts').Json;
|
|
575
|
+
readonly internals: import('./sequelize/sequelize-internals.ts').SequelizeInternals;
|
|
576
|
+
getDialect(): "postgres";
|
|
577
|
+
define<M extends import('./exports-model.ts').AnyModel = Model<import('./exports-model.ts').Values, import('./exports-model.ts').Values>>(modelName: string, attributes: Readonly<Record<string, import('./exports-core.ts').DataTypeInput | Readonly<{
|
|
578
|
+
type: import('./exports-core.ts').DataTypeInput;
|
|
579
|
+
allowNull?: boolean;
|
|
580
|
+
defaultValue?: unknown;
|
|
581
|
+
primaryKey?: boolean;
|
|
582
|
+
autoIncrement?: boolean;
|
|
583
|
+
identity?: "always" | "byDefault";
|
|
584
|
+
generated?: Readonly<{
|
|
585
|
+
as: unknown;
|
|
586
|
+
stored?: boolean;
|
|
587
|
+
}>;
|
|
588
|
+
field?: string;
|
|
589
|
+
unique?: string | boolean | Readonly<{
|
|
590
|
+
name?: string;
|
|
591
|
+
msg?: string;
|
|
592
|
+
nullsNotDistinct?: boolean;
|
|
593
|
+
}>;
|
|
594
|
+
comment?: string;
|
|
595
|
+
references?: string | Readonly<{
|
|
596
|
+
model: string | Readonly<{
|
|
597
|
+
tableName: string;
|
|
598
|
+
schema?: string;
|
|
599
|
+
}>;
|
|
600
|
+
key?: string;
|
|
601
|
+
deferrable?: Readonly<{
|
|
602
|
+
sql: string;
|
|
603
|
+
}>;
|
|
604
|
+
}>;
|
|
605
|
+
onDelete?: string;
|
|
606
|
+
onUpdate?: string;
|
|
607
|
+
validate?: Readonly<Record<string, unknown> & {
|
|
608
|
+
schema?: Readonly<{
|
|
609
|
+
'~standard': Readonly<{
|
|
610
|
+
version: 1;
|
|
611
|
+
vendor: string;
|
|
612
|
+
validate: (value: unknown) => import('./exports-model.ts').StandardSchemaResult | Promise<import('./exports-model.ts').StandardSchemaResult>;
|
|
613
|
+
}>;
|
|
614
|
+
}>;
|
|
615
|
+
notNull?: boolean | Readonly<{
|
|
616
|
+
args?: unknown;
|
|
617
|
+
msg?: string;
|
|
618
|
+
}>;
|
|
619
|
+
}>;
|
|
620
|
+
get?: (this: never) => unknown;
|
|
621
|
+
set?: (this: never, value: never) => void;
|
|
622
|
+
}>>>, options?: import('./sequelize.ts').DefineOptions): import('./exports-model.ts').ModelStatic<M>;
|
|
623
|
+
addModels(models: readonly import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>[]): /*elided*/ any;
|
|
624
|
+
model(modelName: string): import('./exports-model.ts').ModelStatic<import('./exports-model.ts').AnyModel>;
|
|
625
|
+
isDefined(modelName: string): boolean;
|
|
626
|
+
query(sql: string | import('./exports-core.ts').Literal, options?: import('./sequelize.ts').QueryOptions): Promise<unknown>;
|
|
627
|
+
getQueryInterface(): import('./exports-schema.ts').QueryInterface;
|
|
628
|
+
authenticate(options?: Readonly<{
|
|
629
|
+
transaction?: Transaction | null;
|
|
630
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
631
|
+
benchmark?: boolean;
|
|
632
|
+
statementTimeout?: number;
|
|
633
|
+
useMaster?: boolean;
|
|
634
|
+
}>): Promise<void>;
|
|
635
|
+
databaseVersion(options?: Readonly<{
|
|
636
|
+
transaction?: Transaction | null;
|
|
637
|
+
logging?: import('./exports-core.ts').LoggingFunction | false;
|
|
638
|
+
benchmark?: boolean;
|
|
639
|
+
statementTimeout?: number;
|
|
640
|
+
useMaster?: boolean;
|
|
641
|
+
}>): Promise<string>;
|
|
642
|
+
close(): Promise<void>;
|
|
643
|
+
};
|
|
644
|
+
} & typeof SequelizeBase;
|
|
645
|
+
export interface Sequelize extends RuntimeOwner {
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Entry point, API-compatible with Sequelize v6 `Sequelize` for PostgreSQL.
|
|
649
|
+
*
|
|
650
|
+
* @example
|
|
651
|
+
* ```ts
|
|
652
|
+
* const sequelize = new Sequelize('postgres://user:pass@localhost:5432/app', { logging: false });
|
|
653
|
+
* ```
|
|
654
|
+
*/
|
|
655
|
+
export declare class Sequelize extends SequelizeMembers {
|
|
656
|
+
/** Column types. */
|
|
657
|
+
static readonly DataTypes: {
|
|
658
|
+
readonly STRING: ((length?: number | undefined) => import('./data-types/string-type.ts').StringType) & import('./data-types/string-type.ts').StringType;
|
|
659
|
+
readonly CHAR: ((length?: number | undefined) => import('./data-types/char-type.ts').CharType) & import('./data-types/char-type.ts').CharType;
|
|
660
|
+
readonly TEXT: ((size?: "tiny" | "medium" | "long" | undefined) => import('./data-types/text-type.ts').TextType) & import('./data-types/text-type.ts').TextType;
|
|
661
|
+
readonly CITEXT: import('./data-types/scalar-type.ts').ScalarType;
|
|
662
|
+
readonly INTEGER: import('./data-types/integer-type.ts').IntegerType;
|
|
663
|
+
readonly SMALLINT: import('./data-types/integer-type.ts').IntegerType;
|
|
664
|
+
readonly TINYINT: import('./data-types/integer-type.ts').IntegerType;
|
|
665
|
+
readonly MEDIUMINT: import('./data-types/integer-type.ts').IntegerType;
|
|
666
|
+
readonly BIGINT: import('./data-types/integer-type.ts').IntegerType;
|
|
667
|
+
readonly FLOAT: ((digits?: number | undefined) => import('./data-types/float-type.ts').FloatType) & import('./data-types/float-type.ts').FloatType;
|
|
668
|
+
readonly REAL: import('./data-types/scalar-type.ts').ScalarType;
|
|
669
|
+
readonly DOUBLE: import('./data-types/scalar-type.ts').ScalarType;
|
|
670
|
+
readonly DECIMAL: ((digits?: number | undefined, scale?: number | undefined) => import('./data-types/decimal-type.ts').DecimalType) & import('./data-types/decimal-type.ts').DecimalType;
|
|
671
|
+
readonly NUMBER: ((digits?: number | undefined, scale?: number | undefined) => import('./data-types/decimal-type.ts').DecimalType) & import('./data-types/decimal-type.ts').DecimalType;
|
|
672
|
+
readonly BOOLEAN: import('./data-types/scalar-type.ts').ScalarType;
|
|
673
|
+
readonly DATE: ((fsp?: number | undefined) => import('./data-types/date-type.ts').DateType) & import('./data-types/date-type.ts').DateType;
|
|
674
|
+
readonly TIMESTAMP: ((fsp?: number | undefined) => import('./data-types/timestamp-type.ts').TimestampType) & import('./data-types/timestamp-type.ts').TimestampType;
|
|
675
|
+
readonly DATEONLY: import('./data-types/scalar-type.ts').ScalarType;
|
|
676
|
+
readonly TIME: import('./data-types/scalar-type.ts').ScalarType;
|
|
677
|
+
readonly INTERVAL: import('./data-types/scalar-type.ts').ScalarType;
|
|
678
|
+
readonly JSON: import('./data-types/json-type.ts').JsonType;
|
|
679
|
+
readonly JSONB: import('./data-types/json-type.ts').JsonType;
|
|
680
|
+
readonly BLOB: ((size?: "tiny" | "medium" | "long" | undefined) => import('./data-types/blob-type.ts').BlobType) & import('./data-types/blob-type.ts').BlobType;
|
|
681
|
+
readonly UUID: import('./data-types/scalar-type.ts').ScalarType;
|
|
682
|
+
readonly HSTORE: import('./data-types/hstore-type.ts').HstoreType;
|
|
683
|
+
readonly LTREE: import('./data-types/scalar-type.ts').ScalarType;
|
|
684
|
+
readonly MONEY: import('./data-types/scalar-type.ts').ScalarType;
|
|
685
|
+
readonly XML: import('./data-types/scalar-type.ts').ScalarType;
|
|
686
|
+
readonly BIT: ((length?: number | undefined) => import('./data-types/bit-type.ts').BitType) & import('./data-types/bit-type.ts').BitType;
|
|
687
|
+
readonly VARBIT: ((length?: number | undefined) => import('./data-types/bit-type.ts').BitType) & import('./data-types/bit-type.ts').BitType;
|
|
688
|
+
readonly INET: import('./data-types/scalar-type.ts').ScalarType;
|
|
689
|
+
readonly CIDR: import('./data-types/scalar-type.ts').ScalarType;
|
|
690
|
+
readonly MACADDR: import('./data-types/scalar-type.ts').ScalarType;
|
|
691
|
+
readonly MACADDR8: import('./data-types/scalar-type.ts').ScalarType;
|
|
692
|
+
readonly TSQUERY: import('./data-types/scalar-type.ts').ScalarType;
|
|
693
|
+
readonly TSVECTOR: import('./data-types/scalar-type.ts').ScalarType;
|
|
694
|
+
readonly POINT: import('./data-types/geometric-type.ts').GeometricType;
|
|
695
|
+
readonly LINE: import('./data-types/geometric-type.ts').GeometricType;
|
|
696
|
+
readonly LSEG: import('./data-types/geometric-type.ts').GeometricType;
|
|
697
|
+
readonly BOX: import('./data-types/geometric-type.ts').GeometricType;
|
|
698
|
+
readonly PATH: import('./data-types/geometric-type.ts').GeometricType;
|
|
699
|
+
readonly POLYGON: import('./data-types/geometric-type.ts').GeometricType;
|
|
700
|
+
readonly CIRCLE: import('./data-types/geometric-type.ts').GeometricType;
|
|
701
|
+
readonly GEOMETRY: ((geometryType?: string | undefined, srid?: number | undefined) => import('./data-types/spatial-type.ts').SpatialType) & import('./data-types/spatial-type.ts').SpatialType;
|
|
702
|
+
readonly GEOGRAPHY: ((geographyType?: string | undefined, srid?: number | undefined) => import('./data-types/spatial-type.ts').SpatialType) & import('./data-types/spatial-type.ts').SpatialType;
|
|
703
|
+
readonly ARRAY: (subtype: import('./exports-core.ts').DataTypeInput) => import('./data-types/array-type.ts').ArrayType;
|
|
704
|
+
readonly RANGE: ((subtype?: import('./exports-core.ts').DataTypeInput | undefined) => import('./data-types/range-type.ts').RangeType) & import('./data-types/range-type.ts').RangeType;
|
|
705
|
+
readonly MULTIRANGE: ((subtype?: import('./exports-core.ts').DataTypeInput | undefined) => import('./data-types/multirange-type.ts').MultirangeType) & import('./data-types/multirange-type.ts').MultirangeType;
|
|
706
|
+
readonly COMPOSITE: (name: string, fields: Readonly<Record<string, import('./exports-core.ts').DataTypeInput>>) => import('./data-types/composite-type.ts').CompositeType;
|
|
707
|
+
readonly ENUM: (...args: readonly (string | readonly string[] | Readonly<{
|
|
708
|
+
values: readonly string[];
|
|
709
|
+
}>)[]) => import('./data-types/enum-type.ts').EnumType;
|
|
710
|
+
readonly VIRTUAL: ((returnType?: import('./exports-core.ts').DataTypeInput | undefined, fields?: readonly string[] | undefined) => import('./data-types/virtual-type.ts').VirtualType) & import('./data-types/virtual-type.ts').VirtualType;
|
|
711
|
+
readonly NOW: import('./exports-core.ts').DefaultValueGenerator;
|
|
712
|
+
readonly UUIDV4: import('./exports-core.ts').DefaultValueGenerator;
|
|
713
|
+
};
|
|
714
|
+
/** Query operators. */
|
|
715
|
+
static readonly Op: typeof Op;
|
|
716
|
+
/** Result shapes accepted by the `type` option of {@link Sequelize.query}, e.g. `QueryTypes.SELECT`. */
|
|
717
|
+
static readonly QueryTypes: {
|
|
718
|
+
readonly SELECT: "SELECT";
|
|
719
|
+
readonly INSERT: "INSERT";
|
|
720
|
+
readonly UPDATE: "UPDATE";
|
|
721
|
+
readonly UPSERT: "UPSERT";
|
|
722
|
+
readonly DELETE: "DELETE";
|
|
723
|
+
readonly BULKUPDATE: "BULKUPDATE";
|
|
724
|
+
readonly BULKDELETE: "BULKDELETE";
|
|
725
|
+
readonly RAW: "RAW";
|
|
726
|
+
readonly SHOWTABLES: "SHOWTABLES";
|
|
727
|
+
readonly DESCRIBE: "DESCRIBE";
|
|
728
|
+
readonly VERSION: "VERSION";
|
|
729
|
+
readonly FOREIGNKEYS: "FOREIGNKEYS";
|
|
730
|
+
readonly SHOWINDEXES: "SHOWINDEXES";
|
|
731
|
+
};
|
|
732
|
+
/** Transaction class. */
|
|
733
|
+
static readonly Transaction: typeof Transaction;
|
|
734
|
+
/** Model base class. */
|
|
735
|
+
static readonly Model: typeof Model;
|
|
736
|
+
/** Raw SQL fragment builder. */
|
|
737
|
+
static readonly literal: (val: string) => import('./exports-core.ts').Literal;
|
|
738
|
+
/** SQL function call builder. */
|
|
739
|
+
static readonly fn: (name: string, ...args: readonly unknown[]) => import('./exports-core.ts').Fn;
|
|
740
|
+
/** Column reference builder. */
|
|
741
|
+
static readonly col: (name: string) => import('./exports-core.ts').Col;
|
|
742
|
+
/** Type cast builder. */
|
|
743
|
+
static readonly cast: (val: unknown, type: string) => import('./exports-core.ts').Cast;
|
|
744
|
+
/** Comparison builder. */
|
|
745
|
+
static readonly where: import('./exports-core.ts').WhereFactory;
|
|
746
|
+
/** JSON path builder. */
|
|
747
|
+
static readonly json: (conditionsOrPath: string | object, value?: unknown) => import('./exports-core.ts').Json;
|
|
748
|
+
/**
|
|
749
|
+
* Enables continuation-local transactions: queries inside `sequelize.transaction(fn)` use the
|
|
750
|
+
* transaction automatically. The namespace argument of Sequelize v6 is accepted and ignored;
|
|
751
|
+
* `AsyncLocalStorage` is used instead.
|
|
752
|
+
*
|
|
753
|
+
* @param _namespace - Ignored.
|
|
754
|
+
* @returns The `Sequelize` class.
|
|
755
|
+
* @see {@link Sequelize.transaction}
|
|
756
|
+
*
|
|
757
|
+
* @example
|
|
758
|
+
* ```ts
|
|
759
|
+
* Sequelize.useCLS();
|
|
760
|
+
* await sequelize.transaction(async () => {
|
|
761
|
+
* // No `{ transaction }` option needed: the queries join the managed transaction.
|
|
762
|
+
* const user = await User.create({ name: 'Ada' });
|
|
763
|
+
* await Post.create({ title: 'Hello', userId: user.id });
|
|
764
|
+
* });
|
|
765
|
+
* ```
|
|
766
|
+
*/
|
|
767
|
+
static useCLS(_namespace?: unknown): typeof Sequelize;
|
|
768
|
+
/**
|
|
769
|
+
* Creates an instance from a connection URI.
|
|
770
|
+
*
|
|
771
|
+
* @param uri - `postgres://user:password@host:port/database`.
|
|
772
|
+
* @param options - Options.
|
|
773
|
+
*/
|
|
774
|
+
constructor(uri: string, options?: SequelizeOptions);
|
|
775
|
+
/**
|
|
776
|
+
* Creates an instance from connection parameters.
|
|
777
|
+
*
|
|
778
|
+
* @param database - Database name.
|
|
779
|
+
* @param username - User name.
|
|
780
|
+
* @param password - Password.
|
|
781
|
+
* @param options - Options.
|
|
782
|
+
*/
|
|
783
|
+
constructor(database: string, username?: string | null, password?: string | null, options?: SequelizeOptions);
|
|
784
|
+
/**
|
|
785
|
+
* Creates an instance from options only.
|
|
786
|
+
*
|
|
787
|
+
* @param options - Options including connection settings.
|
|
788
|
+
*/
|
|
789
|
+
constructor(options?: SequelizeOptions);
|
|
790
|
+
}
|