@rvoh/dream 1.7.3 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -2
- package/dist/cjs/src/db/errors.js +4 -1
- package/dist/cjs/src/dream/QueryDriver/Kysely.js +6 -0
- package/dist/cjs/src/errors/db/CheckConstraintViolation.js +2 -11
- package/dist/cjs/src/errors/db/ColumnOverflow.js +6 -0
- package/dist/cjs/src/errors/db/DataIncompatibleWithDatabaseField.js +15 -0
- package/dist/cjs/src/errors/db/DataTypeColumnTypeMismatch.js +2 -11
- package/dist/cjs/src/errors/db/NotNullViolation.js +2 -11
- package/dist/cjs/src/helpers/cli/SchemaBuilder.js +4 -0
- package/dist/cjs/src/index.js +6 -2
- package/dist/esm/src/db/errors.js +3 -0
- package/dist/esm/src/dream/QueryDriver/Kysely.js +7 -1
- package/dist/esm/src/errors/db/CheckConstraintViolation.js +2 -11
- package/dist/esm/src/errors/db/ColumnOverflow.js +3 -0
- package/dist/esm/src/errors/db/DataIncompatibleWithDatabaseField.js +12 -0
- package/dist/esm/src/errors/db/DataTypeColumnTypeMismatch.js +2 -11
- package/dist/esm/src/errors/db/NotNullViolation.js +2 -11
- package/dist/esm/src/helpers/cli/SchemaBuilder.js +4 -0
- package/dist/esm/src/index.js +2 -0
- package/dist/types/src/db/errors.d.ts +3 -0
- package/dist/types/src/errors/db/CheckConstraintViolation.d.ts +2 -9
- package/dist/types/src/errors/db/ColumnOverflow.d.ts +3 -0
- package/dist/types/src/errors/db/DataIncompatibleWithDatabaseField.d.ts +10 -0
- package/dist/types/src/errors/db/DataTypeColumnTypeMismatch.d.ts +2 -9
- package/dist/types/src/errors/db/NotNullViolation.d.ts +2 -9
- package/dist/types/src/helpers/cli/SchemaBuilder.d.ts +2 -1
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/types/dream.d.ts +4 -2
- package/dist/types/src/types/dream.ts +23 -7
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Benchmark.html +2 -2
- package/docs/classes/CalendarDate.html +2 -2
- package/docs/classes/CheckConstraintViolation.html +7 -7
- package/docs/classes/CliFileWriter.html +2 -2
- package/docs/classes/ColumnOverflow.html +14 -0
- package/docs/classes/CreateOrFindByFailedToCreateAndFind.html +3 -3
- package/docs/classes/DataIncompatibleWithDatabaseField.html +14 -0
- package/docs/classes/DataTypeColumnTypeMismatch.html +7 -7
- package/docs/classes/Decorators.html +19 -19
- package/docs/classes/Dream.html +113 -113
- package/docs/classes/DreamApp.html +4 -4
- package/docs/classes/DreamBin.html +2 -2
- package/docs/classes/DreamCLI.html +4 -4
- package/docs/classes/DreamImporter.html +2 -2
- package/docs/classes/DreamLogos.html +2 -2
- package/docs/classes/DreamMigrationHelpers.html +8 -8
- package/docs/classes/DreamSerializerBuilder.html +8 -8
- package/docs/classes/DreamTransaction.html +2 -2
- package/docs/classes/Encrypt.html +2 -2
- package/docs/classes/Env.html +2 -2
- package/docs/classes/GlobalNameNotSet.html +3 -3
- package/docs/classes/KyselyQueryDriver.html +30 -30
- package/docs/classes/MissingSerializersDefinition.html +3 -3
- package/docs/classes/NonLoadedAssociation.html +3 -3
- package/docs/classes/NotNullViolation.html +7 -7
- package/docs/classes/ObjectSerializerBuilder.html +8 -8
- package/docs/classes/PostgresQueryDriver.html +31 -31
- package/docs/classes/Query.html +53 -53
- package/docs/classes/QueryDriverBase.html +29 -29
- package/docs/classes/Range.html +2 -2
- package/docs/classes/RecordNotFound.html +3 -3
- package/docs/classes/ValidationError.html +3 -3
- package/docs/functions/DreamSerializer.html +1 -1
- package/docs/functions/ObjectSerializer.html +1 -1
- package/docs/functions/ReplicaSafe.html +1 -1
- package/docs/functions/STI.html +1 -1
- package/docs/functions/SoftDelete.html +1 -1
- package/docs/functions/camelize.html +1 -1
- package/docs/functions/capitalize.html +1 -1
- package/docs/functions/cloneDeepSafe.html +1 -1
- package/docs/functions/closeAllDbConnections.html +1 -1
- package/docs/functions/compact.html +1 -1
- package/docs/functions/dreamDbConnections.html +1 -1
- package/docs/functions/dreamPath.html +1 -1
- package/docs/functions/expandStiClasses.html +1 -1
- package/docs/functions/generateDream.html +1 -1
- package/docs/functions/globalClassNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/groupBy.html +1 -1
- package/docs/functions/hyphenize.html +1 -1
- package/docs/functions/inferSerializerFromDreamOrViewModel.html +1 -1
- package/docs/functions/inferSerializersFromDreamClassOrViewModelClass.html +1 -1
- package/docs/functions/intersection.html +1 -1
- package/docs/functions/isDreamSerializer.html +1 -1
- package/docs/functions/isEmpty.html +1 -1
- package/docs/functions/loadRepl.html +1 -1
- package/docs/functions/lookupClassByGlobalName.html +1 -1
- package/docs/functions/normalizeUnicode.html +1 -1
- package/docs/functions/pascalize.html +1 -1
- package/docs/functions/pgErrorType.html +1 -1
- package/docs/functions/range-1.html +1 -1
- package/docs/functions/relativeDreamPath.html +1 -1
- package/docs/functions/round.html +1 -1
- package/docs/functions/serializerNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/sharedPathPrefix.html +1 -1
- package/docs/functions/snakeify.html +1 -1
- package/docs/functions/sort.html +1 -1
- package/docs/functions/sortBy.html +1 -1
- package/docs/functions/sortObjectByKey.html +1 -1
- package/docs/functions/sortObjectByValue.html +1 -1
- package/docs/functions/standardizeFullyQualifiedModelName.html +1 -1
- package/docs/functions/uncapitalize.html +1 -1
- package/docs/functions/uniq.html +1 -1
- package/docs/functions/untypedDb.html +1 -1
- package/docs/functions/validateColumn.html +1 -1
- package/docs/functions/validateTable.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/BelongsToStatement.html +2 -2
- package/docs/interfaces/DecoratorContext.html +2 -2
- package/docs/interfaces/DreamAppInitOptions.html +2 -2
- package/docs/interfaces/DreamAppOpts.html +2 -2
- package/docs/interfaces/EncryptOptions.html +2 -2
- package/docs/interfaces/InternalAnyTypedSerializerRendersMany.html +2 -2
- package/docs/interfaces/InternalAnyTypedSerializerRendersOne.html +2 -2
- package/docs/interfaces/OpenapiDescription.html +2 -2
- package/docs/interfaces/OpenapiSchemaProperties.html +1 -1
- package/docs/interfaces/OpenapiSchemaPropertiesShorthand.html +1 -1
- package/docs/interfaces/OpenapiTypeFieldObject.html +1 -1
- package/docs/interfaces/SerializerRendererOpts.html +2 -2
- package/docs/modules.html +2 -0
- package/docs/types/Camelized.html +1 -1
- package/docs/types/CommonOpenapiSchemaObjectFields.html +1 -1
- package/docs/types/DateTime.html +1 -1
- package/docs/types/DbConnectionType.html +1 -1
- package/docs/types/DbTypes.html +1 -1
- package/docs/types/DreamAppAllowedPackageManagersEnum.html +1 -1
- package/docs/types/DreamAssociationMetadata.html +1 -1
- package/docs/types/DreamAttributes.html +1 -1
- package/docs/types/DreamClassAssociationAndStatement.html +1 -1
- package/docs/types/DreamClassColumn.html +1 -1
- package/docs/types/DreamColumn.html +1 -1
- package/docs/types/DreamColumnNames.html +1 -1
- package/docs/types/DreamLogLevel.html +1 -1
- package/docs/types/DreamLogger.html +1 -1
- package/docs/types/DreamModelSerializerType.html +1 -1
- package/docs/types/DreamOrViewModelClassSerializerKey.html +1 -1
- package/docs/types/DreamOrViewModelSerializerKey.html +1 -1
- package/docs/types/DreamParamSafeAttributes.html +1 -1
- package/docs/types/DreamParamSafeColumnNames.html +1 -1
- package/docs/types/DreamSerializable.html +1 -1
- package/docs/types/DreamSerializableArray.html +1 -1
- package/docs/types/DreamSerializerKey.html +1 -1
- package/docs/types/DreamSerializers.html +1 -1
- package/docs/types/DreamVirtualColumns.html +1 -1
- package/docs/types/EncryptAlgorithm.html +1 -1
- package/docs/types/HasManyStatement.html +1 -1
- package/docs/types/HasOneStatement.html +1 -1
- package/docs/types/Hyphenized.html +1 -1
- package/docs/types/OpenapiAllTypes.html +1 -1
- package/docs/types/OpenapiFormats.html +1 -1
- package/docs/types/OpenapiNumberFormats.html +1 -1
- package/docs/types/OpenapiPrimitiveBaseTypes.html +1 -1
- package/docs/types/OpenapiPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiSchemaArray.html +1 -1
- package/docs/types/OpenapiSchemaArrayShorthand.html +1 -1
- package/docs/types/OpenapiSchemaBase.html +1 -1
- package/docs/types/OpenapiSchemaBody.html +1 -1
- package/docs/types/OpenapiSchemaBodyShorthand.html +1 -1
- package/docs/types/OpenapiSchemaCommonFields.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRef.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
- package/docs/types/OpenapiSchemaInteger.html +1 -1
- package/docs/types/OpenapiSchemaNull.html +1 -1
- package/docs/types/OpenapiSchemaNumber.html +1 -1
- package/docs/types/OpenapiSchemaObject.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectBase.html +1 -1
- package/docs/types/OpenapiSchemaObjectBaseShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectShorthand.html +1 -1
- package/docs/types/OpenapiSchemaPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaString.html +1 -1
- package/docs/types/OpenapiShorthandAllTypes.html +1 -1
- package/docs/types/OpenapiShorthandPrimitiveBaseTypes.html +1 -1
- package/docs/types/OpenapiShorthandPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiTypeField.html +1 -1
- package/docs/types/Pascalized.html +1 -1
- package/docs/types/RoundingPrecision.html +1 -1
- package/docs/types/SerializerCasing.html +1 -1
- package/docs/types/SimpleObjectSerializerType.html +1 -1
- package/docs/types/Snakeified.html +1 -1
- package/docs/types/UpdateableAssociationProperties.html +1 -1
- package/docs/types/UpdateableProperties.html +1 -1
- package/docs/types/ValidationType.html +1 -1
- package/docs/types/ViewModel.html +1 -1
- package/docs/types/ViewModelClass.html +1 -1
- package/docs/types/WhereStatementForDream.html +1 -1
- package/docs/types/WhereStatementForDreamClass.html +1 -1
- package/docs/variables/DateTime-1.html +1 -1
- package/docs/variables/DreamAppAllowedPackageManagersEnumValues.html +1 -1
- package/docs/variables/DreamConst.html +1 -1
- package/docs/variables/TRIGRAM_OPERATORS.html +1 -1
- package/docs/variables/openapiPrimitiveTypes-1.html +1 -1
- package/docs/variables/openapiShorthandPrimitiveTypes-1.html +1 -1
- package/docs/variables/ops.html +1 -1
- package/docs/variables/primaryKeyTypes.html +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
## 1.9.0
|
|
2
|
+
|
|
3
|
+
Fix broken param safe type columns so that:
|
|
4
|
+
|
|
5
|
+
1. polymorphic type fields are excluded from param safe types
|
|
6
|
+
2. association names are excluded
|
|
7
|
+
|
|
8
|
+
Bumping minor, since it could introduce breaking changes for those reliant on previous param safe behavior.
|
|
9
|
+
|
|
10
|
+
## 1.8.0
|
|
11
|
+
|
|
12
|
+
- throw ColumnOverflow when saving too long a string / number to a database column
|
|
13
|
+
- make all of these errors extend the same error so Psychic can check a single error type when deciding to return 400
|
|
14
|
+
|
|
1
15
|
## 1.7.3
|
|
2
16
|
|
|
3
|
-
remove unnecessary token, now that we are open-sourced
|
|
17
|
+
- remove unnecessary token, now that we are open-sourced
|
|
4
18
|
|
|
5
19
|
## 1.7.2
|
|
6
20
|
|
|
7
|
-
|
|
21
|
+
- fix issue causing generators to generate invalid uuid primary keys
|
|
8
22
|
|
|
9
23
|
## 1.7.1
|
|
10
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PG_ERRORS = exports.UNIQUE_VIOLATION = exports.RESTRICT_VIOLATION = exports.NOT_NULL_VIOLATION = exports.INVALID_INPUT_SYNTAX = exports.INTEGRITY_CONSTRAINT_VIOLATION = exports.FOREIGN_KEY_VIOLATION = exports.CHECK_VIOLATION = void 0;
|
|
3
|
+
exports.PG_ERRORS = exports.UNIQUE_VIOLATION = exports.RESTRICT_VIOLATION = exports.NOT_NULL_VIOLATION = exports.COLUMN_OVERFLOW = exports.INVALID_INPUT_SYNTAX = exports.INTEGRITY_CONSTRAINT_VIOLATION = exports.FOREIGN_KEY_VIOLATION = exports.CHECK_VIOLATION = void 0;
|
|
4
4
|
exports.pgErrorType = pgErrorType;
|
|
5
5
|
// after building for esm, importing pg using the following:
|
|
6
6
|
//
|
|
@@ -15,10 +15,13 @@ exports.CHECK_VIOLATION = 'CHECK_VIOLATION';
|
|
|
15
15
|
exports.FOREIGN_KEY_VIOLATION = 'FOREIGN_KEY_VIOLATION';
|
|
16
16
|
exports.INTEGRITY_CONSTRAINT_VIOLATION = 'INTEGRITY_CONSTRAINT_VIOLATION';
|
|
17
17
|
exports.INVALID_INPUT_SYNTAX = 'INVALID_INPUT_SYNTAX';
|
|
18
|
+
exports.COLUMN_OVERFLOW = 'COLUMN_OVERFLOW';
|
|
18
19
|
exports.NOT_NULL_VIOLATION = 'NOT_NULL_VIOLATION';
|
|
19
20
|
exports.RESTRICT_VIOLATION = 'RESTRICT_VIOLATION';
|
|
20
21
|
exports.UNIQUE_VIOLATION = 'UNIQUE_VIOLATION';
|
|
21
22
|
exports.PG_ERRORS = {
|
|
23
|
+
'22001': exports.COLUMN_OVERFLOW,
|
|
24
|
+
'22003': exports.COLUMN_OVERFLOW,
|
|
22
25
|
'23505': exports.UNIQUE_VIOLATION,
|
|
23
26
|
'22007': exports.INVALID_INPUT_SYNTAX,
|
|
24
27
|
'22P02': exports.INVALID_INPUT_SYNTAX,
|
|
@@ -30,6 +30,7 @@ const ThroughAssociationConditionsIncompatibleWithThroughAssociationSource_js_1
|
|
|
30
30
|
const CannotNegateSimilarityClause_js_1 = require("../../errors/CannotNegateSimilarityClause.js");
|
|
31
31
|
const CannotPassUndefinedAsAValueToAWhereClause_js_1 = require("../../errors/CannotPassUndefinedAsAValueToAWhereClause.js");
|
|
32
32
|
const CheckConstraintViolation_js_1 = require("../../errors/db/CheckConstraintViolation.js");
|
|
33
|
+
const ColumnOverflow_js_1 = require("../../errors/db/ColumnOverflow.js");
|
|
33
34
|
const DataTypeColumnTypeMismatch_js_1 = require("../../errors/db/DataTypeColumnTypeMismatch.js");
|
|
34
35
|
const NotNullViolation_js_1 = require("../../errors/db/NotNullViolation.js");
|
|
35
36
|
const UnexpectedUndefined_js_1 = require("../../errors/UnexpectedUndefined.js");
|
|
@@ -567,6 +568,11 @@ class KyselyQueryDriver extends Base_js_1.default {
|
|
|
567
568
|
}
|
|
568
569
|
catch (error) {
|
|
569
570
|
switch ((0, errors_js_1.pgErrorType)(error)) {
|
|
571
|
+
case errors_js_1.COLUMN_OVERFLOW:
|
|
572
|
+
throw new ColumnOverflow_js_1.default({
|
|
573
|
+
dream,
|
|
574
|
+
error: error instanceof Error ? error : new Error('database column overflow'),
|
|
575
|
+
});
|
|
570
576
|
case errors_js_1.INVALID_INPUT_SYNTAX:
|
|
571
577
|
throw new DataTypeColumnTypeMismatch_js_1.default({
|
|
572
578
|
dream,
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
error;
|
|
6
|
-
constructor({ dream, error }) {
|
|
7
|
-
super();
|
|
8
|
-
this.dream = dream;
|
|
9
|
-
this.error = error;
|
|
10
|
-
}
|
|
11
|
-
get message() {
|
|
12
|
-
return this.error.message;
|
|
13
|
-
}
|
|
3
|
+
const DataIncompatibleWithDatabaseField_js_1 = require("./DataIncompatibleWithDatabaseField.js");
|
|
4
|
+
class CheckConstraintViolation extends DataIncompatibleWithDatabaseField_js_1.default {
|
|
14
5
|
}
|
|
15
6
|
exports.default = CheckConstraintViolation;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const DataIncompatibleWithDatabaseField_js_1 = require("./DataIncompatibleWithDatabaseField.js");
|
|
4
|
+
class ColumnOverflow extends DataIncompatibleWithDatabaseField_js_1.default {
|
|
5
|
+
}
|
|
6
|
+
exports.default = ColumnOverflow;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class DataIncompatibleWithDatabaseField extends Error {
|
|
4
|
+
dream;
|
|
5
|
+
error;
|
|
6
|
+
constructor({ dream, error }) {
|
|
7
|
+
super();
|
|
8
|
+
this.dream = dream;
|
|
9
|
+
this.error = error;
|
|
10
|
+
}
|
|
11
|
+
get message() {
|
|
12
|
+
return this.error.message;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = DataIncompatibleWithDatabaseField;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
error;
|
|
6
|
-
constructor({ dream, error }) {
|
|
7
|
-
super();
|
|
8
|
-
this.dream = dream;
|
|
9
|
-
this.error = error;
|
|
10
|
-
}
|
|
11
|
-
get message() {
|
|
12
|
-
return this.error.message;
|
|
13
|
-
}
|
|
3
|
+
const DataIncompatibleWithDatabaseField_js_1 = require("./DataIncompatibleWithDatabaseField.js");
|
|
4
|
+
class DataTypeColumnTypeMismatch extends DataIncompatibleWithDatabaseField_js_1.default {
|
|
14
5
|
}
|
|
15
6
|
exports.default = DataTypeColumnTypeMismatch;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
error;
|
|
6
|
-
constructor({ dream, error }) {
|
|
7
|
-
super();
|
|
8
|
-
this.dream = dream;
|
|
9
|
-
this.error = error;
|
|
10
|
-
}
|
|
11
|
-
get message() {
|
|
12
|
-
return this.error.message;
|
|
13
|
-
}
|
|
3
|
+
const DataIncompatibleWithDatabaseField_js_1 = require("./DataIncompatibleWithDatabaseField.js");
|
|
4
|
+
class NotNullViolation extends DataIncompatibleWithDatabaseField_js_1.default {
|
|
14
5
|
}
|
|
15
6
|
exports.default = NotNullViolation;
|
|
@@ -145,6 +145,7 @@ ${tableName}: {
|
|
|
145
145
|
return `${associationName}: {
|
|
146
146
|
type: '${associationMetadata.type}',
|
|
147
147
|
foreignKey: ${associationMetadata.foreignKey ? `'${associationMetadata.foreignKey}'` : 'null'},
|
|
148
|
+
foreignKeyTypeColumn: ${associationMetadata.foreignKeyTypeColumn ? `'${associationMetadata.foreignKeyTypeColumn}'` : 'null'},
|
|
148
149
|
tables: ${stringifyArray(associationMetadata.tables)},
|
|
149
150
|
optional: ${associationMetadata.optional},
|
|
150
151
|
requiredOnClauses: ${requiredOnClauses.length === 0 ? 'null' : stringifyArray(requiredOnClauses)},
|
|
@@ -269,6 +270,9 @@ may need to update the table getter in the corresponding Dream.
|
|
|
269
270
|
type: associationMetaData.type,
|
|
270
271
|
polymorphic: associationMetaData.polymorphic,
|
|
271
272
|
foreignKey,
|
|
273
|
+
foreignKeyTypeColumn: associationMetaData.polymorphic
|
|
274
|
+
? associationMetaData?.foreignKeyTypeField?.() || null
|
|
275
|
+
: null,
|
|
272
276
|
optional,
|
|
273
277
|
where,
|
|
274
278
|
};
|
package/dist/cjs/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.ObjectSerializerBuilder = exports.DreamSerializerBuilder = exports.ObjectSerializer = exports.DreamSerializer = exports.serializerNameFromFullyQualifiedModelName = exports.isDreamSerializer = exports.inferSerializersFromDreamClassOrViewModelClass = exports.inferSerializerFromDreamOrViewModel = exports.ops = exports.uniq = exports.uncapitalize = exports.expandStiClasses = exports.standardizeFullyQualifiedModelName = exports.sortObjectByValue = exports.sortObjectByKey = exports.sortBy = exports.sort = exports.snakeify = exports.round = exports.range = exports.Range = exports.sharedPathPrefix = exports.relativeDreamPath = exports.dreamPath = exports.pascalize = exports.normalizeUnicode = exports.loadRepl = exports.isEmpty = exports.intersection = void 0;
|
|
3
|
+
exports.globalClassNameFromFullyQualifiedModelName = exports.Env = exports.DreamLogos = exports.DateTime = exports.compact = exports.cloneDeepSafe = exports.generateDream = exports.capitalize = exports.camelize = exports.CalendarDate = exports.Benchmark = exports.ValidationError = exports.MissingSerializersDefinition = exports.RecordNotFound = exports.GlobalNameNotSet = exports.NotNullViolation = exports.DataTypeColumnTypeMismatch = exports.DataIncompatibleWithDatabaseField = exports.ColumnOverflow = exports.CheckConstraintViolation = exports.CreateOrFindByFailedToCreateAndFind = exports.NonLoadedAssociation = exports.Encrypt = exports.PostgresQueryDriver = exports.KyselyQueryDriver = exports.QueryDriverBase = exports.Query = exports.DreamTransaction = exports.openapiShorthandPrimitiveTypes = exports.openapiPrimitiveTypes = exports.DreamConst = exports.Dream = exports.DreamAppAllowedPackageManagersEnumValues = exports.DreamApp = exports.lookupClassByGlobalName = exports.DreamImporter = exports.Decorators = exports.STI = exports.SoftDelete = exports.ReplicaSafe = exports.validateTable = exports.validateColumn = exports.DreamMigrationHelpers = exports.untypedDb = exports.pgErrorType = exports.dreamDbConnections = exports.closeAllDbConnections = exports.DreamCLI = exports.CliFileWriter = exports.DreamBin = void 0;
|
|
4
|
+
exports.ObjectSerializerBuilder = exports.DreamSerializerBuilder = exports.ObjectSerializer = exports.DreamSerializer = exports.serializerNameFromFullyQualifiedModelName = exports.isDreamSerializer = exports.inferSerializersFromDreamClassOrViewModelClass = exports.inferSerializerFromDreamOrViewModel = exports.ops = exports.uniq = exports.uncapitalize = exports.expandStiClasses = exports.standardizeFullyQualifiedModelName = exports.sortObjectByValue = exports.sortObjectByKey = exports.sortBy = exports.sort = exports.snakeify = exports.round = exports.range = exports.Range = exports.sharedPathPrefix = exports.relativeDreamPath = exports.dreamPath = exports.pascalize = exports.normalizeUnicode = exports.loadRepl = exports.isEmpty = exports.intersection = exports.hyphenize = exports.groupBy = void 0;
|
|
5
5
|
var index_js_1 = require("./bin/index.js");
|
|
6
6
|
Object.defineProperty(exports, "DreamBin", { enumerable: true, get: function () { return index_js_1.default; } });
|
|
7
7
|
var CliFileWriter_js_1 = require("./cli/CliFileWriter.js");
|
|
@@ -60,6 +60,10 @@ var CreateOrFindByFailedToCreateAndFind_js_1 = require("./errors/CreateOrFindByF
|
|
|
60
60
|
Object.defineProperty(exports, "CreateOrFindByFailedToCreateAndFind", { enumerable: true, get: function () { return CreateOrFindByFailedToCreateAndFind_js_1.default; } });
|
|
61
61
|
var CheckConstraintViolation_js_1 = require("./errors/db/CheckConstraintViolation.js");
|
|
62
62
|
Object.defineProperty(exports, "CheckConstraintViolation", { enumerable: true, get: function () { return CheckConstraintViolation_js_1.default; } });
|
|
63
|
+
var ColumnOverflow_js_1 = require("./errors/db/ColumnOverflow.js");
|
|
64
|
+
Object.defineProperty(exports, "ColumnOverflow", { enumerable: true, get: function () { return ColumnOverflow_js_1.default; } });
|
|
65
|
+
var DataIncompatibleWithDatabaseField_js_1 = require("./errors/db/DataIncompatibleWithDatabaseField.js");
|
|
66
|
+
Object.defineProperty(exports, "DataIncompatibleWithDatabaseField", { enumerable: true, get: function () { return DataIncompatibleWithDatabaseField_js_1.default; } });
|
|
63
67
|
var DataTypeColumnTypeMismatch_js_1 = require("./errors/db/DataTypeColumnTypeMismatch.js");
|
|
64
68
|
Object.defineProperty(exports, "DataTypeColumnTypeMismatch", { enumerable: true, get: function () { return DataTypeColumnTypeMismatch_js_1.default; } });
|
|
65
69
|
var NotNullViolation_js_1 = require("./errors/db/NotNullViolation.js");
|
|
@@ -11,10 +11,13 @@ export const CHECK_VIOLATION = 'CHECK_VIOLATION';
|
|
|
11
11
|
export const FOREIGN_KEY_VIOLATION = 'FOREIGN_KEY_VIOLATION';
|
|
12
12
|
export const INTEGRITY_CONSTRAINT_VIOLATION = 'INTEGRITY_CONSTRAINT_VIOLATION';
|
|
13
13
|
export const INVALID_INPUT_SYNTAX = 'INVALID_INPUT_SYNTAX';
|
|
14
|
+
export const COLUMN_OVERFLOW = 'COLUMN_OVERFLOW';
|
|
14
15
|
export const NOT_NULL_VIOLATION = 'NOT_NULL_VIOLATION';
|
|
15
16
|
export const RESTRICT_VIOLATION = 'RESTRICT_VIOLATION';
|
|
16
17
|
export const UNIQUE_VIOLATION = 'UNIQUE_VIOLATION';
|
|
17
18
|
export const PG_ERRORS = {
|
|
19
|
+
'22001': COLUMN_OVERFLOW,
|
|
20
|
+
'22003': COLUMN_OVERFLOW,
|
|
18
21
|
'23505': UNIQUE_VIOLATION,
|
|
19
22
|
'22007': INVALID_INPUT_SYNTAX,
|
|
20
23
|
'22P02': INVALID_INPUT_SYNTAX,
|
|
@@ -11,7 +11,7 @@ import { PostgresDialect, sql, } from 'kysely';
|
|
|
11
11
|
import pluralize from 'pluralize-esm';
|
|
12
12
|
import { CliFileWriter } from '../../cli/CliFileWriter.js';
|
|
13
13
|
import DreamCLI from '../../cli/index.js';
|
|
14
|
-
import { CHECK_VIOLATION, INVALID_INPUT_SYNTAX, NOT_NULL_VIOLATION, pgErrorType } from '../../db/errors.js';
|
|
14
|
+
import { CHECK_VIOLATION, COLUMN_OVERFLOW, INVALID_INPUT_SYNTAX, NOT_NULL_VIOLATION, pgErrorType, } from '../../db/errors.js';
|
|
15
15
|
import syncDbTypesFiles from '../../db/helpers/syncDbTypesFiles.js';
|
|
16
16
|
import _db from '../../db/index.js';
|
|
17
17
|
import associationToGetterSetterProp from '../../decorators/field/association/associationToGetterSetterProp.js';
|
|
@@ -28,6 +28,7 @@ import ThroughAssociationConditionsIncompatibleWithThroughAssociationSource from
|
|
|
28
28
|
import CannotNegateSimilarityClause from '../../errors/CannotNegateSimilarityClause.js';
|
|
29
29
|
import CannotPassUndefinedAsAValueToAWhereClause from '../../errors/CannotPassUndefinedAsAValueToAWhereClause.js';
|
|
30
30
|
import CheckConstraintViolation from '../../errors/db/CheckConstraintViolation.js';
|
|
31
|
+
import ColumnOverflow from '../../errors/db/ColumnOverflow.js';
|
|
31
32
|
import DataTypeColumnTypeMismatch from '../../errors/db/DataTypeColumnTypeMismatch.js';
|
|
32
33
|
import NotNullViolation from '../../errors/db/NotNullViolation.js';
|
|
33
34
|
import UnexpectedUndefined from '../../errors/UnexpectedUndefined.js';
|
|
@@ -565,6 +566,11 @@ export default class KyselyQueryDriver extends QueryDriverBase {
|
|
|
565
566
|
}
|
|
566
567
|
catch (error) {
|
|
567
568
|
switch (pgErrorType(error)) {
|
|
569
|
+
case COLUMN_OVERFLOW:
|
|
570
|
+
throw new ColumnOverflow({
|
|
571
|
+
dream,
|
|
572
|
+
error: error instanceof Error ? error : new Error('database column overflow'),
|
|
573
|
+
});
|
|
568
574
|
case INVALID_INPUT_SYNTAX:
|
|
569
575
|
throw new DataTypeColumnTypeMismatch({
|
|
570
576
|
dream,
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
error;
|
|
4
|
-
constructor({ dream, error }) {
|
|
5
|
-
super();
|
|
6
|
-
this.dream = dream;
|
|
7
|
-
this.error = error;
|
|
8
|
-
}
|
|
9
|
-
get message() {
|
|
10
|
-
return this.error.message;
|
|
11
|
-
}
|
|
1
|
+
import DataIncompatibleWithDatabaseField from './DataIncompatibleWithDatabaseField.js';
|
|
2
|
+
export default class CheckConstraintViolation extends DataIncompatibleWithDatabaseField {
|
|
12
3
|
}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
error;
|
|
4
|
-
constructor({ dream, error }) {
|
|
5
|
-
super();
|
|
6
|
-
this.dream = dream;
|
|
7
|
-
this.error = error;
|
|
8
|
-
}
|
|
9
|
-
get message() {
|
|
10
|
-
return this.error.message;
|
|
11
|
-
}
|
|
1
|
+
import DataIncompatibleWithDatabaseField from './DataIncompatibleWithDatabaseField.js';
|
|
2
|
+
export default class DataTypeColumnTypeMismatch extends DataIncompatibleWithDatabaseField {
|
|
12
3
|
}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
error;
|
|
4
|
-
constructor({ dream, error }) {
|
|
5
|
-
super();
|
|
6
|
-
this.dream = dream;
|
|
7
|
-
this.error = error;
|
|
8
|
-
}
|
|
9
|
-
get message() {
|
|
10
|
-
return this.error.message;
|
|
11
|
-
}
|
|
1
|
+
import DataIncompatibleWithDatabaseField from './DataIncompatibleWithDatabaseField.js';
|
|
2
|
+
export default class NotNullViolation extends DataIncompatibleWithDatabaseField {
|
|
12
3
|
}
|
|
@@ -143,6 +143,7 @@ ${tableName}: {
|
|
|
143
143
|
return `${associationName}: {
|
|
144
144
|
type: '${associationMetadata.type}',
|
|
145
145
|
foreignKey: ${associationMetadata.foreignKey ? `'${associationMetadata.foreignKey}'` : 'null'},
|
|
146
|
+
foreignKeyTypeColumn: ${associationMetadata.foreignKeyTypeColumn ? `'${associationMetadata.foreignKeyTypeColumn}'` : 'null'},
|
|
146
147
|
tables: ${stringifyArray(associationMetadata.tables)},
|
|
147
148
|
optional: ${associationMetadata.optional},
|
|
148
149
|
requiredOnClauses: ${requiredOnClauses.length === 0 ? 'null' : stringifyArray(requiredOnClauses)},
|
|
@@ -267,6 +268,9 @@ may need to update the table getter in the corresponding Dream.
|
|
|
267
268
|
type: associationMetaData.type,
|
|
268
269
|
polymorphic: associationMetaData.polymorphic,
|
|
269
270
|
foreignKey,
|
|
271
|
+
foreignKeyTypeColumn: associationMetaData.polymorphic
|
|
272
|
+
? associationMetaData?.foreignKeyTypeField?.() || null
|
|
273
|
+
: null,
|
|
270
274
|
optional,
|
|
271
275
|
where,
|
|
272
276
|
};
|
package/dist/esm/src/index.js
CHANGED
|
@@ -25,6 +25,8 @@ export { default as Encrypt } from './encrypt/index.js';
|
|
|
25
25
|
export { default as NonLoadedAssociation } from './errors/associations/NonLoadedAssociation.js';
|
|
26
26
|
export { default as CreateOrFindByFailedToCreateAndFind } from './errors/CreateOrFindByFailedToCreateAndFind.js';
|
|
27
27
|
export { default as CheckConstraintViolation } from './errors/db/CheckConstraintViolation.js';
|
|
28
|
+
export { default as ColumnOverflow } from './errors/db/ColumnOverflow.js';
|
|
29
|
+
export { default as DataIncompatibleWithDatabaseField } from './errors/db/DataIncompatibleWithDatabaseField.js';
|
|
28
30
|
export { default as DataTypeColumnTypeMismatch } from './errors/db/DataTypeColumnTypeMismatch.js';
|
|
29
31
|
export { default as NotNullViolation } from './errors/db/NotNullViolation.js';
|
|
30
32
|
export { default as GlobalNameNotSet } from './errors/dream-app/GlobalNameNotSet.js';
|
|
@@ -2,10 +2,13 @@ export declare const CHECK_VIOLATION = "CHECK_VIOLATION";
|
|
|
2
2
|
export declare const FOREIGN_KEY_VIOLATION = "FOREIGN_KEY_VIOLATION";
|
|
3
3
|
export declare const INTEGRITY_CONSTRAINT_VIOLATION = "INTEGRITY_CONSTRAINT_VIOLATION";
|
|
4
4
|
export declare const INVALID_INPUT_SYNTAX = "INVALID_INPUT_SYNTAX";
|
|
5
|
+
export declare const COLUMN_OVERFLOW = "COLUMN_OVERFLOW";
|
|
5
6
|
export declare const NOT_NULL_VIOLATION = "NOT_NULL_VIOLATION";
|
|
6
7
|
export declare const RESTRICT_VIOLATION = "RESTRICT_VIOLATION";
|
|
7
8
|
export declare const UNIQUE_VIOLATION = "UNIQUE_VIOLATION";
|
|
8
9
|
export declare const PG_ERRORS: {
|
|
10
|
+
readonly '22001': "COLUMN_OVERFLOW";
|
|
11
|
+
readonly '22003': "COLUMN_OVERFLOW";
|
|
9
12
|
readonly '23505': "UNIQUE_VIOLATION";
|
|
10
13
|
readonly '22007': "INVALID_INPUT_SYNTAX";
|
|
11
14
|
readonly '22P02': "INVALID_INPUT_SYNTAX";
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class CheckConstraintViolation extends
|
|
3
|
-
dream: Dream;
|
|
4
|
-
error: Error;
|
|
5
|
-
constructor({ dream, error }: {
|
|
6
|
-
dream: Dream;
|
|
7
|
-
error: Error;
|
|
8
|
-
});
|
|
9
|
-
get message(): string;
|
|
1
|
+
import DataIncompatibleWithDatabaseField from './DataIncompatibleWithDatabaseField.js';
|
|
2
|
+
export default class CheckConstraintViolation extends DataIncompatibleWithDatabaseField {
|
|
10
3
|
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class DataTypeColumnTypeMismatch extends
|
|
3
|
-
dream: Dream;
|
|
4
|
-
error: Error;
|
|
5
|
-
constructor({ dream, error }: {
|
|
6
|
-
dream: Dream;
|
|
7
|
-
error: Error;
|
|
8
|
-
});
|
|
9
|
-
get message(): string;
|
|
1
|
+
import DataIncompatibleWithDatabaseField from './DataIncompatibleWithDatabaseField.js';
|
|
2
|
+
export default class DataTypeColumnTypeMismatch extends DataIncompatibleWithDatabaseField {
|
|
10
3
|
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class NotNullViolation extends
|
|
3
|
-
dream: Dream;
|
|
4
|
-
error: Error;
|
|
5
|
-
constructor({ dream, error }: {
|
|
6
|
-
dream: Dream;
|
|
7
|
-
error: Error;
|
|
8
|
-
});
|
|
9
|
-
get message(): string;
|
|
1
|
+
import DataIncompatibleWithDatabaseField from './DataIncompatibleWithDatabaseField.js';
|
|
2
|
+
export default class NotNullViolation extends DataIncompatibleWithDatabaseField {
|
|
10
3
|
}
|
|
@@ -25,6 +25,7 @@ export interface SchemaBuilderAssociationData {
|
|
|
25
25
|
polymorphic: boolean;
|
|
26
26
|
optional: boolean | null;
|
|
27
27
|
foreignKey: string | null;
|
|
28
|
+
foreignKeyTypeColumn: string | null;
|
|
28
29
|
where: Record<string, string | typeof DreamConst.passthrough | typeof DreamConst.required> | null;
|
|
29
30
|
}
|
|
30
31
|
export interface SchemaBuilderColumnData {
|
|
@@ -32,8 +33,8 @@ export interface SchemaBuilderColumnData {
|
|
|
32
33
|
allowNull: boolean;
|
|
33
34
|
enumType: string | null;
|
|
34
35
|
enumValues: string | null;
|
|
35
|
-
isArray: boolean;
|
|
36
36
|
foreignKey: string | null;
|
|
37
|
+
isArray: boolean;
|
|
37
38
|
}
|
|
38
39
|
export interface SchemaBuilderInformationSchemaRow {
|
|
39
40
|
columnName: string;
|
|
@@ -26,6 +26,8 @@ export { default as Encrypt, type EncryptAlgorithm, type EncryptOptions } from '
|
|
|
26
26
|
export { default as NonLoadedAssociation } from './errors/associations/NonLoadedAssociation.js';
|
|
27
27
|
export { default as CreateOrFindByFailedToCreateAndFind } from './errors/CreateOrFindByFailedToCreateAndFind.js';
|
|
28
28
|
export { default as CheckConstraintViolation } from './errors/db/CheckConstraintViolation.js';
|
|
29
|
+
export { default as ColumnOverflow } from './errors/db/ColumnOverflow.js';
|
|
30
|
+
export { default as DataIncompatibleWithDatabaseField } from './errors/db/DataIncompatibleWithDatabaseField.js';
|
|
29
31
|
export { default as DataTypeColumnTypeMismatch } from './errors/db/DataTypeColumnTypeMismatch.js';
|
|
30
32
|
export { default as NotNullViolation } from './errors/db/NotNullViolation.js';
|
|
31
33
|
export { default as GlobalNameNotSet } from './errors/dream-app/GlobalNameNotSet.js';
|
|
@@ -23,8 +23,10 @@ export interface SortableOptions<T extends Dream> {
|
|
|
23
23
|
export type PrimaryKeyForFind<I extends Dream, PrimaryKeyType extends DreamPrimaryKeyType<I> = DreamPrimaryKeyType<I>> = PrimaryKeyType extends bigint ? bigint | number | string | null | undefined : PrimaryKeyType | string | null | undefined;
|
|
24
24
|
export type DreamColumnNames<DreamInstance extends Dream, DB = DreamInstance['DB'], TableName extends keyof DB = DreamInstance['table'] & keyof DB, Table extends DB[keyof DB] = DB[TableName], AttributeName extends keyof Table & string = keyof Table & string> = AttributeName;
|
|
25
25
|
export type NonJsonDreamColumnNames<DreamInstance extends Dream, Schema extends DreamInstance['schema'] = DreamInstance['schema'], TableName extends DreamInstance['table'] & keyof Schema = DreamInstance['table'] & keyof Schema, AttributeName extends Exclude<Schema[TableName]['nonJsonColumnNames'][number], keyof Dream> & string = Exclude<Schema[TableName]['nonJsonColumnNames'][number], keyof Dream> & string> = AttributeName;
|
|
26
|
-
export type DreamParamSafeColumnNames<DreamInstance extends Dream
|
|
27
|
-
export type
|
|
26
|
+
export type DreamParamSafeColumnNames<DreamInstance extends Dream> = Exclude<keyof UpdateableProperties<DreamInstance>, DreamParamUnsafeColumnNames<DreamInstance>>;
|
|
27
|
+
export type DreamParamUnsafeColumnNames<DreamInstance extends Dream, BelongsToForeignKeys = DreamBelongsToForeignKeys<DreamInstance>, BelongsToForeignKeyTypes = DreamBelongsToForeignKeyTypes<DreamInstance>, AssociationNames = DreamAssociationNames<DreamInstance>> = BelongsToForeignKeys | BelongsToForeignKeyTypes | (DreamInstance['primaryKey' & keyof DreamInstance] extends undefined ? 'id' : DreamInstance['primaryKey' & keyof DreamInstance]) | (DreamInstance['createdAtField' & keyof DreamInstance] extends undefined ? 'createdAt' : DreamInstance['createdAtField' & keyof DreamInstance]) | (DreamInstance['updatedAtField' & keyof DreamInstance] extends undefined ? 'updatedAt' : DreamInstance['updatedAtField' & keyof DreamInstance]) | (DreamInstance['deletedAtField' & keyof DreamInstance] extends undefined ? 'deletedAt' : DreamInstance['deletedAtField' & keyof DreamInstance]) | AssociationNames | 'type';
|
|
28
|
+
export type DreamBelongsToForeignKeyTypes<DreamInstance extends Dream, AssociationSchema = DreamAssociationMetadata<DreamInstance>, BelongsToAssociationSchema = AssociationSchema[keyof DreamBelongsToAssociationMetadata<DreamInstance> & keyof AssociationSchema], BelongsToForeignKeys = Exclude<BelongsToAssociationSchema['foreignKeyTypeColumn' & keyof BelongsToAssociationSchema], null>> = BelongsToForeignKeys;
|
|
29
|
+
export type DreamBelongsToForeignKeys<DreamInstance extends Dream, AssociationSchema = DreamAssociationMetadata<DreamInstance>, BelongsToAssociationSchema = AssociationSchema[keyof DreamBelongsToAssociationMetadata<DreamInstance> & keyof AssociationSchema], BelongsToForeignKeys = Exclude<BelongsToAssociationSchema['foreignKey' & keyof BelongsToAssociationSchema], null>> = BelongsToForeignKeys;
|
|
28
30
|
export type TableColumnNames<DB, TableName extends keyof DB, Table extends DB[keyof DB] = DB[TableName]> = keyof Table & string;
|
|
29
31
|
export type DreamColumn<DreamInstance extends Dream, Column extends keyof Attrs, Attrs = DreamAttributes<DreamInstance>> = Attrs[Column & keyof Attrs];
|
|
30
32
|
export type DreamClassColumn<DreamClass extends typeof Dream, Column extends keyof DreamAttributes<DreamInstance>, DreamInstance extends InstanceType<DreamClass> = InstanceType<DreamClass>> = DreamColumn<DreamInstance, Column>;
|
|
@@ -72,12 +72,19 @@ export type NonJsonDreamColumnNames<
|
|
|
72
72
|
string = Exclude<Schema[TableName]['nonJsonColumnNames'][number], keyof Dream> & string,
|
|
73
73
|
> = AttributeName
|
|
74
74
|
|
|
75
|
-
export type DreamParamSafeColumnNames<
|
|
75
|
+
export type DreamParamSafeColumnNames<DreamInstance extends Dream> = Exclude<
|
|
76
|
+
keyof UpdateableProperties<DreamInstance>,
|
|
77
|
+
DreamParamUnsafeColumnNames<DreamInstance>
|
|
78
|
+
>
|
|
79
|
+
|
|
80
|
+
export type DreamParamUnsafeColumnNames<
|
|
76
81
|
DreamInstance extends Dream,
|
|
77
82
|
BelongsToForeignKeys = DreamBelongsToForeignKeys<DreamInstance>,
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
BelongsToForeignKeyTypes = DreamBelongsToForeignKeyTypes<DreamInstance>,
|
|
84
|
+
AssociationNames = DreamAssociationNames<DreamInstance>,
|
|
85
|
+
> =
|
|
80
86
|
| BelongsToForeignKeys
|
|
87
|
+
| BelongsToForeignKeyTypes
|
|
81
88
|
| (DreamInstance['primaryKey' & keyof DreamInstance] extends undefined
|
|
82
89
|
? 'id'
|
|
83
90
|
: DreamInstance['primaryKey' & keyof DreamInstance])
|
|
@@ -90,14 +97,23 @@ export type DreamParamSafeColumnNames<
|
|
|
90
97
|
| (DreamInstance['deletedAtField' & keyof DreamInstance] extends undefined
|
|
91
98
|
? 'deletedAt'
|
|
92
99
|
: DreamInstance['deletedAtField' & keyof DreamInstance])
|
|
100
|
+
| AssociationNames
|
|
93
101
|
| 'type'
|
|
94
|
-
|
|
102
|
+
|
|
103
|
+
export type DreamBelongsToForeignKeyTypes<
|
|
104
|
+
DreamInstance extends Dream,
|
|
105
|
+
AssociationSchema = DreamAssociationMetadata<DreamInstance>,
|
|
106
|
+
BelongsToAssociationSchema = AssociationSchema[keyof DreamBelongsToAssociationMetadata<DreamInstance> &
|
|
107
|
+
keyof AssociationSchema],
|
|
108
|
+
BelongsToForeignKeys = Exclude<
|
|
109
|
+
BelongsToAssociationSchema['foreignKeyTypeColumn' & keyof BelongsToAssociationSchema],
|
|
110
|
+
null
|
|
111
|
+
>,
|
|
112
|
+
> = BelongsToForeignKeys
|
|
95
113
|
|
|
96
114
|
export type DreamBelongsToForeignKeys<
|
|
97
115
|
DreamInstance extends Dream,
|
|
98
|
-
|
|
99
|
-
TableSchema = Schema[DreamInstance['table'] & keyof Schema],
|
|
100
|
-
AssociationSchema = TableSchema['associations' & keyof TableSchema],
|
|
116
|
+
AssociationSchema = DreamAssociationMetadata<DreamInstance>,
|
|
101
117
|
BelongsToAssociationSchema = AssociationSchema[keyof DreamBelongsToAssociationMetadata<DreamInstance> &
|
|
102
118
|
keyof AssociationSchema],
|
|
103
119
|
BelongsToForeignKeys = Exclude<
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.navigationData = "data:application/octet-stream;base64,
|
|
1
|
+
window.navigationData = "data:application/octet-stream;base64,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"
|