@vlcn.io/xplat-api
Advanced tools
Comparing version 0.7.0 to 0.8.0-next.0
@@ -23,4 +23,9 @@ export type DELETE = 9; | ||
} | ||
export type DBAsync = { | ||
readonly siteid: string; | ||
export type TMutex = { | ||
runExclusive<T>(cb: () => Promise<T> | T): Promise<T>; | ||
acquire(): Promise<() => void>; | ||
release(): void; | ||
}; | ||
export interface TXAsync { | ||
readonly __mutex: TMutex; | ||
execMany(sql: string[]): Promise<void>; | ||
@@ -30,9 +35,13 @@ exec(sql: string, bind?: unknown[]): Promise<void>; | ||
execA<T extends any[]>(sql: string, bind?: unknown[]): Promise<T[]>; | ||
prepare(sql: string): Promise<StmtAsync>; | ||
tx(cb: (tx: TXAsync) => Promise<void>): Promise<void>; | ||
imperativeTx(): Promise<[() => void, TXAsync]>; | ||
} | ||
export interface DBAsync extends TXAsync { | ||
readonly siteid: string; | ||
readonly filename: string; | ||
close(): Promise<void>; | ||
onUpdate(cb: (type: UpdateType, dbName: string, tblName: string, rowid: bigint) => void): () => void; | ||
prepare(sql: string): Promise<StmtAsync>; | ||
createFunction(name: string, fn: (...args: any) => unknown, opts?: {}): void; | ||
savepoint(cb: () => Promise<void>): Promise<void>; | ||
transaction(cb: () => Promise<void>): Promise<void>; | ||
}; | ||
} | ||
export interface Stmt { | ||
@@ -48,11 +57,11 @@ run(...bindArgs: any[]): void; | ||
export interface StmtAsync { | ||
run(...bindArgs: any[]): Promise<void>; | ||
get(...bindArgs: any[]): Promise<any>; | ||
all(...bindArgs: any[]): Promise<any[]>; | ||
iterate<T>(...bindArgs: any[]): AsyncIterator<T>; | ||
run(tx: TXAsync | null, ...bindArgs: any[]): Promise<void>; | ||
get(tx: TXAsync | null, ...bindArgs: any[]): Promise<any>; | ||
all(tx: TXAsync | null, ...bindArgs: any[]): Promise<any[]>; | ||
iterate<T>(tx: TXAsync | null, ...bindArgs: any[]): AsyncIterator<T>; | ||
raw(isRaw?: boolean): this; | ||
bind(args: readonly any[]): this; | ||
finalize(): void; | ||
finalize(tx: TXAsync | null): Promise<void>; | ||
} | ||
export declare const version = 1; | ||
//# sourceMappingURL=xplat-api.d.ts.map |
{ | ||
"name": "@vlcn.io/xplat-api", | ||
"type": "module", | ||
"version": "0.7.0", | ||
"version": "0.8.0-next.0", | ||
"files": [ | ||
@@ -12,3 +12,4 @@ "dist" | ||
"devDependencies": { | ||
"typescript": "^4.8.4" | ||
"typescript": "^4.8.4", | ||
"vitest": "^0.25.2" | ||
}, | ||
@@ -26,4 +27,5 @@ "repository": { | ||
"watch": "tsc --build --watch", | ||
"deep-clean": "rm -rf ./dist || true && rm tsconfig.tsbuildinfo || true" | ||
"deep-clean": "rm -rf ./dist || true && rm tsconfig.tsbuildinfo || true", | ||
"test": "vitest run" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10
72
7931
2
1