-
Notifications
You must be signed in to change notification settings - Fork 74
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
Think about splitting dbWriteTable() #74
Comments
We'll also need |
Also, Postgres: |
Is there anything I can do to accelerate this? |
Also facing issues with the limited framework for DDL statements offered by DBI, I started working on sqlr. The underlying problem is not resolved by adding INSERT/REPLACE and IGNORE switches to DBI might not the place for such added features. I believe there to be merit in having a separate package, focused on building SQL statements (#72). This could then in turn be used in DBI/DB back ends, as well as for packages such as dbplyr. Dplyr already provides the translation of vector expressions and functions from R to SQL. But its scope is limited to the implementation of dplyr verbs (#170). We therefore need a tool which covers a more complete range of SQL, perhaps by combining the SQL capabilities of dbplyr and with something like I started with sqlr. I'd be happy to help out any way I can. |
I planned to tackle the remaining DBI issues after RPostgres, maybe early December? I can shift priorities, though. sqlr already seems way more powerful than the DBI interface will ever be. We should discuss if it's worthwhile to define a new DBI interface at all, or if we should leave DDL issues to sqlr. It would be great to have a grammar for generating SQL statements and queries. Eventually, dbplyr and also might become a user of sqlr. |
From a very brief reading of the sqlr readme, I have two main concerns:
I also don't like the way that the default connection is defined/established, but I think that's fairly easy to fix (although it does have broader implications for the API) |
Thanks for the feedback. I appreciate it. You make a good point regarding scope. I will focus on DDL statements. @hadley how do you feel about making the basic generation of SQL independent of dbplyr? As of now, both DBI (though only rudimentarily) and dbplyr offer an sql classes, methods for quoting/escaping, etc. dbplyr goes a step further by offering translation of operators, functions, expressions, etc. from R to SQL. This could be useful beyond mapping dplyr verbs to database back ends. |
SQL generation is the primary job of dbplyr, so I'm not sure what would remain. And generally, I don't have much time to spend on dbplyr in the near future, so I can't make any major changes. |
Need support for the |
|
Just checked, both |
- New `dbCreateTable()` that by default calls `sqlCreateTable()` and then `dbExecute()` (#74).
- New `dbAppendTable()` that by default calls `sqlAppendTableTemplate()` and then `dbExecute()` with a `param` argument (#74).
Using |
Using the new generics in our three backends instead of a default implementation due to subtle differences. |
- The `field.types` argument to `dbWriteTable()` now must be named. - Using `dbCreateTable()` and `dbAppendTable()` internally (r-dbi/DBI#74).
- Using `dbCreateTable()` and `dbAppendTable()` internally (r-dbi/DBI#74).
- The `field.types` argument to `dbWriteTable()` no longer takes precedence when defining the order of the columns in the new table. - Using `dbCreateTable()` and `dbAppendTable()` internally (r-dbi/DBI#74).
Done. |
Perhaps define two new generics: dbCreateTable() and dbInsert(). The latter could support additional options, as suggested in #68 (comment).
dbWriteTable() would simply call those two new generics.
CC @beanumber
The text was updated successfully, but these errors were encountered: