@squiz/db-lib 1.2.1-alpha.100 → 1.2.1-alpha.102
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +16 -0
- package/lib/AbstractRepository.d.ts +4 -4
- package/lib/index.js.map +2 -2
- package/package.json +3 -4
- package/src/AbstractRepository.ts +3 -3
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,22 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.2.1-alpha.102](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.102) (2022-08-23)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @squiz/db-lib
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
## [1.2.1-alpha.101](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.101) (2022-08-19)
|
15
|
+
|
16
|
+
**Note:** Version bump only for package @squiz/db-lib
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
6
22
|
## [1.2.1-alpha.100](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.100) (2022-08-18)
|
7
23
|
|
8
24
|
**Note:** Version bump only for package @squiz/db-lib
|
@@ -10,11 +10,11 @@ export interface Writer<T> {
|
|
10
10
|
delete(where: Partial<T>): Promise<number>;
|
11
11
|
}
|
12
12
|
export declare type Repository<T> = Reader<T> & Writer<T>;
|
13
|
-
export declare abstract class AbstractRepository<T> implements Reader<T>, Writer<T> {
|
13
|
+
export declare abstract class AbstractRepository<T, ObjT extends T> implements Reader<T>, Writer<T> {
|
14
14
|
protected repositories: Repositories;
|
15
15
|
protected pool: Pool;
|
16
16
|
protected classRef: {
|
17
|
-
new (data?: Record<string, unknown>):
|
17
|
+
new (data?: Record<string, unknown>): ObjT;
|
18
18
|
};
|
19
19
|
protected tableName: string;
|
20
20
|
/** object where the key is the model property name amd the value is sql column name */
|
@@ -28,10 +28,10 @@ export declare abstract class AbstractRepository<T> implements Reader<T>, Writer
|
|
28
28
|
constructor(repositories: Repositories, pool: Pool, tableName: string, mapping: {
|
29
29
|
[key in keyof T]: string;
|
30
30
|
}, classRef: {
|
31
|
-
new (data?: Record<string, unknown>):
|
31
|
+
new (data?: Record<string, unknown>): ObjT;
|
32
32
|
});
|
33
33
|
protected getConnection(): Promise<PoolClient>;
|
34
|
-
create(value:
|
34
|
+
create(value: ObjT, transactionClient?: PoolClient | null): Promise<T>;
|
35
35
|
update(where: Partial<T>, newValue: Partial<T>, transactionClient?: PoolClient | null): Promise<T[]>;
|
36
36
|
delete(where: Partial<T>, transactionClient?: PoolClient | null): Promise<number>;
|
37
37
|
protected createWhereStringFromPartialModel(values: Partial<T>, initialIndex?: number): string;
|