feat(postgres): export all schemas in one SQL file

This commit is contained in:
zipg authored and GitHub committed 2026-09-07 23:20:46 +08:00
1 parent 0bacb5effd
commit 5efbe360d9
15 files changed
+452 -38

No files matched your search

+17
View File
@@ -53,6 +53,23 @@ test("all-database export includes every schema for schema-aware databases", ()
]);
});
test("all-database PostgreSQL export keeps all schemas in one database file", () => {
const plan = buildAllDatabaseExportPlan({
databases: ["app", "analytics"],
schemaAware: true,
schemasByDatabase: {
app: ["public", "private"],
analytics: ["reporting"],
},
dbType: "postgres",
});
assert.deepEqual(plan, [
{ database: "app", schema: "", fileStem: "app", displayName: "app" },
{ database: "analytics", schema: "", fileStem: "analytics", displayName: "analytics" },
]);
});
test("all-database export uses the database as schema for non-schema-aware databases", () => {
const plan = buildAllDatabaseExportPlan({
databases: ["app", "analytics"],