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

(new) copying between databases? #473

Closed
stokebreakup opened this issue Jul 4, 2024 · 1 comment
Closed

(new) copying between databases? #473

stokebreakup opened this issue Jul 4, 2024 · 1 comment

Comments

@stokebreakup
Copy link

stokebreakup commented Jul 4, 2024

hey there!

I use usql a lot in testing environments and for personal projects. I wonder if we can't have something similar to ingestr(ingestr is a CLI tool to copy data between any databases with a single command seamlessly) in a simple way. I'm going to transcribe what I read from the documentation, and then ask something technical that I didn't find and that I consider important to ask.

"Copying Between Databases
usql provides a \copy command that reads data from a source database DSN and writes to a destination database DSN:

(not connected)=> \cset PGDSN postgres://user:pass@localhost
(not connected)=> \cset MYDSN mysql://user:pass@localhost
(not connected)=> \copy PGDSN MYDSN 'select book_id, author_id from books' 'books(id, author_id)'

As demonstrated above, the \copy command does not require being connected to a database, and will not modify or change the current open database connection or state.

Why do I need to type so many sql commands when I could simply copy the database from one location to another if I just had to add their url or single command seamlessly? are pull requests about this welcome? would something similar to this be good for usql?

usql \copy 
    --source-uri 'postgresql://admin:admin@localhost:8837/web?sslmode=disable' \
    --source-table 'public.some_data' \
    --dest-uri 'bigquery://<your-project-name>?credentials_path=/path/to/service/account.json' \
    --dest-table 'usql-copy.some_data'

regards,

@stokebreakup stokebreakup changed the title new \copy? (new) copying between databases? Jul 4, 2024
@kenshaw
Copy link
Member

kenshaw commented Jul 4, 2024

@stokebreakup we would be interested in a more robust/better implementation. Please feel free to make a PR and we'll consider it.

@stokebreakup stokebreakup closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2024
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

2 participants