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

feat: backend.db_params #9186

Open
NickCrews opened this issue May 13, 2024 · 0 comments
Open

feat: backend.db_params #9186

NickCrews opened this issue May 13, 2024 · 0 comments

Comments

@NickCrews
Copy link
Contributor

Originally posted by @mw3i in #5391 (comment):

Sorry for the late reply. Since ibis doesn't have upsert, our team uses the dataset library for inserts/updates/upserts. We do all our normal code in ibis, and then updates/upserts are done with:

import dataset

params = f"{dialect}://{user}:{password}@{url}:{port}/{database}" # <-- sqlalchemy database uri string
with dataset.connect(params) as dbx:
    dbx[tablename].upsert_many(
        list_of_dictionaries, # <-- each dict is a db entry
        column_to_use_as_identifier,
    )

Creating this URL is currently a bit difficult if you just have the backend connection. Could we make some dataclass like

class ConnectionParams:
    dialect: str
   ....

	def __str__(self): ...

and you could get access to it like backend.connection_params? This isn't a huge blocker, just a nice-to-have for the ux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: backlog
Development

No branches or pull requests

1 participant