@onreza/sqlx-js 0.4.0 → 0.6.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/README.md +139 -48
- package/ROADMAP.md +1 -3
- package/dist/bin/sqlx-js-diagnostics.d.ts +2 -0
- package/dist/bin/sqlx-js-diagnostics.js +96 -0
- package/dist/bin/sqlx-js.js +337 -89
- package/dist/src/artifacts.d.ts +9 -0
- package/dist/src/artifacts.js +26 -0
- package/dist/src/cache.d.ts +17 -0
- package/dist/src/cache.js +83 -1
- package/dist/src/codegen.js +14 -2
- package/dist/src/commands/doctor.d.ts +16 -0
- package/dist/src/commands/doctor.js +196 -0
- package/dist/src/commands/init.js +93 -13
- package/dist/src/commands/migrate.d.ts +2 -101
- package/dist/src/commands/migrate.js +11 -566
- package/dist/src/commands/pgschema.d.ts +6 -0
- package/dist/src/commands/pgschema.js +30 -0
- package/dist/src/commands/prepare.d.ts +41 -6
- package/dist/src/commands/prepare.js +440 -63
- package/dist/src/commands/schema.js +1 -1
- package/dist/src/commands/watch.d.ts +1 -0
- package/dist/src/commands/watch.js +23 -9
- package/dist/src/config.d.ts +22 -0
- package/dist/src/config.js +149 -11
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.js +2 -1
- package/dist/src/migration-core.d.ts +157 -0
- package/dist/src/migration-core.js +578 -0
- package/dist/src/postgres-runtime.d.ts +3 -0
- package/dist/src/postgres-runtime.js +66 -29
- package/dist/src/runtime.d.ts +36 -3
- package/dist/src/runtime.js +92 -23
- package/dist/src/scan/scanner.d.ts +10 -3
- package/dist/src/scan/scanner.js +83 -32
- package/dist/src/type-inspection.d.ts +1 -0
- package/dist/src/type-inspection.js +20 -0
- package/dist/src/typed.d.ts +10 -0
- package/package.json +11 -6
|
@@ -7,7 +7,42 @@ export type PrepareOptions = {
|
|
|
7
7
|
cacheDir: string;
|
|
8
8
|
dtsPath: string;
|
|
9
9
|
check: boolean;
|
|
10
|
+
verify?: boolean;
|
|
11
|
+
json?: boolean;
|
|
10
12
|
prune?: boolean;
|
|
13
|
+
strictInference?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type PrepareDiagnosticPhase = "config" | "connect" | "shadow" | "scan" | "describe" | "result-shape" | "introspect" | "analyze" | "param-map" | "inference" | "cache" | "verify";
|
|
16
|
+
export declare class PrepareFatalError extends Error {
|
|
17
|
+
readonly phase: PrepareDiagnosticPhase;
|
|
18
|
+
readonly file?: string;
|
|
19
|
+
readonly line?: number;
|
|
20
|
+
readonly column?: number;
|
|
21
|
+
constructor(phase: PrepareDiagnosticPhase, message: string, location?: {
|
|
22
|
+
file?: string;
|
|
23
|
+
line?: number;
|
|
24
|
+
column?: number;
|
|
25
|
+
}, options?: ErrorOptions);
|
|
26
|
+
}
|
|
27
|
+
export type PrepareDiagnostic = {
|
|
28
|
+
severity: "error" | "warning";
|
|
29
|
+
phase: PrepareDiagnosticPhase;
|
|
30
|
+
message: string;
|
|
31
|
+
file?: string;
|
|
32
|
+
line?: number;
|
|
33
|
+
column?: number;
|
|
34
|
+
query?: string;
|
|
35
|
+
code?: string;
|
|
36
|
+
position?: number;
|
|
37
|
+
hint?: string;
|
|
38
|
+
};
|
|
39
|
+
export type PrepareResult = {
|
|
40
|
+
sites: number;
|
|
41
|
+
entries: number;
|
|
42
|
+
failures: number;
|
|
43
|
+
pruned: number;
|
|
44
|
+
functions: number;
|
|
45
|
+
diagnostics: PrepareDiagnostic[];
|
|
11
46
|
};
|
|
12
47
|
export type PrepareSession = {
|
|
13
48
|
client: PgClient;
|
|
@@ -28,11 +63,11 @@ export declare function describeAll(cfg: ConnConfig, sessionClient: PgClient, qu
|
|
|
28
63
|
fp: string;
|
|
29
64
|
query: string;
|
|
30
65
|
}[], concurrency: number): Promise<Map<string, DescribeOutcome>>;
|
|
31
|
-
export declare function prepareOnce(opts: PrepareOptions, session: PrepareSession, log?: (msg: string) => void, err?: (msg: string) => void, concurrency?: number): Promise<
|
|
32
|
-
entries: number;
|
|
33
|
-
failures: number;
|
|
34
|
-
pruned: number;
|
|
35
|
-
functions: number;
|
|
36
|
-
}>;
|
|
66
|
+
export declare function prepareOnce(opts: PrepareOptions, session: PrepareSession, log?: (msg: string) => void, err?: (msg: string) => void, concurrency?: number): Promise<PrepareResult>;
|
|
37
67
|
export declare function runPrepare(opts: PrepareOptions): Promise<void>;
|
|
68
|
+
export declare function verifyPrepareArtifacts(opts: PrepareOptions, log?: (msg: string) => void, err?: (msg: string) => void): Promise<{
|
|
69
|
+
ok: boolean;
|
|
70
|
+
result: PrepareResult;
|
|
71
|
+
changed: string[];
|
|
72
|
+
}>;
|
|
38
73
|
export {};
|