-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added create-snapshot/restore-snapshot on the sidecar CLI + readme #146
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start with these comments, most will apply to the restore command as well.
28d0a01
to
fced33b
Compare
e82ecf8
to
16e4fa0
Compare
16e4fa0
to
b0aa969
Compare
b0aa969
to
47ab80f
Compare
47ab80f
to
6e57ade
Compare
6e57ade
to
d98d704
Compare
pkg/postgres/postgres.go
Outdated
return testDbName, pg, grm, nil | ||
} | ||
|
||
func GetTestPostgresDatabaseNoMigrations(cfg config.DatabaseConfig, l *zap.Logger) ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By more composable I meant:
GetTestPostgresDatabase()
<-- get the database, but dont run the migrator
GetTestPostgresDatabaseWithMigrations()
<-- should call GetTestPostgresDatabase
and subsequently run the migrations.
But to do this without breaking things, youd first need to rename GetTestPostgresDatabase
across the project to GetTestPostgresDatabaseWithMigrations
then re-introduce GetTestPostgresDatabase
7bdda71
to
3a8b883
Compare
Issue found with providing a output_file path of
|
Restoring a snapshot that was dumped using a schema (e.g. # implicitly uses the public schema
go run main.go create-snapshot \
--ethereum.rpc-url="..." \
--chain="preprod" \
--database.host="localhost" \
--database.port="5432" \
--database.user="seanmcgary" \
--database.password="" \
--database.db_name="sidecar_testnet_holesky" \
--ethereum.use_native_batch_call=false \
--input_file=/Users/seanmcgary/snapshot-test
# specifies a schema that is not public
go run main.go restore-snapshot \
--ethereum.rpc-url="..." \
--chain="preprod" \
--database.host="localhost" \
--database.port="5432" \
--database.user="seanmcgary" \
--database.password="" \
--database.db_name="sidecar_testnet_holesky" \
--ethereum.use_native_batch_call=false \
--input_file=/Users/seanmcgary/snapshot-test \
--database.schema_name=test |
…ecouple config.go module from snapshot module
e18c32d
to
cc5b1fe
Compare
More detail here: I thought about this case a fair bit, |
@@ -0,0 +1,58 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're adding this, why is this not part of the cli directly as a flag that the user can pass?
Loom to show the working create and restore:
https://www.loom.com/share/0022a4cac88343999505ae452992768b?sid=a2e1bd4e-6054-4cb1-92d2-8507d48f28f9