Repository navigation
feat: add squix export backup/schema subcommands via native pg_dump - #82
Open
DeprecatedLuar wants to merge 2 commits into
Open
DeprecatedLuar wants to merge 2 commits into
DeprecatedLuar wants to merge 2 commits into
Conversation
Add internal/backup/ (Dumper interface, ResolveFormat/ResolvePath helpers, factory, postgresDumper wrapping pg_dump) and wire `squix export [path] --backup [--format <fmt>]` into cmd/squix/export.go, app.go, help.go, and completion.go. Postgres-only this phase; other engines error clearly. Verified end-to-end against a live Postgres container (default/subdir/plain exports, pg_restore --list, format-conflict and missing-engine/missing-binary error paths) plus unit tests for ResolveFormat/ResolvePath.
Restructures `squix export` into `backup` and `schema` subcommands (replacing the old `--backup` flag), and adds pg_dump --schema-only support with optional -t/--table narrowing for schema-only dumps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basically added this:
squix export backup: it wraps the native db cli tool to produce exports for backup (currently Postgres only, viapg_dumpsince I do not use other database types)squix export schema: a schema-only (DDL) export, with optional--table <name>to dump specific tables.--format(custom/plain/tar);backupdefaults tocustom,schemadefaults toplain.--tableis only forexport schema; it just fails on anything else.About the decision:
Using the native dumps preserves with max fidelity (types, indexes, constraints). Using generic row export would get exponentially more complex for engine specific implementation, and schema-only exports are useful for sharing/diffing structure without data.
Test plan
ResolveFormat/ResolvePath/pgDumpArgsininternal/backup/backup_test.gotest/integration/export_test.gocovering usage errors, unsupported-engine errors, and--tablemisuse--table,pg_restore --listsanity check, and format-conflict / missing-engine / missing-binary error paths