Skip to content

Commit

Permalink
feat: Apply the same transformation references
Browse files Browse the repository at this point in the history
- Revised context initialization logic
- Added comments for clarity
- Refined introspection queries
- Updated logic for partition table transformation inheritance
- Removed artifacts and unused attributes
- Simplified table configuration initialization by decomposing it into smaller functions
  • Loading branch information
wwoytenko committed Oct 31, 2024
1 parent ed0b9b0 commit 40274fe
Show file tree
Hide file tree
Showing 20 changed files with 619 additions and 354 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ install:
# The build flag -tags=viper_bind_struct has been added to avoid the need to bind each of the environment variables
build: $(CMD_FILES)
CGO_ENABLED=0 go build -tags=viper_bind_struct -ldflags="$(LDFLAGS)" -v -o $(CMD_NAME) $(MAIN_PATH)

lint:
golangci-lint run ./...

up:
docker-compose up playground-dbs-filler
2 changes: 1 addition & 1 deletion internal/db/postgres/cmd/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (d *Dump) startMainTx(ctx context.Context, conn *pgx.Conn) (pgx.Tx, error)

func (d *Dump) buildContextAndValidate(ctx context.Context, tx pgx.Tx) (err error) {
d.context, err = runtimeContext.NewRuntimeContext(
ctx, tx, d.config.Dump.Transformation, d.registry, d.pgDumpOptions,
ctx, tx, &d.config.Dump, d.registry,
d.config.Dump.VirtualReferences, d.version,
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/db/postgres/cmd/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func (v *Validate) Run(ctx context.Context) (int, error) {
v.config.Dump.Transformation = tablesToValidate

v.context, err = runtimeContext.NewRuntimeContext(
ctx, tx, v.config.Dump.Transformation, v.registry,
v.pgDumpOptions, v.config.Dump.VirtualReferences, v.version,
ctx, tx, &v.config.Dump, v.registry,
v.config.Dump.VirtualReferences, v.version,
)
if err != nil {
return nonZeroExitCode, fmt.Errorf("unable to build runtime context: %w", err)
Expand Down
Loading

0 comments on commit 40274fe

Please sign in to comment.