Skip to content
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

Support bigger seed.sql files using docker copy #295

Merged
merged 2 commits into from
Jul 4, 2022
Merged

Support bigger seed.sql files using docker copy #295

merged 2 commits into from
Jul 4, 2022

Conversation

snorremd
Copy link
Contributor

@snorremd snorremd commented Jul 3, 2022

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

For seed.sql files that exceed the maximum argument length of the Linux distribution used to run the Postgres container the postgres -c command will fail. Supabase CLI will then silently fail to apply the seed file.

See related StackOverflow Max size of string CMD that can be passed to Docker answer about command argument sizes.

#277 (See related comment)
#274 (I think this might be related, but not sure)

What is the new behavior?

A new Docker utility function DockerAddFile can be used to write a byte buffer to a container, in this case the seed.sql file. Then migrating the seed file is just a matter of using the file option of the pgsql command rather than the command option.

Additional context

Let me know if the code needs some adjustments and if the selected approach is good or not.

snorremd added 2 commits July 3, 2022 13:06
For seed.sql files that exceed the maximum argument length of the Linux
distribution used to run the Postgres container the postgres -c command
will fail. Supabase CLI will then silently fail to apply the seed file.

A new Docker utility function DockerAddFile can be used to write a byte
buffer to a container, in this case the seed.sql file. Then migrating
the seed file is just a matter of using the file option of the pgsql
command rather than the command option.

Signed-off-by: Snorre Magnus Davøen <post@snorre.io>
Signed-off-by: Snorre Magnus Davøen <post@snorre.io>
@snorremd snorremd changed the title WIP: Support bigger seed.sql files using docker copy Support bigger seed.sql files using docker copy Jul 3, 2022
@snorremd snorremd marked this pull request as ready for review July 3, 2022 11:33
@soedirgo
Copy link
Member

soedirgo commented Jul 4, 2022

LGTM, thanks for this!

@soedirgo soedirgo merged commit 25689f1 into supabase:main Jul 4, 2022
@github-actions
Copy link

github-actions bot commented Jul 4, 2022

🎉 This PR is included in version 0.28.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@snorremd
Copy link
Contributor Author

snorremd commented Jul 5, 2022

LGTM, thanks for this!

My pleasure. Thank you for reviewing and merging this so fast! This will improve my development flow so much!

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