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(ux): add Value.to_sql() #9708

Open
1 task done
NickCrews opened this issue Jul 28, 2024 · 2 comments
Open
1 task done

feat(ux): add Value.to_sql() #9708

NickCrews opened this issue Jul 28, 2024 · 2 comments
Labels
feature Features or general enhancements

Comments

@NickCrews
Copy link
Contributor

Is your feature request related to a problem?

often when debugging, I have some big expression like t.mutate().filter().order_by()

Then, when I need to look at the SQL, I need to wrap the whole thing as ibis.to_sql(...). Sometimes, this also requires a new import.

What is the motivation behind your request?

No response

Describe the solution you'd like

It would just be a nice UX if there was a chaining API, ie Value.to_sql() that just delegated to ibis.to_sql()

What version of ibis are you running?

main

What backend(s) are you using, if any?

I think it should still work to mix backends? eg ibis.duckdb.connect().table("x").mutate(y="z").to_sql(dialect="sqlite")

Code of Conduct

  • I agree to follow this project's Code of Conduct
@NickCrews NickCrews added the feature Features or general enhancements label Jul 28, 2024
@gforsyth
Copy link
Member

@jcrist - I have a memory of you having Thoughts (TM) on this method, but it could've been a fever dream.
Any objections to adding something like this?

@jcrist
Copy link
Member

jcrist commented Aug 7, 2024

I'm +0 on this. Seems fine to add.

Tangent - I kinda don't like that we use to_* here, since in other cases the to_* methods all execute something (to_pandas, to_parquet, ..., see #9788). I was less concerned with ibis.to_sql, which is a top-level function. Adding a to_sql method to Table may confuse users since pandas also has a DataFrame.to_sql method which writes the frame out to a SQL database (similar to our other to_* methods. All that said, I don't think this is that big of a deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements
Projects
Status: backlog
Development

No branches or pull requests

3 participants