-
Notifications
You must be signed in to change notification settings - Fork 24
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
Expose the internal default connection and sql
function?
#32
Comments
sql
function?sql
function?
This function and the associated |
Thank you for your reply. https://duckdb.org/docs/archive/0.9.2/guides/python/import_pandas import duckdb
import pandas
# Create a Pandas dataframe
my_df = pandas.DataFrame.from_dict({'a': [42]})
# create the table "my_table" from the DataFrame "my_df"
# Note: duckdb.sql connects to the default in-memory database connection
duckdb.sql("CREATE TABLE my_table AS SELECT * FROM my_df")
# insert into the table "my_table" from the DataFrame "my_df"
duckdb.sql("INSERT INTO my_table SELECT * FROM my_df") Here, the connection specification and the registration of the |
sql
function?sql
function?
Can we do a draft/pilot in a separate package, on top of DBI, before committing here? |
I don't have time to work on this right away, but I'm assuming the same thing below that you can use with polarssql. https://rpolars.github.io/r-polarssql/reference/polarssql_query.html polarssql_register(mtcars = mtcars)
query <- "SELECT * FROM mtcars LIMIT 5"
# Returns a polars LazyFrame
polarssql_query(query)
# Clean up
polarssql_unregister("mtcars") |
I noticed this |
The
sql
function used internally would be useful to perform processing via DuckDB. (e.g., reading Parquet files).duckdb-r/R/sql.R
Lines 1 to 15 in d243b53
Would you consider exporting this with a name like
duckdb_query
?The text was updated successfully, but these errors were encountered: