-
Notifications
You must be signed in to change notification settings - Fork 15
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
Ideas #1
Comments
there could be |
if possible to handle those two functionalities in base R it would make importFrom(urltools,get_credentials)
importFrom(urltools,url_parse) |
Examples of using RPostgreSQL would be nice, it is much lighter than RPostgres. |
Hey @jangorecki, thanks for the ideas. I added support for RPostgreSQL. I agree with keeping the package lightweight and minimizing dependencies, but don't want to reinvent/maintain a URL parser. As for logging, you can now pass a function to writeLogs <- function(sql) {
# your code
}
options(dbx_verbose=writeLogs) |
Quick follow-up: Made urltools optional since it's only needed if you use the url functionality. Didn't realize that it had two dependencies itself. |
It could be nice to add wrapper to load a CSV/TSV files. |
Hey @artemklevtsov, thanks for the suggestion. Since it only takes 1 line to convert a CSV/TSV into a data frame, I'm not sure a separate function is needed. |
I mean this function should use the effective |
What would be nice is a way to add missing columns when trying to update, insert or upsert. E.g. I'm getting data from a web service where new columns can crop up now and then, e.g. |
@stefanfritsch thanks for the suggestion. This use case doesn't seem very common, so I think it's best accomplished outside of dbx. |
Hi Ankane! |
Hey @Budfox123, thanks for the suggestions. I've considered adding a more ORM-type function for constructing queries (instead of writing SQL manually), but want to keep things simple for now. You can probably write a function that wraps |
Hi @ankane, would it be possible to let |
Hey @psimm, both run |
Hi @ankane thanks for your reply! Sorry, I think my previous suggestion of summing them was not a good idea. Here is my use case: I am downloading data from an API on a schedule. The API sometimes returns values that are already in the DB, so I use |
If you're on Postgres and use the version from GitHub, you can do: dbxUpsert(db, table, records, where_cols=c("id"), returning=DBI::SQL("id, (xmax = 0) AS inserted")) I'm not sure if it's possible with the other databases. |
Awesome! Yes, I am using Postgres. Thank you for adding that. |
Error: Failed to fetch row: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time |
Please create a new issue to discuss any ideas or share your own.
0.4.0 release
adapter
first param ofdbxConnect
(to matchdbConnect
)mysql
bigint3
orbigint4
branchIdeas
select last_insert_id(), row_count()
https://stackoverflow.com/questions/7333524/how-can-i-insert-many-rows-into-a-mysql-table-and-return-the-new-idsOn hold
update ... from
link, but this requires typecasting)retries
option todbxSelect
- undo revert ofdd9d716651f9321afe74def1fac491de4a4daca0
(users can use a separate package like retry for this)statement_timeout
option todbxSelect
and maybe other commands - probably not commonconn
optional (use global connection if not passed)dbxCreateTable(db, table, records, types=list(id="bigserial primary key", score="float"))
(only first 3 args required, types can be used to override defaults)cache
option to cache select statements to disk -cache
branch (need ability to cache for duration and force refresh)The text was updated successfully, but these errors were encountered: