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.
Files changed (55) hide show
  1. package/cli/model/metadata/generate.ts +5 -11
  2. package/dist/bean/bean.database.d.ts +1 -1
  3. package/dist/bean/bean.database.d.ts.map +1 -1
  4. package/dist/index.js +45 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/bean.model/bean.model_cache.d.ts +3 -0
  7. package/dist/lib/bean.model/bean.model_cache.d.ts.map +1 -1
  8. package/dist/lib/bean.model/bean.model_meta.d.ts +1 -1
  9. package/dist/lib/bean.model/bean.model_meta.d.ts.map +1 -1
  10. package/dist/lib/dto/dtoAggregate.d.ts +1 -1
  11. package/dist/lib/dto/dtoAggregate.d.ts.map +1 -1
  12. package/dist/lib/dto/dtoCreate.d.ts +1 -1
  13. package/dist/lib/dto/dtoCreate.d.ts.map +1 -1
  14. package/dist/lib/dto/dtoGet.d.ts.map +1 -1
  15. package/dist/lib/dto/dtoGroup.d.ts +1 -1
  16. package/dist/lib/dto/dtoGroup.d.ts.map +1 -1
  17. package/dist/lib/dto/dtoSelectAndCount.d.ts +1 -1
  18. package/dist/lib/dto/dtoSelectAndCount.d.ts.map +1 -1
  19. package/dist/lib/dto/dtoUpdate.d.ts +1 -1
  20. package/dist/lib/dto/dtoUpdate.d.ts.map +1 -1
  21. package/dist/lib/modelCacheBase.d.ts +1 -1
  22. package/dist/lib/modelCacheBase.d.ts.map +1 -1
  23. package/dist/lib/relations.d.ts +1 -1
  24. package/dist/lib/relations.d.ts.map +1 -1
  25. package/dist/lib/relationsDynamic.d.ts +1 -1
  26. package/dist/lib/relationsDynamic.d.ts.map +1 -1
  27. package/dist/lib/relationsMutate.d.ts +1 -1
  28. package/dist/lib/relationsMutate.d.ts.map +1 -1
  29. package/dist/lib/relationsStatic.d.ts +1 -1
  30. package/dist/lib/relationsStatic.d.ts.map +1 -1
  31. package/dist/service/database.d.ts +1 -1
  32. package/dist/service/database.d.ts.map +1 -1
  33. package/dist/service/databaseDialectBase_.d.ts.map +1 -1
  34. package/dist/service/db_.d.ts +1 -1
  35. package/dist/service/db_.d.ts.map +1 -1
  36. package/dist-cli/model/metadata/generate.js +5 -13
  37. package/package.json +2 -2
  38. package/src/bean/bean.database.ts +1 -1
  39. package/src/bean/schedule.softDeletionPrune.ts +1 -1
  40. package/src/lib/bean.model/bean.model_cache.ts +52 -0
  41. package/src/lib/bean.model/bean.model_meta.ts +1 -1
  42. package/src/lib/dto/dtoAggregate.ts +1 -1
  43. package/src/lib/dto/dtoCreate.ts +1 -1
  44. package/src/lib/dto/dtoGet.ts +4 -10
  45. package/src/lib/dto/dtoGroup.ts +1 -1
  46. package/src/lib/dto/dtoSelectAndCount.ts +1 -1
  47. package/src/lib/dto/dtoUpdate.ts +1 -1
  48. package/src/lib/modelCacheBase.ts +1 -1
  49. package/src/lib/relations.ts +1 -1
  50. package/src/lib/relationsDynamic.ts +1 -1
  51. package/src/lib/relationsMutate.ts +1 -1
  52. package/src/lib/relationsStatic.ts +1 -1
  53. package/src/service/database.ts +1 -1
  54. package/src/service/databaseDialectBase_.ts +10 -3
  55. package/src/service/db_.ts +1 -1
@@ -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,
@@ -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 (this._columnTypePrefixes(type, TIMESTAMP_COLUMN_TYPE_PREFIXES) && value === 'CURRENT_TIMESTAMP') {
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)) return this._safeNumber(value);
166
- if (this._columnTypePrefixes(type, INTEGER_COLUMN_TYPE_PREFIXES)) return this._safeNumber(value);
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;
@@ -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';