Skip to content

Conversation

@Mytherin
Copy link
Contributor

@Mytherin Mytherin commented Nov 7, 2023

Implements #78

The postgres_query builds on the new attach functionality, and takes a reference to a currently attached Postgres database to run the query within. Signature:

postgres_query(attached_database::VARCHAR, query::VARCHAR)

Example:

D ATTACH 'dbname=postgresscanner' AS s (TYPE POSTGRES);
D SELECT * FROM postgres_query('s', 'SELECT * FROM cars LIMIT 3');
┌──────────────┬───────────┬─────────┐
│    brand     │   model   │  color  │
│   varcharvarcharvarchar │
├──────────────┼───────────┼─────────┤
│ ferari       │ testarosa │ red     │
│ aston martin │ db2       │ blue    │
│ bentley      │ mulsanne  │ gray    │
└──────────────┴───────────┴─────────┘

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.

1 participant