onecore 0.5.7 → 0.5.9
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/package.json +1 -1
- package/src/db.ts +4 -5
package/package.json
CHANGED
package/src/db.ts
CHANGED
|
@@ -15,8 +15,8 @@ interface StringMap {
|
|
|
15
15
|
[key: string]: string;
|
|
16
16
|
}
|
|
17
17
|
export interface Executor {
|
|
18
|
-
driver: string
|
|
19
|
-
param(i: number): string
|
|
18
|
+
driver: string
|
|
19
|
+
param(i: number): string
|
|
20
20
|
execute(sql: string, args?: any[], ctx?: any): Promise<number>
|
|
21
21
|
executeBatch(statements: Statement[], firstSuccess?: boolean, ctx?: any): Promise<number>
|
|
22
22
|
query<T>(sql: string, args?: any[], m?: StringMap, bools?: Attribute[], ctx?: any): Promise<T[]>
|
|
@@ -24,7 +24,6 @@ export interface Executor {
|
|
|
24
24
|
export interface Transaction extends Executor {
|
|
25
25
|
commit(): Promise<void>
|
|
26
26
|
rollback(): Promise<void>
|
|
27
|
-
end(): Promise<void>
|
|
28
27
|
}
|
|
29
28
|
export interface DB extends Executor {
|
|
30
29
|
beginTransaction(): Promise<Transaction>
|
|
@@ -63,7 +62,7 @@ export interface ApproversRepository {
|
|
|
63
62
|
getApprovers(tx?: Transaction): Promise<string[]>
|
|
64
63
|
}
|
|
65
64
|
export interface HistoryRepository<T> {
|
|
66
|
-
create(id: string, author: string,
|
|
65
|
+
create(id: string, author: string, data: T, tx?: Transaction): Promise<number>
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
|
|
@@ -100,5 +99,5 @@ export interface ApproversPort {
|
|
|
100
99
|
getApprovers(tx?: Transaction): Promise<string[]>
|
|
101
100
|
}
|
|
102
101
|
export interface HistoryPort<T> {
|
|
103
|
-
create(id: string, author: string,
|
|
102
|
+
create(id: string, author: string, data: T, tx?: Transaction): Promise<number>
|
|
104
103
|
}
|