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

Endpoint that returns SQL ready to be piped into DB #25

Closed
simonw opened this issue Oct 24, 2017 · 2 comments
Closed

Endpoint that returns SQL ready to be piped into DB #25

simonw opened this issue Oct 24, 2017 · 2 comments

Comments

@simonw
Copy link
Owner

simonw commented Oct 24, 2017

It would be cool if I could figure out a way to generate both the create table statements and the inserts for an individual table or the entire database and then stream them down to the client.

@simonw simonw changed the title Endpoint that returns SQL Rudy to be piped into DB Endpoint that returns SQL ready to be piped into DB Oct 24, 2017
@simonw simonw added this to the v1 stretch goals milestone Oct 24, 2017
@simonw
Copy link
Owner Author

simonw commented Nov 12, 2017

con = sqlite3.connect('existing_db.db')
with open('dump.sql', 'w') as f:
    for line in con.iterdump():
        f.write('%s\n' % line)

@simonw simonw modified the milestones: v1 stretch goals, v2: visualization edition Nov 14, 2017
@simonw
Copy link
Owner Author

simonw commented Nov 15, 2017

Since you can already download the database directly, I'm not going to bother with this one.

@simonw simonw closed this as completed Nov 15, 2017
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

No branches or pull requests

1 participant