Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ddev import-db should accept data from /dev/stdin #1690

Closed
ghost opened this issue Jul 4, 2019 · 3 comments · Fixed by #1700
Closed

ddev import-db should accept data from /dev/stdin #1690

ghost opened this issue Jul 4, 2019 · 3 comments · Fixed by #1700
Labels
Prioritized We expect to do this in an upcoming release

Comments

@ghost
Copy link

ghost commented Jul 4, 2019

Is your feature request related to a problem? Please describe.
I have my SQL data stored in several files. I would like to import them to a DB.

Describe the solution you'd like
It would be nice to be able to pipe SQL data in ddev --import-db like

cat db/sql/struct/* db/sql/data/* | ddev --import-db

Describe alternatives you've considered

I use

cat db/sql/struct/* db/sql/data/* | docker exec -i ddev-<PROJECTNAME>-db mysql --default-character-set=utf8 db

as a workaround to pipe SQL data into the "mysql" command in the container.
Notice the docker exec -i which connects the host's stdin to the command.

@rfay
Copy link
Member

rfay commented Jul 4, 2019

Thanks!

@rfay
Copy link
Member

rfay commented Jul 10, 2019

Actually, #1700 gets us set up for this, but doesn't actually solve this problem, reopening.

@rfay rfay reopened this Jul 10, 2019
@rfay rfay changed the title --import-db could accept data from /dev/stdin ddev import-db should accept data from /dev/stdin Jul 10, 2019
rfay added a commit to rfay/ddev that referenced this issue Jul 10, 2019
rfay added a commit to rfay/ddev that referenced this issue Jul 15, 2019
@rfay rfay closed this as completed in 52c7915 Jul 16, 2019
@rfay
Copy link
Member

rfay commented Sep 18, 2019

The example in ddev import-db -h doesn't have any information about this usage, still needs to be added. Also we should check the docs.

@rfay rfay reopened this Sep 18, 2019
@rfay rfay added the Prioritized We expect to do this in an upcoming release label Sep 18, 2019
@rfay rfay closed this as completed in ad9f4f7 Oct 5, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Prioritized We expect to do this in an upcoming release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant