Heal the layer break around the Id<> type

This commit is contained in:
Tau
2019-11-06 17:29:07 -05:00
parent 3a71f5054c
commit 6a4ac795b2
24 changed files with 96 additions and 60 deletions
+12 -1
View File
@@ -1,12 +1,23 @@
import * as sql from "sql-bricks-postgres";
export type Id<T> = bigint & { __id: T };
import { Id } from "../model";
export interface Row {
[key: string]: string;
}
export interface Transaction {
/**
* Generate a new random primary key.
*
* On SQLite this is a random 63-bit integer (the high bit is always zero
* so that all IDs are positive, mostly for aesthetic reasons although this
* may also usefully reserve a namespace for automated testing).
*
* On Postgres this might generate UUIDv4s instead.
*/
generateId<T>(): Id<T>;
modify(stmt: sql.Statement): Promise<void>;
fetchRow(stmt: sql.SelectStatement): Promise<Row | undefined>;