vona-module-a-orm 5.1.23 → 5.1.25
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/cli/model/metadata/generate.ts +5 -11
- package/dist/bean/bean.database.d.ts +1 -1
- package/dist/bean/bean.database.d.ts.map +1 -1
- package/dist/index.js +45 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/bean.model/bean.model_cache.d.ts +3 -0
- package/dist/lib/bean.model/bean.model_cache.d.ts.map +1 -1
- package/dist/lib/bean.model/bean.model_meta.d.ts +1 -1
- package/dist/lib/bean.model/bean.model_meta.d.ts.map +1 -1
- package/dist/lib/dto/dtoAggregate.d.ts +1 -1
- package/dist/lib/dto/dtoAggregate.d.ts.map +1 -1
- package/dist/lib/dto/dtoCreate.d.ts +1 -1
- package/dist/lib/dto/dtoCreate.d.ts.map +1 -1
- package/dist/lib/dto/dtoGet.d.ts.map +1 -1
- package/dist/lib/dto/dtoGroup.d.ts +1 -1
- package/dist/lib/dto/dtoGroup.d.ts.map +1 -1
- package/dist/lib/dto/dtoSelectAndCount.d.ts +1 -1
- package/dist/lib/dto/dtoSelectAndCount.d.ts.map +1 -1
- package/dist/lib/dto/dtoUpdate.d.ts +1 -1
- package/dist/lib/dto/dtoUpdate.d.ts.map +1 -1
- package/dist/lib/modelCacheBase.d.ts +1 -1
- package/dist/lib/modelCacheBase.d.ts.map +1 -1
- package/dist/lib/relations.d.ts +1 -1
- package/dist/lib/relations.d.ts.map +1 -1
- package/dist/lib/relationsDynamic.d.ts +1 -1
- package/dist/lib/relationsDynamic.d.ts.map +1 -1
- package/dist/lib/relationsMutate.d.ts +1 -1
- package/dist/lib/relationsMutate.d.ts.map +1 -1
- package/dist/lib/relationsStatic.d.ts +1 -1
- package/dist/lib/relationsStatic.d.ts.map +1 -1
- package/dist/service/database.d.ts +1 -1
- package/dist/service/database.d.ts.map +1 -1
- package/dist/service/databaseDialectBase_.d.ts.map +1 -1
- package/dist/service/db_.d.ts +1 -1
- package/dist/service/db_.d.ts.map +1 -1
- package/dist-cli/model/metadata/generate.js +5 -13
- package/package.json +2 -2
- package/src/bean/bean.database.ts +1 -1
- package/src/bean/schedule.softDeletionPrune.ts +1 -1
- package/src/lib/bean.model/bean.model_cache.ts +52 -0
- package/src/lib/bean.model/bean.model_meta.ts +1 -1
- package/src/lib/dto/dtoAggregate.ts +1 -1
- package/src/lib/dto/dtoCreate.ts +1 -1
- package/src/lib/dto/dtoGet.ts +4 -10
- package/src/lib/dto/dtoGroup.ts +1 -1
- package/src/lib/dto/dtoSelectAndCount.ts +1 -1
- package/src/lib/dto/dtoUpdate.ts +1 -1
- package/src/lib/modelCacheBase.ts +1 -1
- package/src/lib/relations.ts +1 -1
- package/src/lib/relationsDynamic.ts +1 -1
- package/src/lib/relationsMutate.ts +1 -1
- package/src/lib/relationsStatic.ts +1 -1
- package/src/service/database.ts +1 -1
- package/src/service/databaseDialectBase_.ts +10 -3
- package/src/service/db_.ts +1 -1
package/src/lib/relations.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { BeanModelMeta } from './bean.model/bean.model_meta.ts';
|
|
2
1
|
import type { IModelClassRecord } from '../types/onion/model.ts';
|
|
3
2
|
import type {
|
|
4
3
|
TypeModelClassLike,
|
|
@@ -6,6 +5,7 @@ import type {
|
|
|
6
5
|
TypeModelsClassLikeGeneral,
|
|
7
6
|
TypeSymbolKeyEntity,
|
|
8
7
|
} from '../types/relations.ts';
|
|
8
|
+
import type { BeanModelMeta } from './bean.model/bean.model_meta.ts';
|
|
9
9
|
import type {
|
|
10
10
|
IModelRelationOptionsManyStatic,
|
|
11
11
|
IModelRelationOptionsOneStatic,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { BeanModelMeta } from './bean.model/bean.model_meta.ts';
|
|
2
1
|
import type { IModelClassRecord } from '../types/onion/model.ts';
|
|
3
2
|
import type {
|
|
4
3
|
TypeModelClassLike,
|
|
@@ -14,6 +13,7 @@ import type {
|
|
|
14
13
|
IModelRelationOptionsManyDynamic,
|
|
15
14
|
IModelRelationOptionsOneDynamic,
|
|
16
15
|
} from '../types/relationsDefDynamic.ts';
|
|
16
|
+
import type { BeanModelMeta } from './bean.model/bean.model_meta.ts';
|
|
17
17
|
|
|
18
18
|
function hasOne<
|
|
19
19
|
MODEL extends BeanModelMeta | keyof IModelClassRecord,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { BeanModelMeta } from './bean.model/bean.model_meta.ts';
|
|
2
1
|
import type { IModelClassRecord } from '../types/onion/model.ts';
|
|
3
2
|
import type {
|
|
4
3
|
TypeModelClassLike,
|
|
@@ -15,6 +14,7 @@ import type {
|
|
|
15
14
|
IModelRelationOptionsManyMutate,
|
|
16
15
|
IModelRelationOptionsOneMutate,
|
|
17
16
|
} from '../types/relationsDefMutate.ts';
|
|
17
|
+
import type { BeanModelMeta } from './bean.model/bean.model_meta.ts';
|
|
18
18
|
|
|
19
19
|
function hasOne<
|
|
20
20
|
MODEL extends BeanModelMeta | keyof IModelClassRecord,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { BeanModelMeta } from './bean.model/bean.model_meta.ts';
|
|
2
1
|
import type { TypeModelsClassLikeGeneral } from '../types/relations.ts';
|
|
3
2
|
import type {
|
|
4
3
|
IModelRelationOptionsManyDynamic,
|
|
5
4
|
IModelRelationOptionsOneDynamic,
|
|
6
5
|
} from '../types/relationsDefDynamic.ts';
|
|
6
|
+
import type { BeanModelMeta } from './bean.model/bean.model_meta.ts';
|
|
7
7
|
|
|
8
8
|
export interface IModelRelationOptionsManyStatic<
|
|
9
9
|
MODEL extends BeanModelMeta,
|
package/src/service/database.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { isNil } from '@cabloy/utils';
|
|
|
2
2
|
import { appResource, BeanBase, deepExtend } from 'vona';
|
|
3
3
|
import { Service } from 'vona-module-a-bean';
|
|
4
4
|
|
|
5
|
-
import type { ServiceDatabaseDialectBase } from './databaseDialectBase_.ts';
|
|
6
5
|
import type { ConfigDatabaseClient } from '../types/config.ts';
|
|
7
6
|
import type {
|
|
8
7
|
IDatabaseClientDialectRecord,
|
|
9
8
|
IDatabaseClientRecord,
|
|
10
9
|
IDbInfo,
|
|
11
10
|
} from '../types/database.ts';
|
|
11
|
+
import type { ServiceDatabaseDialectBase } from './databaseDialectBase_.ts';
|
|
12
12
|
|
|
13
13
|
import { ServiceDatabaseClient } from './databaseClient_.ts';
|
|
14
14
|
|
|
@@ -159,11 +159,18 @@ export class ServiceDatabaseDialectBase extends BeanBase {
|
|
|
159
159
|
if (isNil(value)) return undefined;
|
|
160
160
|
if (BOOLEAN_COLUMN_TYPES.includes(type)) return safeBoolean(value);
|
|
161
161
|
if (NUMBER_COLUMN_TYPES.includes(type)) return this._safeNumber(value);
|
|
162
|
-
if (
|
|
162
|
+
if (
|
|
163
|
+
this._columnTypePrefixes(type, TIMESTAMP_COLUMN_TYPE_PREFIXES) &&
|
|
164
|
+
value === 'CURRENT_TIMESTAMP'
|
|
165
|
+
) {
|
|
163
166
|
return undefined; // new Date();
|
|
164
167
|
}
|
|
165
|
-
if (this._columnTypePrefixes(type, FLOAT_COLUMN_TYPE_PREFIXES))
|
|
166
|
-
|
|
168
|
+
if (this._columnTypePrefixes(type, FLOAT_COLUMN_TYPE_PREFIXES)) {
|
|
169
|
+
return this._safeNumber(value);
|
|
170
|
+
}
|
|
171
|
+
if (this._columnTypePrefixes(type, INTEGER_COLUMN_TYPE_PREFIXES)) {
|
|
172
|
+
return this._safeNumber(value);
|
|
173
|
+
}
|
|
167
174
|
// pg: NULL::character varying
|
|
168
175
|
if (value.indexOf('NULL::') === 0) return undefined;
|
|
169
176
|
return value;
|
package/src/service/db_.ts
CHANGED
|
@@ -3,10 +3,10 @@ import type { FunctionAny } from 'vona';
|
|
|
3
3
|
import { BeanBase } from 'vona';
|
|
4
4
|
import { Service } from 'vona-module-a-bean';
|
|
5
5
|
|
|
6
|
-
import type { ServiceDatabaseDialectBase } from './databaseDialectBase_.ts';
|
|
7
6
|
import type { IDatabaseClientDialectRecord, IDbInfo } from '../types/database.ts';
|
|
8
7
|
import type { ITransactionConsistencyCommitOptions } from '../types/transaction.ts';
|
|
9
8
|
import type { ServiceDatabaseClient } from './databaseClient_.ts';
|
|
9
|
+
import type { ServiceDatabaseDialectBase } from './databaseDialectBase_.ts';
|
|
10
10
|
|
|
11
11
|
import { ServiceColumns } from './columns_.ts';
|
|
12
12
|
import { ServiceTransaction } from './transaction_.ts';
|