symmetria-kit 3.3.0 → 3.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/dist/cli/query-inspect.js +1 -1
- package/dist/cli.js +7 -6
- package/dist/cli.js.map +1 -1
- package/dist/{ddl-CYsBI6_H.js → ddl-CtdVeD9m.js} +62 -6
- package/dist/ddl-CtdVeD9m.js.map +1 -0
- package/dist/{diff-D2EbyDmY.js → diff-DA7huWi5.js} +589 -93
- package/dist/diff-DA7huWi5.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/{query-inspector-CBU9Ug5e.js → query-inspector-C-7K9wtB.js} +2 -2
- package/dist/{query-inspector-CBU9Ug5e.js.map → query-inspector-C-7K9wtB.js.map} +1 -1
- package/dist/{src-Dog3TEh8.js → src-J1Nn7Wca.js} +47 -307
- package/dist/src-J1Nn7Wca.js.map +1 -0
- package/dist/testing.js +1 -1
- package/package.json +2 -2
- package/dist/ddl-CYsBI6_H.js.map +0 -1
- package/dist/diff-D2EbyDmY.js.map +0 -1
- package/dist/src-Dog3TEh8.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as explainLines, n as inspectQueryScreen, r as inspectValue, i as terminalText, a as wrapExplainLines } from "../query-inspector-
|
|
1
|
+
export { t as explainLines, n as inspectQueryScreen, r as inspectValue, i as terminalText, a as wrapExplainLines } from "../query-inspector-C-7K9wtB.js";
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { _ as migrationSnapshot, x as snapshotHash, y as parseMigrationSnapshot } from "./ddl-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { A as terminalWidth, C as view, D as formatError, E as fitLine, M as wrapLines, O as numberedLines, S as choose, T as withSpinner, _ as formatHelp, a as wrapExplainLines, b as formatStatus, c as inspectTableSQL, d as matchesTableName, f as matchingTables, g as formatExecution, h as formatDiff, i as terminalText, j as theme, k as supportsColor, l as inspectTabs, m as formatDashboard, o as highlightSQL, p as formatCreated, s as inspectEntries, t as explainLines, u as matchesEntry, v as formatPullWarnings, w as withScreen, x as ask, y as formatSchema } from "./query-inspector-
|
|
2
|
+
import { _ as migrationSnapshot, x as snapshotHash, y as parseMigrationSnapshot } from "./ddl-CtdVeD9m.js";
|
|
3
|
+
import { c as parseMigrationSQL, g as formatDriftFindings, h as detectDrift, i as diffSchemas, o as lintMigrationSQL } from "./diff-DA7huWi5.js";
|
|
4
|
+
import { a as boundaryDifferences, c as MigrationExecutionError, d as loadMigrationState, g as lintMigration, h as formatLintFindings, l as discardMigration, m as recoverMigrationFiles, n as schemaGraph, o as verifyMigrations, p as squashMigrations, r as pullSchema, s as migrator, t as renderMermaid, u as generateMigration } from "./src-J1Nn7Wca.js";
|
|
5
|
+
import { A as terminalWidth, C as view, D as formatError, E as fitLine, M as wrapLines, O as numberedLines, S as choose, T as withSpinner, _ as formatHelp, a as wrapExplainLines, b as formatStatus, c as inspectTableSQL, d as matchesTableName, f as matchingTables, g as formatExecution, h as formatDiff, i as terminalText, j as theme, k as supportsColor, l as inspectTabs, m as formatDashboard, o as highlightSQL, p as formatCreated, s as inspectEntries, t as explainLines, u as matchesEntry, v as formatPullWarnings, w as withScreen, x as ask, y as formatSchema } from "./query-inspector-C-7K9wtB.js";
|
|
6
6
|
import * as nodeModule from "node:module";
|
|
7
7
|
import { access, lstat, mkdir, open, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
8
|
-
import { basename, dirname, extname, relative, resolve } from "node:path";
|
|
8
|
+
import { basename, dirname, extname, join, relative, resolve } from "node:path";
|
|
9
9
|
import { parseArgs, stripVTControlCharacters } from "node:util";
|
|
10
10
|
import { postgres } from "symmetria/driver";
|
|
11
11
|
import { sqlState } from "symmetria";
|
|
@@ -825,7 +825,8 @@ const squash = async (context, project, name) => {
|
|
|
825
825
|
const discard = async (context, project, id) => {
|
|
826
826
|
const { values } = context;
|
|
827
827
|
const { migrations } = await loadMigrationState(project.directory).catch(() => ({ migrations: [] }));
|
|
828
|
-
const
|
|
828
|
+
const listed = migrations.length ? void 0 : await readFile(join(project.directory, "meta", "migration.json"), "utf8").then((text) => JSON.parse(text).migrations?.at(-1)?.id, () => void 0);
|
|
829
|
+
const latest = migrations.at(-1)?.id ?? (typeof listed === "string" ? listed : void 0);
|
|
829
830
|
if (latest !== void 0) {
|
|
830
831
|
if (project.databaseUrl) {
|
|
831
832
|
const driver = postgres(project.databaseUrl);
|