bigal 13.0.0-beta6 → 13.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/.prettierrc.cjs CHANGED
@@ -13,9 +13,9 @@ module.exports = {
13
13
 
14
14
  overrides: [
15
15
  {
16
- files: '*.js',
16
+ files: ['*.js', '*.cjs', '*.mjs'],
17
17
  options: {
18
- parser: 'babel',
18
+ parser: 'espree',
19
19
  },
20
20
  },
21
21
  {
package/CHANGELOG.md CHANGED
@@ -3,7 +3,8 @@
3
3
  ## 13.0.0 - 2024-07-02
4
4
 
5
5
  - Publish as CJS and ESM
6
- - Update npms
6
+ - Upgrade eslint to flat config
7
+ - Update npms and dependencies
7
8
 
8
9
  ### BREAKING CHANGES
9
10
 
package/dist/index.cjs CHANGED
@@ -2614,6 +2614,7 @@ exports.ColumnModelMetadata = ColumnModelMetadata;
2614
2614
  exports.ColumnTypeMetadata = ColumnTypeMetadata;
2615
2615
  exports.Entity = Entity;
2616
2616
  exports.ModelMetadata = ModelMetadata;
2617
+ exports.QueryError = QueryError;
2617
2618
  exports.ReadonlyRepository = ReadonlyRepository;
2618
2619
  exports.Repository = Repository;
2619
2620
  exports.column = column;
package/dist/index.d.cts CHANGED
@@ -389,6 +389,8 @@ declare class MetadataStorage<T extends Entity> {
389
389
 
390
390
  declare function getMetadataStorage<T extends Entity>(): MetadataStorage<T>;
391
391
 
392
+ type Comparer = '!' | '<' | '<=' | '>' | '>=' | 'contains' | 'endsWith' | 'like' | 'or' | 'startsWith';
393
+
392
394
  type ExcludeUndefined<T> = Exclude<T, undefined>;
393
395
  type LiteralValues<TValue> = (TValue | null)[] | TValue | null;
394
396
  type WhereClauseValue<TValue> = TValue extends NotEntityBrand | undefined ? Exclude<TValue, NotEntityBrand | undefined> : Extract<TValue, Entity> extends undefined ? LiteralValues<ExcludeUndefined<TValue>> : (ExcludeUndefined<Exclude<TValue, Entity>> | null)[] | (Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null)[] | ExcludeUndefined<Exclude<TValue, Entity>> | Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null;
@@ -868,6 +870,12 @@ type ReturnFunctionType = (object: ClassLike, propertyName: string) => void;
868
870
  declare function versionColumn(options?: ColumnTypeOptions): ReturnFunctionType;
869
871
  declare function versionColumn(dbColumnName: string, options?: ColumnTypeOptions): ReturnFunctionType;
870
872
 
873
+ declare class QueryError<T extends Entity> extends Error {
874
+ model: ModelMetadata<T>;
875
+ where: WhereQuery<T> | undefined;
876
+ constructor(message: string, model: ModelMetadata<T>, where?: WhereQuery<T>);
877
+ }
878
+
871
879
  interface IConnection {
872
880
  pool: Pool;
873
881
  readonlyPool?: Pool;
@@ -889,4 +897,4 @@ interface InitializeOptions extends IConnection {
889
897
  */
890
898
  declare function initialize({ models, pool, readonlyPool, connections, expose }: InitializeOptions): Record<string, IReadonlyRepository<Entity> | IRepository<Entity>>;
891
899
 
892
- export { type ClassLike, ColumnBaseMetadata, type ColumnBaseMetadataOptions, ColumnCollectionMetadata, type ColumnCollectionMetadataOptions, type ColumnMetadata, ColumnModelMetadata, type ColumnModelMetadataOptions, type ColumnModifierMetadata, ColumnTypeMetadata, type ColumnTypeMetadataOptions, type CreateUpdateParams, Entity, type EntityFieldValue, type EntityPrimitiveOrId, type EntityStatic, type ExcludeEntityCollections, type ExcludeFunctions, type GetValueType, type IConnection, type IReadonlyRepository, type IRepository, type IRepositoryOptions, type IncludeFunctions, type InitializeOptions, type IsValueOfType, ModelMetadata, type ModelMetadataOptions, type NotEntity, type NotEntityBrand, type OmitEntityCollections, type OmitFunctions, type PickAsType, type PickByValueType, type PickFunctions, type Populated, type QueryResult, type QueryResultOptionalPopulated, type QueryResultPopulated, ReadonlyRepository, Repository, column, createDateColumn, getMetadataStorage, initialize, primaryColumn, table, updateDateColumn, versionColumn };
900
+ export { type ClassLike, ColumnBaseMetadata, type ColumnBaseMetadataOptions, ColumnCollectionMetadata, type ColumnCollectionMetadataOptions, type ColumnMetadata, ColumnModelMetadata, type ColumnModelMetadataOptions, type ColumnModifierMetadata, ColumnTypeMetadata, type ColumnTypeMetadataOptions, type Comparer, type CountResult, type CreateUpdateOptions, type CreateUpdateParams, type DeleteOptions, type DestroyResult, type DoNotReturnRecords, Entity, type EntityFieldValue, type EntityPrimitiveOrId, type EntityStatic, type ExcludeEntityCollections, type ExcludeFunctions, type FindArgs, type FindOneArgs, type FindOneResult, type FindResult, type GetValueType, type IConnection, type IReadonlyRepository, type IRepository, type IRepositoryOptions, type IncludeFunctions, type InitializeOptions, type IsValueOfType, type LiteralValues, ModelMetadata, type ModelMetadataOptions, type MultipleSortString, type NegatableConstraint, type NotEntity, type NotEntityBrand, type NumberOrDateConstraint, type OmitEntityCollections, type OmitFunctions, type OrderBy, type PaginateOptions, type PickAsType, type PickByValueType, type PickFunctions, type PopulateArgs, type Populated, QueryError, type QueryResult, type QueryResultOptionalPopulated, type QueryResultPopulated, ReadonlyRepository, Repository, type ReturnSelect$1 as ReturnSelect, type Sort, type SortObject, type SortObjectValue, type SortString, type StringConstraint, type WhereClauseValue, type WhereQuery, type WhereQueryStatement, column, createDateColumn, getMetadataStorage, initialize, primaryColumn, table, updateDateColumn, versionColumn };
package/dist/index.d.mts CHANGED
@@ -389,6 +389,8 @@ declare class MetadataStorage<T extends Entity> {
389
389
 
390
390
  declare function getMetadataStorage<T extends Entity>(): MetadataStorage<T>;
391
391
 
392
+ type Comparer = '!' | '<' | '<=' | '>' | '>=' | 'contains' | 'endsWith' | 'like' | 'or' | 'startsWith';
393
+
392
394
  type ExcludeUndefined<T> = Exclude<T, undefined>;
393
395
  type LiteralValues<TValue> = (TValue | null)[] | TValue | null;
394
396
  type WhereClauseValue<TValue> = TValue extends NotEntityBrand | undefined ? Exclude<TValue, NotEntityBrand | undefined> : Extract<TValue, Entity> extends undefined ? LiteralValues<ExcludeUndefined<TValue>> : (ExcludeUndefined<Exclude<TValue, Entity>> | null)[] | (Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null)[] | ExcludeUndefined<Exclude<TValue, Entity>> | Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null;
@@ -868,6 +870,12 @@ type ReturnFunctionType = (object: ClassLike, propertyName: string) => void;
868
870
  declare function versionColumn(options?: ColumnTypeOptions): ReturnFunctionType;
869
871
  declare function versionColumn(dbColumnName: string, options?: ColumnTypeOptions): ReturnFunctionType;
870
872
 
873
+ declare class QueryError<T extends Entity> extends Error {
874
+ model: ModelMetadata<T>;
875
+ where: WhereQuery<T> | undefined;
876
+ constructor(message: string, model: ModelMetadata<T>, where?: WhereQuery<T>);
877
+ }
878
+
871
879
  interface IConnection {
872
880
  pool: Pool;
873
881
  readonlyPool?: Pool;
@@ -889,4 +897,4 @@ interface InitializeOptions extends IConnection {
889
897
  */
890
898
  declare function initialize({ models, pool, readonlyPool, connections, expose }: InitializeOptions): Record<string, IReadonlyRepository<Entity> | IRepository<Entity>>;
891
899
 
892
- export { type ClassLike, ColumnBaseMetadata, type ColumnBaseMetadataOptions, ColumnCollectionMetadata, type ColumnCollectionMetadataOptions, type ColumnMetadata, ColumnModelMetadata, type ColumnModelMetadataOptions, type ColumnModifierMetadata, ColumnTypeMetadata, type ColumnTypeMetadataOptions, type CreateUpdateParams, Entity, type EntityFieldValue, type EntityPrimitiveOrId, type EntityStatic, type ExcludeEntityCollections, type ExcludeFunctions, type GetValueType, type IConnection, type IReadonlyRepository, type IRepository, type IRepositoryOptions, type IncludeFunctions, type InitializeOptions, type IsValueOfType, ModelMetadata, type ModelMetadataOptions, type NotEntity, type NotEntityBrand, type OmitEntityCollections, type OmitFunctions, type PickAsType, type PickByValueType, type PickFunctions, type Populated, type QueryResult, type QueryResultOptionalPopulated, type QueryResultPopulated, ReadonlyRepository, Repository, column, createDateColumn, getMetadataStorage, initialize, primaryColumn, table, updateDateColumn, versionColumn };
900
+ export { type ClassLike, ColumnBaseMetadata, type ColumnBaseMetadataOptions, ColumnCollectionMetadata, type ColumnCollectionMetadataOptions, type ColumnMetadata, ColumnModelMetadata, type ColumnModelMetadataOptions, type ColumnModifierMetadata, ColumnTypeMetadata, type ColumnTypeMetadataOptions, type Comparer, type CountResult, type CreateUpdateOptions, type CreateUpdateParams, type DeleteOptions, type DestroyResult, type DoNotReturnRecords, Entity, type EntityFieldValue, type EntityPrimitiveOrId, type EntityStatic, type ExcludeEntityCollections, type ExcludeFunctions, type FindArgs, type FindOneArgs, type FindOneResult, type FindResult, type GetValueType, type IConnection, type IReadonlyRepository, type IRepository, type IRepositoryOptions, type IncludeFunctions, type InitializeOptions, type IsValueOfType, type LiteralValues, ModelMetadata, type ModelMetadataOptions, type MultipleSortString, type NegatableConstraint, type NotEntity, type NotEntityBrand, type NumberOrDateConstraint, type OmitEntityCollections, type OmitFunctions, type OrderBy, type PaginateOptions, type PickAsType, type PickByValueType, type PickFunctions, type PopulateArgs, type Populated, QueryError, type QueryResult, type QueryResultOptionalPopulated, type QueryResultPopulated, ReadonlyRepository, Repository, type ReturnSelect$1 as ReturnSelect, type Sort, type SortObject, type SortObjectValue, type SortString, type StringConstraint, type WhereClauseValue, type WhereQuery, type WhereQueryStatement, column, createDateColumn, getMetadataStorage, initialize, primaryColumn, table, updateDateColumn, versionColumn };
package/dist/index.d.ts CHANGED
@@ -389,6 +389,8 @@ declare class MetadataStorage<T extends Entity> {
389
389
 
390
390
  declare function getMetadataStorage<T extends Entity>(): MetadataStorage<T>;
391
391
 
392
+ type Comparer = '!' | '<' | '<=' | '>' | '>=' | 'contains' | 'endsWith' | 'like' | 'or' | 'startsWith';
393
+
392
394
  type ExcludeUndefined<T> = Exclude<T, undefined>;
393
395
  type LiteralValues<TValue> = (TValue | null)[] | TValue | null;
394
396
  type WhereClauseValue<TValue> = TValue extends NotEntityBrand | undefined ? Exclude<TValue, NotEntityBrand | undefined> : Extract<TValue, Entity> extends undefined ? LiteralValues<ExcludeUndefined<TValue>> : (ExcludeUndefined<Exclude<TValue, Entity>> | null)[] | (Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null)[] | ExcludeUndefined<Exclude<TValue, Entity>> | Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null;
@@ -868,6 +870,12 @@ type ReturnFunctionType = (object: ClassLike, propertyName: string) => void;
868
870
  declare function versionColumn(options?: ColumnTypeOptions): ReturnFunctionType;
869
871
  declare function versionColumn(dbColumnName: string, options?: ColumnTypeOptions): ReturnFunctionType;
870
872
 
873
+ declare class QueryError<T extends Entity> extends Error {
874
+ model: ModelMetadata<T>;
875
+ where: WhereQuery<T> | undefined;
876
+ constructor(message: string, model: ModelMetadata<T>, where?: WhereQuery<T>);
877
+ }
878
+
871
879
  interface IConnection {
872
880
  pool: Pool;
873
881
  readonlyPool?: Pool;
@@ -889,4 +897,4 @@ interface InitializeOptions extends IConnection {
889
897
  */
890
898
  declare function initialize({ models, pool, readonlyPool, connections, expose }: InitializeOptions): Record<string, IReadonlyRepository<Entity> | IRepository<Entity>>;
891
899
 
892
- export { type ClassLike, ColumnBaseMetadata, type ColumnBaseMetadataOptions, ColumnCollectionMetadata, type ColumnCollectionMetadataOptions, type ColumnMetadata, ColumnModelMetadata, type ColumnModelMetadataOptions, type ColumnModifierMetadata, ColumnTypeMetadata, type ColumnTypeMetadataOptions, type CreateUpdateParams, Entity, type EntityFieldValue, type EntityPrimitiveOrId, type EntityStatic, type ExcludeEntityCollections, type ExcludeFunctions, type GetValueType, type IConnection, type IReadonlyRepository, type IRepository, type IRepositoryOptions, type IncludeFunctions, type InitializeOptions, type IsValueOfType, ModelMetadata, type ModelMetadataOptions, type NotEntity, type NotEntityBrand, type OmitEntityCollections, type OmitFunctions, type PickAsType, type PickByValueType, type PickFunctions, type Populated, type QueryResult, type QueryResultOptionalPopulated, type QueryResultPopulated, ReadonlyRepository, Repository, column, createDateColumn, getMetadataStorage, initialize, primaryColumn, table, updateDateColumn, versionColumn };
900
+ export { type ClassLike, ColumnBaseMetadata, type ColumnBaseMetadataOptions, ColumnCollectionMetadata, type ColumnCollectionMetadataOptions, type ColumnMetadata, ColumnModelMetadata, type ColumnModelMetadataOptions, type ColumnModifierMetadata, ColumnTypeMetadata, type ColumnTypeMetadataOptions, type Comparer, type CountResult, type CreateUpdateOptions, type CreateUpdateParams, type DeleteOptions, type DestroyResult, type DoNotReturnRecords, Entity, type EntityFieldValue, type EntityPrimitiveOrId, type EntityStatic, type ExcludeEntityCollections, type ExcludeFunctions, type FindArgs, type FindOneArgs, type FindOneResult, type FindResult, type GetValueType, type IConnection, type IReadonlyRepository, type IRepository, type IRepositoryOptions, type IncludeFunctions, type InitializeOptions, type IsValueOfType, type LiteralValues, ModelMetadata, type ModelMetadataOptions, type MultipleSortString, type NegatableConstraint, type NotEntity, type NotEntityBrand, type NumberOrDateConstraint, type OmitEntityCollections, type OmitFunctions, type OrderBy, type PaginateOptions, type PickAsType, type PickByValueType, type PickFunctions, type PopulateArgs, type Populated, QueryError, type QueryResult, type QueryResultOptionalPopulated, type QueryResultPopulated, ReadonlyRepository, Repository, type ReturnSelect$1 as ReturnSelect, type Sort, type SortObject, type SortObjectValue, type SortString, type StringConstraint, type WhereClauseValue, type WhereQuery, type WhereQueryStatement, column, createDateColumn, getMetadataStorage, initialize, primaryColumn, table, updateDateColumn, versionColumn };
package/dist/index.mjs CHANGED
@@ -2602,4 +2602,4 @@ function initialize({ models, pool, readonlyPool = pool, connections = {}, expos
2602
2602
  return repositoriesByModelName;
2603
2603
  }
2604
2604
 
2605
- export { ColumnBaseMetadata, ColumnCollectionMetadata, ColumnModelMetadata, ColumnTypeMetadata, Entity, ModelMetadata, ReadonlyRepository, Repository, column, createDateColumn, getMetadataStorage, initialize, primaryColumn, table, updateDateColumn, versionColumn };
2605
+ export { ColumnBaseMetadata, ColumnCollectionMetadata, ColumnModelMetadata, ColumnTypeMetadata, Entity, ModelMetadata, QueryError, ReadonlyRepository, Repository, column, createDateColumn, getMetadataStorage, initialize, primaryColumn, table, updateDateColumn, versionColumn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigal",
3
- "version": "13.0.0-beta6",
3
+ "version": "13.0.0",
4
4
  "description": "A fast and lightweight orm for postgres and node.js, written in typescript.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -36,7 +36,7 @@
36
36
  "@types/pg": "^8.11.6",
37
37
  "lodash": "^4.17.21",
38
38
  "pg": "^8.12.0",
39
- "postgres-pool": "^9.0.0-beta2"
39
+ "postgres-pool": "^9.0.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@faker-js/faker": "^8.4.1",