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

ATTACH/DETACH syntax to open catalogs. #2774

Open
universalmind303 opened this issue Mar 12, 2024 · 0 comments
Open

ATTACH/DETACH syntax to open catalogs. #2774

universalmind303 opened this issue Mar 12, 2024 · 0 comments
Labels
feat 🎇 New feature or request syntax Issues or features related to our SQL syntax

Comments

@universalmind303
Copy link
Contributor

Description

Currently there is no way through SQL to attach to a remote instance for hybrid execution, or to an alternative catalog.

We can do this through the \open command in the cli (or the -l flag)

> glaredb -l db_1 # create a new catalog `db_1`
>> create table test as select 1;
>> \open db2 # create a new catalog `db_2`
>> create table test as select 2;
>> \open glaredb://... # connect to a cloud instance

but currently it's impossible to do that through sql, so i couldn't do something like this without introducing a scripting language.

copy_from_multiple_catalogs.sql

ATTACH db_1;
copy (select * from test) to 'db_1_out.csv'

ATTACH db_2;
copy (select * from test) to 'db_2_out.csv'
> glaredb -q copy_from_multiple_catalogs.sql
@universalmind303 universalmind303 added the feat 🎇 New feature or request label Mar 12, 2024
@universalmind303 universalmind303 added the syntax Issues or features related to our SQL syntax label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 🎇 New feature or request syntax Issues or features related to our SQL syntax
Projects
None yet
Development

No branches or pull requests

1 participant