Add an SQL DB abstraction layer

Because what self-respecting Enterprise(R) project doesn't have
one of those?
This commit is contained in:
Tau
2019-11-06 17:28:30 -05:00
parent 2ccd9dc382
commit 3e6b4f4798
32 changed files with 440 additions and 541 deletions
+11
View File
@@ -1 +1,12 @@
import { randomBytes } from "crypto";
export type AimeId = number & { __aimeId: null };
/** Generate a random 32-bit ID for use in external protocol messages */
export function generateExtId(): number {
const buf = randomBytes(4);
buf[0] &= 0x7f; // Force number to be non-negative
return buf.readUInt32BE(0);
}