@fonderie/store 0.1.0 → 0.1.1

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.
@@ -0,0 +1,22 @@
1
+ interface IStoreAdapter {
2
+ query<T = unknown>(sql: string, params?: unknown[]): Promise<T[]>;
3
+ transaction<T>(fn: (tx: IStoreAdapter) => Promise<T>): Promise<T>;
4
+ }
5
+
6
+ declare class MigrationRunner {
7
+ private store;
8
+ private migrationsDir;
9
+ constructor(store: IStoreAdapter, migrationsDir: string);
10
+ run(): Promise<void>;
11
+ protected assertNoReservedPrefix(file: string, sql: string): void;
12
+ private ensureTable;
13
+ private getApplied;
14
+ private getFiles;
15
+ }
16
+ declare class InternalMigrationRunner extends MigrationRunner {
17
+ protected assertNoReservedPrefix(_file: string, _sql: string): void;
18
+ }
19
+
20
+ declare function createMigrationsPath(importMetaUrl: string): string;
21
+
22
+ export { InternalMigrationRunner, MigrationRunner, createMigrationsPath };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonderie/store",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Database abstraction layer — IStoreAdapter interface, PostgreSQL driver, sequential migration runner, and SQL tagged-template helpers. The only package every other module depends on.",
5
5
  "keywords": [
6
6
  "fonderie-js",
@@ -43,7 +43,7 @@
43
43
  "module": "./dist/index.js",
44
44
  "types": "./dist/index.d.ts",
45
45
  "scripts": {
46
- "build": "tsup",
46
+ "build": "tsup && tsup --config tsup.migrations.ts",
47
47
  "dev": "tsup --watch",
48
48
  "typecheck": "tsc --noEmit",
49
49
  "test": "tsx --test src/__tests__/*.test.ts",