@fonderie/store 0.1.1 → 0.1.2
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/brain/signatures.md +50 -0
- package/package.json +5 -4
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<!-- GENERATED — do not edit. Regenerate with: npm run docs:signatures -->
|
|
2
|
+
|
|
3
|
+
# @fonderie/store — signatures
|
|
4
|
+
|
|
5
|
+
## @fonderie/store
|
|
6
|
+
|
|
7
|
+
Subpath exports: `@fonderie/store/sql`, `@fonderie/store/types`, `@fonderie/store/migrations`
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function sql(strings: TemplateStringsArray, ...values: unknown[]): ISqlQuery
|
|
11
|
+
|
|
12
|
+
interface ISqlQuery {
|
|
13
|
+
text: string;
|
|
14
|
+
params: unknown[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface IStoreAdapter {
|
|
18
|
+
query<T = unknown>(sql: string, params?: unknown[]): Promise<T[]>;
|
|
19
|
+
transaction<T>(fn: (tx: IStoreAdapter) => Promise<T>): Promise<T>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface IPoolConfig {
|
|
23
|
+
connectionString?: string;
|
|
24
|
+
host?: string;
|
|
25
|
+
port?: number;
|
|
26
|
+
database?: string;
|
|
27
|
+
user?: string;
|
|
28
|
+
password?: string;
|
|
29
|
+
max?: number;
|
|
30
|
+
idleTimeoutMillis?: number;
|
|
31
|
+
connectionTimeoutMillis?: number;
|
|
32
|
+
ssl?: boolean | {
|
|
33
|
+
rejectUnauthorized: boolean;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
new MigrationRunner(store: IStoreAdapter, migrationsDir: string): MigrationRunner
|
|
38
|
+
.run(): Promise<void>
|
|
39
|
+
|
|
40
|
+
new InternalMigrationRunner(store: IStoreAdapter, migrationsDir: string): InternalMigrationRunner
|
|
41
|
+
.run(): Promise<void>
|
|
42
|
+
|
|
43
|
+
function createMigrationsPath(importMetaUrl: string): string
|
|
44
|
+
|
|
45
|
+
new PGAdapter(config: string | IPoolConfig): PGAdapter
|
|
46
|
+
.testConnection(): Promise<boolean>
|
|
47
|
+
.query<T = unknown>(sql: string, params?: unknown[] | undefined): Promise<T[]>
|
|
48
|
+
.transaction<T>(fn: (tx: IStoreAdapter) => Promise<T>): Promise<T>
|
|
49
|
+
.end(): Promise<void>
|
|
50
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonderie/store",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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",
|
|
@@ -66,16 +66,17 @@
|
|
|
66
66
|
},
|
|
67
67
|
"files": [
|
|
68
68
|
"dist",
|
|
69
|
+
"brain",
|
|
69
70
|
"LICENSE",
|
|
70
71
|
"README.md"
|
|
71
72
|
],
|
|
72
73
|
"repository": {
|
|
73
74
|
"type": "git",
|
|
74
|
-
"url": "git+https://github.com/
|
|
75
|
+
"url": "git+https://github.com/fonderiejs/sdk.git",
|
|
75
76
|
"directory": "packages/store"
|
|
76
77
|
},
|
|
77
|
-
"homepage": "https://github.com/
|
|
78
|
+
"homepage": "https://github.com/fonderiejs/sdk/tree/main/packages/store#readme",
|
|
78
79
|
"bugs": {
|
|
79
|
-
"url": "https://github.com/
|
|
80
|
+
"url": "https://github.com/fonderiejs/sdk/issues"
|
|
80
81
|
}
|
|
81
82
|
}
|