Skip to content

Conversation

@jkeuhlen
Copy link
Contributor

@jkeuhlen jkeuhlen commented Aug 1, 2025

This is a redo of #21 with a slightly different direction.

Pulling the motivation from that PR:
Generally, when using ripoff I tend to do the following:

  • Work on a feature in my normal way.
  • When a feature is finished, I want to persist the locally created DB state as my known "good" state for future development.
  • run ripoff-export and do any manual tweaks that are needed.
  • In the future, I can run ripoff db/fake-data to reset to my known good state for development.

One annoying thing (that this PR attempts to solve) is that I use created_at/updated_at timestamps on every table in my database so each ripoff-export invocation touches every table definition in my saved dataset.

--exclude-columns allows you to specify either table.column or column that should be excluded by name from every table. This lets you export a smaller set of data and prevents noise for DB-controlled columns like timestamps.

Comment on lines +362 to +365
// Test 3: Combine both exclusion types
t.Run("Combined exclusions", func(t *testing.T) {
ripoffFile, err := ExportToRipoff(ctx, tx, []string{}, []string{"created_at", "users.email"})
require.NoError(t, err)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine if the test only includes a combined case like this fwiw. But more tests == more good, probably

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to have a lot more individual tests lately. I'm not sure if it's actually good, but having overlapping test edges tends to be more protective over the long term in my experience. Happy to prune it down to a more targeted system though if you'd prefer.

@mortenson mortenson merged commit bc3aad7 into mortenson:main Aug 5, 2025
2 checks passed
@mortenson
Copy link
Owner

merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants