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,560 @@
|
|
|
1
|
+
import { ModelBase } from './model-base.ts';
|
|
2
|
+
import { ModelInstancePersistence } from './model-instance-persistence.ts';
|
|
3
|
+
import { ModelInstanceValues } from './model-instance-values.ts';
|
|
4
|
+
import { BuildOptions, Values } from './options.ts';
|
|
5
|
+
export type { NamedHookAdder } from './mixins/named-hooks.ts';
|
|
6
|
+
declare const ModelStatics: {
|
|
7
|
+
new (...args: any[]): {
|
|
8
|
+
get wasInserted(): boolean | undefined;
|
|
9
|
+
get oldValues(): Readonly<Record<string, unknown>> | null | undefined;
|
|
10
|
+
get sequelize(): import('./runtime.ts').RuntimeOwner;
|
|
11
|
+
};
|
|
12
|
+
insert<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, values: import('./options.ts').CreationAttributes<M> | readonly import('./options.ts').CreationAttributes<M>[], options?: import('./write-options.ts').InsertOptions<import('./options.ts').Attributes<M>>): Promise<M[]>;
|
|
13
|
+
insertFrom<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, source: import('../exports-core.ts').Subquery, options: import('./write-options.ts').InsertFromOptions<import('./options.ts').Attributes<M>>): Promise<M[]>;
|
|
14
|
+
merge<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options: import('./merge-options.ts').MergeOptions<import('./options.ts').Attributes<M>> & Readonly<{
|
|
15
|
+
transaction?: import('../exports-core.ts').Transaction | null;
|
|
16
|
+
logging?: import('../exports-core.ts').LoggingFunction | false;
|
|
17
|
+
benchmark?: boolean;
|
|
18
|
+
statementTimeout?: number;
|
|
19
|
+
useMaster?: boolean;
|
|
20
|
+
}> & Readonly<{
|
|
21
|
+
returning?: boolean;
|
|
22
|
+
returningOld?: boolean;
|
|
23
|
+
}>): Promise<Readonly<{
|
|
24
|
+
rowCount: number;
|
|
25
|
+
rows: readonly Readonly<{
|
|
26
|
+
action: import('./operations/merge-operation.ts').MergeActionName;
|
|
27
|
+
instance: M;
|
|
28
|
+
}>[];
|
|
29
|
+
}>>;
|
|
30
|
+
subquery<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: Readonly<{
|
|
31
|
+
transaction?: import('../exports-core.ts').Transaction | null;
|
|
32
|
+
logging?: import('../exports-core.ts').LoggingFunction | false;
|
|
33
|
+
benchmark?: boolean;
|
|
34
|
+
statementTimeout?: number;
|
|
35
|
+
useMaster?: boolean;
|
|
36
|
+
}> & Omit<Readonly<{
|
|
37
|
+
where?: unknown;
|
|
38
|
+
attributes?: import('./select-options.ts').FindAttributeOptions;
|
|
39
|
+
order?: import('./select-options.ts').Order;
|
|
40
|
+
group?: unknown;
|
|
41
|
+
having?: unknown;
|
|
42
|
+
limit?: number | null;
|
|
43
|
+
offset?: number | null;
|
|
44
|
+
lock?: import('./select-options.ts').LockOption;
|
|
45
|
+
skipLocked?: boolean;
|
|
46
|
+
noWait?: boolean;
|
|
47
|
+
distinctOn?: readonly unknown[];
|
|
48
|
+
withTies?: boolean;
|
|
49
|
+
sample?: Readonly<{
|
|
50
|
+
method: "BERNOULLI" | "SYSTEM";
|
|
51
|
+
percent: number;
|
|
52
|
+
seed?: number;
|
|
53
|
+
}>;
|
|
54
|
+
lateralKeys?: Readonly<{
|
|
55
|
+
attribute: string;
|
|
56
|
+
values: readonly unknown[];
|
|
57
|
+
}>;
|
|
58
|
+
fromQuery?: import('../sql/ast-statements.ts').QueryNode;
|
|
59
|
+
withClause?: Readonly<{
|
|
60
|
+
recursive: boolean;
|
|
61
|
+
ctes: readonly Readonly<{
|
|
62
|
+
name: string;
|
|
63
|
+
query: import('../sql/ast-statements.ts').QueryNode | import('../sql/ast-statements.ts').ModifyingNode;
|
|
64
|
+
materialized?: boolean;
|
|
65
|
+
search?: Readonly<{
|
|
66
|
+
mode: "BREADTH" | "DEPTH";
|
|
67
|
+
by: readonly string[];
|
|
68
|
+
set: string;
|
|
69
|
+
}>;
|
|
70
|
+
cycle?: Readonly<{
|
|
71
|
+
columns: readonly string[];
|
|
72
|
+
set: string;
|
|
73
|
+
using: string;
|
|
74
|
+
}>;
|
|
75
|
+
}>[];
|
|
76
|
+
}>;
|
|
77
|
+
extraFrom?: readonly import('../sql/ast-clauses.ts').FromItem[];
|
|
78
|
+
}>, "where"> & Readonly<{
|
|
79
|
+
where?: import('./where-options.ts').WhereOptions<import('./options.ts').Attributes<M>> | undefined;
|
|
80
|
+
raw?: boolean;
|
|
81
|
+
nest?: boolean;
|
|
82
|
+
plain?: boolean;
|
|
83
|
+
rejectOnEmpty?: boolean | Error;
|
|
84
|
+
paranoid?: boolean;
|
|
85
|
+
hooks?: boolean;
|
|
86
|
+
include?: import('../exports-schema.ts').IncludeOption;
|
|
87
|
+
subQuery?: boolean;
|
|
88
|
+
}> & Readonly<{
|
|
89
|
+
with?: Readonly<Record<string, import('../exports-core.ts').Subquery | import('../exports-core.ts').WriteStatement | Readonly<{
|
|
90
|
+
query: import('../exports-core.ts').Subquery | import('../exports-core.ts').WriteStatement;
|
|
91
|
+
recursive?: import('../exports-core.ts').Subquery;
|
|
92
|
+
unionAll?: boolean;
|
|
93
|
+
materialized?: boolean;
|
|
94
|
+
search?: Readonly<{
|
|
95
|
+
by: readonly string[];
|
|
96
|
+
mode?: "breadth" | "depth";
|
|
97
|
+
set: string;
|
|
98
|
+
}>;
|
|
99
|
+
cycle?: Readonly<{
|
|
100
|
+
columns: readonly string[];
|
|
101
|
+
set: string;
|
|
102
|
+
using: string;
|
|
103
|
+
}>;
|
|
104
|
+
}>>>;
|
|
105
|
+
source?: string | import('../exports-core.ts').Subquery;
|
|
106
|
+
from?: import('./join-source-builder.ts').JoinSources;
|
|
107
|
+
}> & Readonly<{
|
|
108
|
+
as?: string;
|
|
109
|
+
}>): import('../exports-core.ts').Subquery;
|
|
110
|
+
updateStatement<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, values: Partial<import('./options.ts').Attributes<M>>, options?: import('./statement-builder.ts').UpdateStatementOptions<import('./options.ts').Attributes<M>>): import('../exports-core.ts').WriteStatement;
|
|
111
|
+
deleteStatement<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: Readonly<{
|
|
112
|
+
where?: import('./where-options.ts').WhereOptions<import('./options.ts').Attributes<M>> | undefined;
|
|
113
|
+
returning?: boolean;
|
|
114
|
+
}>): import('../exports-core.ts').WriteStatement;
|
|
115
|
+
insertStatement<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, rows: readonly import('./options.ts').CreationAttributes<M>[], options?: Pick<Readonly<{
|
|
116
|
+
where?: import('./where-options.ts').WhereOptions<import('./options.ts').Attributes<M>> | undefined;
|
|
117
|
+
returning?: boolean;
|
|
118
|
+
}>, "returning">): import('../exports-core.ts').WriteStatement;
|
|
119
|
+
findEach<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: import('./find-options.ts').FindOptions<import('./options.ts').Attributes<M>>, cursor?: Readonly<{
|
|
120
|
+
batchSize?: number;
|
|
121
|
+
}>): AsyncGenerator<M, void, undefined>;
|
|
122
|
+
copyFrom<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, rows: Iterable<import('./options.ts').CreationAttributes<M>> | AsyncIterable<import('./options.ts').CreationAttributes<M>>, options?: import('./copy-options.ts').CopyFromOptions<import('./options.ts').Attributes<M>>): Promise<number>;
|
|
123
|
+
copyTo<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: import('./copy-options.ts').CopyToOptions<import('./options.ts').Attributes<M>>): AsyncGenerator<Buffer, void, undefined>;
|
|
124
|
+
} & {
|
|
125
|
+
new (...args: any[]): {
|
|
126
|
+
get wasInserted(): boolean | undefined;
|
|
127
|
+
get oldValues(): Readonly<Record<string, unknown>> | null | undefined;
|
|
128
|
+
get sequelize(): import('./runtime.ts').RuntimeOwner;
|
|
129
|
+
};
|
|
130
|
+
build<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, values?: Values | import('./options.ts').CreationAttributes<M> | undefined, options?: Readonly<{
|
|
131
|
+
isNewRecord?: boolean;
|
|
132
|
+
raw?: boolean;
|
|
133
|
+
include?: import('../exports-schema.ts').IncludeOption;
|
|
134
|
+
}> | undefined): M;
|
|
135
|
+
bulkBuild<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, records: readonly (Values | import('./options.ts').CreationAttributes<M>)[], options?: Readonly<{
|
|
136
|
+
isNewRecord?: boolean;
|
|
137
|
+
raw?: boolean;
|
|
138
|
+
include?: import('../exports-schema.ts').IncludeOption;
|
|
139
|
+
}> | undefined): M[];
|
|
140
|
+
create<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, values?: import('./options.ts').CreationAttributes<M> | undefined, options?: import('./write-options.ts').CreateOptions<import('./options.ts').Attributes<M>>): Promise<M>;
|
|
141
|
+
bulkCreate<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, records: readonly import('./options.ts').CreationAttributes<M>[], options?: import('./bulk-options.ts').BulkCreateOptions<import('./options.ts').Attributes<M>>): Promise<M[]>;
|
|
142
|
+
upsert<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, values: import('./options.ts').CreationAttributes<M>, options?: import('./write-options.ts').UpsertOptions<import('./options.ts').Attributes<M>>): Promise<[M, boolean | null]>;
|
|
143
|
+
update<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, values: Partial<import('./options.ts').Attributes<M>>, options: import('./bulk-options.ts').UpdateOptions<import('./options.ts').Attributes<M>>): Promise<[affectedCount: number, affectedRows?: M[] | undefined]>;
|
|
144
|
+
destroy<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options: Readonly<{
|
|
145
|
+
transaction?: import('../exports-core.ts').Transaction | null;
|
|
146
|
+
logging?: import('../exports-core.ts').LoggingFunction | false;
|
|
147
|
+
benchmark?: boolean;
|
|
148
|
+
statementTimeout?: number;
|
|
149
|
+
useMaster?: boolean;
|
|
150
|
+
}> & Readonly<{
|
|
151
|
+
where?: import('./where-options.ts').WhereOptions<import('./options.ts').Attributes<M>> | undefined;
|
|
152
|
+
limit?: number;
|
|
153
|
+
truncate?: boolean;
|
|
154
|
+
cascade?: boolean;
|
|
155
|
+
restartIdentity?: boolean;
|
|
156
|
+
returning?: boolean;
|
|
157
|
+
force?: boolean;
|
|
158
|
+
using?: import('./join-source-builder.ts').JoinSources;
|
|
159
|
+
}> & Readonly<{
|
|
160
|
+
hooks?: boolean;
|
|
161
|
+
individualHooks?: boolean;
|
|
162
|
+
}> & Readonly<{
|
|
163
|
+
returning: true;
|
|
164
|
+
}>): Promise<M[]>;
|
|
165
|
+
destroy<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: import('./bulk-options.ts').DestroyOptions<import('./options.ts').Attributes<M>> | undefined): Promise<number>;
|
|
166
|
+
restore<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: import('./bulk-options.ts').RestoreOptions<import('./options.ts').Attributes<M>>): Promise<void>;
|
|
167
|
+
increment<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, fields: import('./write-options.ts').AttributeAmounts<import('./options.ts').Attributes<M>>, options?: import('./write-options.ts').IncrementOptions<import('./options.ts').Attributes<M>>): Promise<[affectedRows: M[], affectedCount: number]>;
|
|
168
|
+
decrement<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, fields: import('./write-options.ts').AttributeAmounts<import('./options.ts').Attributes<M>>, options?: import('./write-options.ts').IncrementOptions<import('./options.ts').Attributes<M>>): Promise<[affectedRows: M[], affectedCount: number]>;
|
|
169
|
+
} & {
|
|
170
|
+
new (...args: any[]): {
|
|
171
|
+
get wasInserted(): boolean | undefined;
|
|
172
|
+
get oldValues(): Readonly<Record<string, unknown>> | null | undefined;
|
|
173
|
+
get sequelize(): import('./runtime.ts').RuntimeOwner;
|
|
174
|
+
};
|
|
175
|
+
aggregate<M extends import('./options.ts').AnyModel, T = unknown>(this: import('./options.ts').ModelStatic<M>, field: "*" | keyof import('./options.ts').Attributes<M>, aggregateFunction: string, options?: import('./find-options.ts').AggregateOptions<import('./options.ts').Attributes<M>>): Promise<T>;
|
|
176
|
+
max<M extends import('./options.ts').AnyModel, T = unknown>(this: import('./options.ts').ModelStatic<M>, field: keyof import('./options.ts').Attributes<M>, options?: import('./find-options.ts').AggregateOptions<import('./options.ts').Attributes<M>> | undefined): Promise<T>;
|
|
177
|
+
min<M extends import('./options.ts').AnyModel, T = unknown>(this: import('./options.ts').ModelStatic<M>, field: keyof import('./options.ts').Attributes<M>, options?: import('./find-options.ts').AggregateOptions<import('./options.ts').Attributes<M>> | undefined): Promise<T>;
|
|
178
|
+
sum<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, field: keyof import('./options.ts').Attributes<M>, options?: import('./find-options.ts').AggregateOptions<import('./options.ts').Attributes<M>> | undefined): Promise<number>;
|
|
179
|
+
} & {
|
|
180
|
+
new (...args: any[]): {
|
|
181
|
+
get wasInserted(): boolean | undefined;
|
|
182
|
+
get oldValues(): Readonly<Record<string, unknown>> | null | undefined;
|
|
183
|
+
get sequelize(): import('./runtime.ts').RuntimeOwner;
|
|
184
|
+
};
|
|
185
|
+
findAll<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: import('./find-options.ts').FindOptions<import('./options.ts').Attributes<M>>): Promise<M[]>;
|
|
186
|
+
findOne<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options: Readonly<{
|
|
187
|
+
transaction?: import('../exports-core.ts').Transaction | null;
|
|
188
|
+
logging?: import('../exports-core.ts').LoggingFunction | false;
|
|
189
|
+
benchmark?: boolean;
|
|
190
|
+
statementTimeout?: number;
|
|
191
|
+
useMaster?: boolean;
|
|
192
|
+
}> & Omit<Readonly<{
|
|
193
|
+
where?: unknown;
|
|
194
|
+
attributes?: import('./select-options.ts').FindAttributeOptions;
|
|
195
|
+
order?: import('./select-options.ts').Order;
|
|
196
|
+
group?: unknown;
|
|
197
|
+
having?: unknown;
|
|
198
|
+
limit?: number | null;
|
|
199
|
+
offset?: number | null;
|
|
200
|
+
lock?: import('./select-options.ts').LockOption;
|
|
201
|
+
skipLocked?: boolean;
|
|
202
|
+
noWait?: boolean;
|
|
203
|
+
distinctOn?: readonly unknown[];
|
|
204
|
+
withTies?: boolean;
|
|
205
|
+
sample?: Readonly<{
|
|
206
|
+
method: "BERNOULLI" | "SYSTEM";
|
|
207
|
+
percent: number;
|
|
208
|
+
seed?: number;
|
|
209
|
+
}>;
|
|
210
|
+
lateralKeys?: Readonly<{
|
|
211
|
+
attribute: string;
|
|
212
|
+
values: readonly unknown[];
|
|
213
|
+
}>;
|
|
214
|
+
fromQuery?: import('../sql/ast-statements.ts').QueryNode;
|
|
215
|
+
withClause?: Readonly<{
|
|
216
|
+
recursive: boolean;
|
|
217
|
+
ctes: readonly Readonly<{
|
|
218
|
+
name: string;
|
|
219
|
+
query: import('../sql/ast-statements.ts').QueryNode | import('../sql/ast-statements.ts').ModifyingNode;
|
|
220
|
+
materialized?: boolean;
|
|
221
|
+
search?: Readonly<{
|
|
222
|
+
mode: "BREADTH" | "DEPTH";
|
|
223
|
+
by: readonly string[];
|
|
224
|
+
set: string;
|
|
225
|
+
}>;
|
|
226
|
+
cycle?: Readonly<{
|
|
227
|
+
columns: readonly string[];
|
|
228
|
+
set: string;
|
|
229
|
+
using: string;
|
|
230
|
+
}>;
|
|
231
|
+
}>[];
|
|
232
|
+
}>;
|
|
233
|
+
extraFrom?: readonly import('../sql/ast-clauses.ts').FromItem[];
|
|
234
|
+
}>, "where"> & Readonly<{
|
|
235
|
+
where?: import('./where-options.ts').WhereOptions<import('./options.ts').Attributes<M>> | undefined;
|
|
236
|
+
raw?: boolean;
|
|
237
|
+
nest?: boolean;
|
|
238
|
+
plain?: boolean;
|
|
239
|
+
rejectOnEmpty?: boolean | Error;
|
|
240
|
+
paranoid?: boolean;
|
|
241
|
+
hooks?: boolean;
|
|
242
|
+
include?: import('../exports-schema.ts').IncludeOption;
|
|
243
|
+
subQuery?: boolean;
|
|
244
|
+
}> & Readonly<{
|
|
245
|
+
with?: Readonly<Record<string, import('../exports-core.ts').Subquery | import('../exports-core.ts').WriteStatement | Readonly<{
|
|
246
|
+
query: import('../exports-core.ts').Subquery | import('../exports-core.ts').WriteStatement;
|
|
247
|
+
recursive?: import('../exports-core.ts').Subquery;
|
|
248
|
+
unionAll?: boolean;
|
|
249
|
+
materialized?: boolean;
|
|
250
|
+
search?: Readonly<{
|
|
251
|
+
by: readonly string[];
|
|
252
|
+
mode?: "breadth" | "depth";
|
|
253
|
+
set: string;
|
|
254
|
+
}>;
|
|
255
|
+
cycle?: Readonly<{
|
|
256
|
+
columns: readonly string[];
|
|
257
|
+
set: string;
|
|
258
|
+
using: string;
|
|
259
|
+
}>;
|
|
260
|
+
}>>>;
|
|
261
|
+
source?: string | import('../exports-core.ts').Subquery;
|
|
262
|
+
from?: import('./join-source-builder.ts').JoinSources;
|
|
263
|
+
}> & Readonly<{
|
|
264
|
+
rejectOnEmpty: true | Error;
|
|
265
|
+
}>): Promise<M>;
|
|
266
|
+
findOne<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: import('./find-options.ts').FindOptions<import('./options.ts').Attributes<M>> | undefined): Promise<M | null>;
|
|
267
|
+
findByPk<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, key: unknown, options?: Omit<import('./find-options.ts').FindOptions<import('./options.ts').Attributes<M>>, "where">): Promise<M | null>;
|
|
268
|
+
count<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: import('./find-options.ts').CountOptions<import('./options.ts').Attributes<M>>): Promise<number>;
|
|
269
|
+
findAndCountAll<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options?: import('./find-options.ts').FindOptions<import('./options.ts').Attributes<M>>): Promise<import('./find-options.ts').FindAndCountResult<M>>;
|
|
270
|
+
findOrCreate<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options: import('./find-options.ts').FindOrCreateOptions<import('./options.ts').Attributes<M>>): Promise<[M, boolean]>;
|
|
271
|
+
findOrBuild<M extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, options: import('./find-options.ts').FindOrCreateOptions<import('./options.ts').Attributes<M>>): Promise<[M, boolean]>;
|
|
272
|
+
} & {
|
|
273
|
+
new (...args: any[]): {
|
|
274
|
+
get wasInserted(): boolean | undefined;
|
|
275
|
+
get oldValues(): Readonly<Record<string, unknown>> | null | undefined;
|
|
276
|
+
get sequelize(): import('./runtime.ts').RuntimeOwner;
|
|
277
|
+
};
|
|
278
|
+
schema<MS extends import('./options.ts').ModelStatic<import('./options.ts').AnyModel>>(this: MS, schema: string, options?: string | Readonly<{
|
|
279
|
+
schemaDelimiter?: string;
|
|
280
|
+
}> | undefined): MS;
|
|
281
|
+
} & {
|
|
282
|
+
new (...args: any[]): {
|
|
283
|
+
get wasInserted(): boolean | undefined;
|
|
284
|
+
get oldValues(): Readonly<Record<string, unknown>> | null | undefined;
|
|
285
|
+
get sequelize(): import('./runtime.ts').RuntimeOwner;
|
|
286
|
+
};
|
|
287
|
+
scope<MS extends import('./options.ts').ModelStatic<import('./options.ts').AnyModel>>(this: MS, ...selectors: readonly (import('./scope-registry.ts').ScopeSelector | readonly import('./scope-registry.ts').ScopeSelector[])[]): MS;
|
|
288
|
+
unscoped<MS extends import('./options.ts').ModelStatic<import('./options.ts').AnyModel>>(this: MS): MS;
|
|
289
|
+
addScope(name: string, scope: import('./scope-registry.ts').ScopeDefinition, options?: Readonly<{
|
|
290
|
+
override?: boolean;
|
|
291
|
+
}>): void;
|
|
292
|
+
} & {
|
|
293
|
+
new (...args: any[]): {
|
|
294
|
+
get wasInserted(): boolean | undefined;
|
|
295
|
+
get oldValues(): Readonly<Record<string, unknown>> | null | undefined;
|
|
296
|
+
get sequelize(): import('./runtime.ts').RuntimeOwner;
|
|
297
|
+
};
|
|
298
|
+
beforeValidate: import('./model.ts').NamedHookAdder;
|
|
299
|
+
afterValidate: import('./model.ts').NamedHookAdder;
|
|
300
|
+
validationFailed: import('./model.ts').NamedHookAdder;
|
|
301
|
+
beforeCreate: import('./model.ts').NamedHookAdder;
|
|
302
|
+
afterCreate: import('./model.ts').NamedHookAdder;
|
|
303
|
+
beforeUpdate: import('./model.ts').NamedHookAdder;
|
|
304
|
+
afterUpdate: import('./model.ts').NamedHookAdder;
|
|
305
|
+
beforeSave: import('./model.ts').NamedHookAdder;
|
|
306
|
+
afterSave: import('./model.ts').NamedHookAdder;
|
|
307
|
+
beforeDestroy: import('./model.ts').NamedHookAdder;
|
|
308
|
+
afterDestroy: import('./model.ts').NamedHookAdder;
|
|
309
|
+
beforeRestore: import('./model.ts').NamedHookAdder;
|
|
310
|
+
afterRestore: import('./model.ts').NamedHookAdder;
|
|
311
|
+
beforeUpsert: import('./model.ts').NamedHookAdder;
|
|
312
|
+
afterUpsert: import('./model.ts').NamedHookAdder;
|
|
313
|
+
beforeBulkCreate: import('./model.ts').NamedHookAdder;
|
|
314
|
+
afterBulkCreate: import('./model.ts').NamedHookAdder;
|
|
315
|
+
beforeBulkUpdate: import('./model.ts').NamedHookAdder;
|
|
316
|
+
afterBulkUpdate: import('./model.ts').NamedHookAdder;
|
|
317
|
+
beforeBulkDestroy: import('./model.ts').NamedHookAdder;
|
|
318
|
+
afterBulkDestroy: import('./model.ts').NamedHookAdder;
|
|
319
|
+
beforeBulkRestore: import('./model.ts').NamedHookAdder;
|
|
320
|
+
afterBulkRestore: import('./model.ts').NamedHookAdder;
|
|
321
|
+
beforeFind: import('./model.ts').NamedHookAdder;
|
|
322
|
+
beforeFindAfterExpandIncludeAll: import('./model.ts').NamedHookAdder;
|
|
323
|
+
beforeFindAfterOptions: import('./model.ts').NamedHookAdder;
|
|
324
|
+
afterFind: import('./model.ts').NamedHookAdder;
|
|
325
|
+
beforeCount: import('./model.ts').NamedHookAdder;
|
|
326
|
+
addHook<MS extends import('./options.ts').ModelStatic<import('./options.ts').AnyModel>>(this: MS, type: import('../exports-model.ts').HookType, nameOrFn: string | import('../exports-model.ts').HookFunction, fn?: import('../exports-model.ts').HookFunction): MS;
|
|
327
|
+
removeHook<MS extends import('./options.ts').ModelStatic<import('./options.ts').AnyModel>>(this: MS, type: import('../exports-model.ts').HookType, nameOrFn?: string | import('../exports-model.ts').HookFunction): MS;
|
|
328
|
+
hasHook(type: import('../exports-model.ts').HookType): boolean;
|
|
329
|
+
hasHooks(type: import('../exports-model.ts').HookType): boolean;
|
|
330
|
+
runHooks(type: import('../exports-model.ts').HookType, ...args: readonly unknown[]): Promise<void>;
|
|
331
|
+
} & {
|
|
332
|
+
new (...args: any[]): {
|
|
333
|
+
get wasInserted(): boolean | undefined;
|
|
334
|
+
get oldValues(): Readonly<Record<string, unknown>> | null | undefined;
|
|
335
|
+
get sequelize(): import('./runtime.ts').RuntimeOwner;
|
|
336
|
+
};
|
|
337
|
+
sync<MS extends import('./options.ts').ModelStatic<import('./options.ts').AnyModel>>(this: MS, options?: import('../exports-schema.ts').SyncOptions): Promise<MS>;
|
|
338
|
+
drop(options?: import('../exports-schema.ts').DropOptions): Promise<void>;
|
|
339
|
+
truncate(options?: Readonly<{
|
|
340
|
+
transaction?: import('../exports-core.ts').Transaction | null;
|
|
341
|
+
logging?: import('../exports-core.ts').LoggingFunction | false;
|
|
342
|
+
benchmark?: boolean;
|
|
343
|
+
statementTimeout?: number;
|
|
344
|
+
useMaster?: boolean;
|
|
345
|
+
}> & Readonly<{
|
|
346
|
+
cascade?: boolean;
|
|
347
|
+
restartIdentity?: boolean;
|
|
348
|
+
}>): Promise<void>;
|
|
349
|
+
} & {
|
|
350
|
+
new (...args: any[]): {
|
|
351
|
+
get wasInserted(): boolean | undefined;
|
|
352
|
+
get oldValues(): Readonly<Record<string, unknown>> | null | undefined;
|
|
353
|
+
get sequelize(): import('./runtime.ts').RuntimeOwner;
|
|
354
|
+
};
|
|
355
|
+
get associations(): Readonly<Record<string, Readonly<{
|
|
356
|
+
associationType: import('../exports-schema.ts').AssociationType;
|
|
357
|
+
source: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
358
|
+
target: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
359
|
+
as: string;
|
|
360
|
+
name: Readonly<{
|
|
361
|
+
singular: string;
|
|
362
|
+
plural: string;
|
|
363
|
+
}>;
|
|
364
|
+
isAliased: boolean;
|
|
365
|
+
foreignKey: string;
|
|
366
|
+
identifierField: string;
|
|
367
|
+
sourceKey: string;
|
|
368
|
+
targetKey: string;
|
|
369
|
+
otherKey: string | undefined;
|
|
370
|
+
through: Readonly<{
|
|
371
|
+
model: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
372
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
373
|
+
}> | undefined;
|
|
374
|
+
scope: Readonly<Record<string, unknown>> | undefined;
|
|
375
|
+
isSingleAssociation: boolean;
|
|
376
|
+
isMultiAssociation: boolean;
|
|
377
|
+
accessors: Readonly<Record<string, string>>;
|
|
378
|
+
}>>>;
|
|
379
|
+
belongsTo<M extends import('./options.ts').AnyModel, T extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, target: import('./options.ts').ModelStatic<T>, options?: Readonly<{
|
|
380
|
+
as?: string | Readonly<{
|
|
381
|
+
singular: string;
|
|
382
|
+
plural: string;
|
|
383
|
+
}>;
|
|
384
|
+
foreignKey?: string | Readonly<{
|
|
385
|
+
name?: string;
|
|
386
|
+
field?: string;
|
|
387
|
+
allowNull?: boolean;
|
|
388
|
+
}>;
|
|
389
|
+
sourceKey?: string;
|
|
390
|
+
targetKey?: string;
|
|
391
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
392
|
+
constraints?: boolean;
|
|
393
|
+
onDelete?: string;
|
|
394
|
+
onUpdate?: string;
|
|
395
|
+
}> | undefined): Readonly<{
|
|
396
|
+
associationType: import('../exports-schema.ts').AssociationType;
|
|
397
|
+
source: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
398
|
+
target: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
399
|
+
as: string;
|
|
400
|
+
name: Readonly<{
|
|
401
|
+
singular: string;
|
|
402
|
+
plural: string;
|
|
403
|
+
}>;
|
|
404
|
+
isAliased: boolean;
|
|
405
|
+
foreignKey: string;
|
|
406
|
+
identifierField: string;
|
|
407
|
+
sourceKey: string;
|
|
408
|
+
targetKey: string;
|
|
409
|
+
otherKey: string | undefined;
|
|
410
|
+
through: Readonly<{
|
|
411
|
+
model: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
412
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
413
|
+
}> | undefined;
|
|
414
|
+
scope: Readonly<Record<string, unknown>> | undefined;
|
|
415
|
+
isSingleAssociation: boolean;
|
|
416
|
+
isMultiAssociation: boolean;
|
|
417
|
+
accessors: Readonly<Record<string, string>>;
|
|
418
|
+
}>;
|
|
419
|
+
hasOne<M extends import('./options.ts').AnyModel, T extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, target: import('./options.ts').ModelStatic<T>, options?: Readonly<{
|
|
420
|
+
as?: string | Readonly<{
|
|
421
|
+
singular: string;
|
|
422
|
+
plural: string;
|
|
423
|
+
}>;
|
|
424
|
+
foreignKey?: string | Readonly<{
|
|
425
|
+
name?: string;
|
|
426
|
+
field?: string;
|
|
427
|
+
allowNull?: boolean;
|
|
428
|
+
}>;
|
|
429
|
+
sourceKey?: string;
|
|
430
|
+
targetKey?: string;
|
|
431
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
432
|
+
constraints?: boolean;
|
|
433
|
+
onDelete?: string;
|
|
434
|
+
onUpdate?: string;
|
|
435
|
+
}> | undefined): Readonly<{
|
|
436
|
+
associationType: import('../exports-schema.ts').AssociationType;
|
|
437
|
+
source: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
438
|
+
target: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
439
|
+
as: string;
|
|
440
|
+
name: Readonly<{
|
|
441
|
+
singular: string;
|
|
442
|
+
plural: string;
|
|
443
|
+
}>;
|
|
444
|
+
isAliased: boolean;
|
|
445
|
+
foreignKey: string;
|
|
446
|
+
identifierField: string;
|
|
447
|
+
sourceKey: string;
|
|
448
|
+
targetKey: string;
|
|
449
|
+
otherKey: string | undefined;
|
|
450
|
+
through: Readonly<{
|
|
451
|
+
model: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
452
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
453
|
+
}> | undefined;
|
|
454
|
+
scope: Readonly<Record<string, unknown>> | undefined;
|
|
455
|
+
isSingleAssociation: boolean;
|
|
456
|
+
isMultiAssociation: boolean;
|
|
457
|
+
accessors: Readonly<Record<string, string>>;
|
|
458
|
+
}>;
|
|
459
|
+
hasMany<M extends import('./options.ts').AnyModel, T extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, target: import('./options.ts').ModelStatic<T>, options?: Readonly<{
|
|
460
|
+
as?: string | Readonly<{
|
|
461
|
+
singular: string;
|
|
462
|
+
plural: string;
|
|
463
|
+
}>;
|
|
464
|
+
foreignKey?: string | Readonly<{
|
|
465
|
+
name?: string;
|
|
466
|
+
field?: string;
|
|
467
|
+
allowNull?: boolean;
|
|
468
|
+
}>;
|
|
469
|
+
sourceKey?: string;
|
|
470
|
+
targetKey?: string;
|
|
471
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
472
|
+
constraints?: boolean;
|
|
473
|
+
onDelete?: string;
|
|
474
|
+
onUpdate?: string;
|
|
475
|
+
}> | undefined): Readonly<{
|
|
476
|
+
associationType: import('../exports-schema.ts').AssociationType;
|
|
477
|
+
source: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
478
|
+
target: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
479
|
+
as: string;
|
|
480
|
+
name: Readonly<{
|
|
481
|
+
singular: string;
|
|
482
|
+
plural: string;
|
|
483
|
+
}>;
|
|
484
|
+
isAliased: boolean;
|
|
485
|
+
foreignKey: string;
|
|
486
|
+
identifierField: string;
|
|
487
|
+
sourceKey: string;
|
|
488
|
+
targetKey: string;
|
|
489
|
+
otherKey: string | undefined;
|
|
490
|
+
through: Readonly<{
|
|
491
|
+
model: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
492
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
493
|
+
}> | undefined;
|
|
494
|
+
scope: Readonly<Record<string, unknown>> | undefined;
|
|
495
|
+
isSingleAssociation: boolean;
|
|
496
|
+
isMultiAssociation: boolean;
|
|
497
|
+
accessors: Readonly<Record<string, string>>;
|
|
498
|
+
}>;
|
|
499
|
+
belongsToMany<M extends import('./options.ts').AnyModel, T extends import('./options.ts').AnyModel>(this: import('./options.ts').ModelStatic<M>, target: import('./options.ts').ModelStatic<T>, options: import('../exports-schema.ts').BelongsToManyOptions): Readonly<{
|
|
500
|
+
associationType: import('../exports-schema.ts').AssociationType;
|
|
501
|
+
source: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
502
|
+
target: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
503
|
+
as: string;
|
|
504
|
+
name: Readonly<{
|
|
505
|
+
singular: string;
|
|
506
|
+
plural: string;
|
|
507
|
+
}>;
|
|
508
|
+
isAliased: boolean;
|
|
509
|
+
foreignKey: string;
|
|
510
|
+
identifierField: string;
|
|
511
|
+
sourceKey: string;
|
|
512
|
+
targetKey: string;
|
|
513
|
+
otherKey: string | undefined;
|
|
514
|
+
through: Readonly<{
|
|
515
|
+
model: import('./options.ts').ModelStatic<import('./options.ts').AnyModel>;
|
|
516
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
517
|
+
}> | undefined;
|
|
518
|
+
scope: Readonly<Record<string, unknown>> | undefined;
|
|
519
|
+
isSingleAssociation: boolean;
|
|
520
|
+
isMultiAssociation: boolean;
|
|
521
|
+
accessors: Readonly<Record<string, string>>;
|
|
522
|
+
}>;
|
|
523
|
+
} & typeof ModelBase;
|
|
524
|
+
export interface Model<TAttributes extends object = Values, TCreationAttributes extends object = TAttributes> extends ModelInstanceValues<TAttributes>, ModelInstancePersistence<TAttributes> {
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Base class of models, API-compatible with Sequelize v6 `Model`.
|
|
528
|
+
*
|
|
529
|
+
* @typeParam TAttributes - Attribute types (usually `InferAttributes<M>`).
|
|
530
|
+
* @typeParam TCreationAttributes - Attribute types accepted on creation (usually `InferCreationAttributes<M>`).
|
|
531
|
+
* @example
|
|
532
|
+
* ```ts
|
|
533
|
+
* class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
|
|
534
|
+
* declare id: CreationOptional<number>;
|
|
535
|
+
* declare email: string;
|
|
536
|
+
* }
|
|
537
|
+
* User.init({ id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true }, email: DataTypes.STRING }, { sequelize });
|
|
538
|
+
* ```
|
|
539
|
+
*/
|
|
540
|
+
export declare class Model<TAttributes extends object = Values, TCreationAttributes extends object = TAttributes> extends ModelStatics {
|
|
541
|
+
/** Phantom type of attributes; not set at runtime. */
|
|
542
|
+
_attributes: TAttributes;
|
|
543
|
+
/** Phantom type of creation attributes; not set at runtime. */
|
|
544
|
+
_creationAttributes: TCreationAttributes;
|
|
545
|
+
/** Current attribute values. */
|
|
546
|
+
dataValues: TAttributes;
|
|
547
|
+
/** Values as of the last load/save. */
|
|
548
|
+
_previousDataValues: Partial<TAttributes>;
|
|
549
|
+
/** True until the instance is saved or when built from a query result. */
|
|
550
|
+
isNewRecord: boolean;
|
|
551
|
+
/** Model class of the instance. */
|
|
552
|
+
get _model(): typeof Model;
|
|
553
|
+
/**
|
|
554
|
+
* Builds an instance without saving it. Prefer `Model.build`.
|
|
555
|
+
*
|
|
556
|
+
* @param values - Attribute values.
|
|
557
|
+
* @param options - Build options.
|
|
558
|
+
*/
|
|
559
|
+
constructor(values?: Partial<TCreationAttributes> | Values, options?: BuildOptions);
|
|
560
|
+
}
|