@chatman-media/storage 0.0.0 → 1.4.0
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/LICENSE +21 -0
- package/README.md +155 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5323 -0
- package/dist/integration-helpers.d.ts +26 -0
- package/dist/integration-helpers.d.ts.map +1 -0
- package/dist/migrations.integration.test.d.ts +2 -0
- package/dist/migrations.integration.test.d.ts.map +1 -0
- package/dist/rls.integration.test.d.ts +2 -0
- package/dist/rls.integration.test.d.ts.map +1 -0
- package/dist/schema.d.ts +9466 -0
- package/dist/schema.d.ts.map +1 -0
- package/package.json +10 -5
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Sql } from "postgres";
|
|
2
|
+
/**
|
|
3
|
+
* Открывает connection к Postgres'у и проверяет что он отвечает. Если
|
|
4
|
+
* DATABASE_URL не задан или connection падает — возвращает null. Tests
|
|
5
|
+
* вызывают это и if-null'ят весь suite (skip).
|
|
6
|
+
*/
|
|
7
|
+
export declare function tryConnectToPg(databaseUrl: string | undefined): Promise<Sql | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Создаёт чистую тестовую БД (DROP IF EXISTS + CREATE), возвращает её
|
|
10
|
+
* connection-URL. Owner connection используется только для CREATE/DROP;
|
|
11
|
+
* dedicated connection для самих тестов опен'тся через returned URL.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createIsolatedDb(opts: {
|
|
14
|
+
ownerUrl: string;
|
|
15
|
+
testDbName: string;
|
|
16
|
+
}): Promise<string>;
|
|
17
|
+
export declare function dropIsolatedDb(opts: {
|
|
18
|
+
ownerUrl: string;
|
|
19
|
+
testDbName: string;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Применяет все .sql миграции из packages/storage/migrations/ к connection
|
|
23
|
+
* в правильном порядке (0000, 0001, ...).
|
|
24
|
+
*/
|
|
25
|
+
export declare function applyAllMigrations(sql: Sql, migrationsDir: string): Promise<string[]>;
|
|
26
|
+
//# sourceMappingURL=integration-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-helpers.d.ts","sourceRoot":"","sources":["../src/integration-helpers.ts"],"names":[],"mappings":"AAWA,OAAiB,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAE9C;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAUzF;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBlB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAWlG;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAS3F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.integration.test.d.ts","sourceRoot":"","sources":["../src/migrations.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rls.integration.test.d.ts","sourceRoot":"","sources":["../src/rls.integration.test.ts"],"names":[],"mappings":""}
|