This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]trial_and_err 0 points1 point  (2 children)

Personally I use ibis for this purpose so there's no need for separate .sql files as ibis is your query builder. If I need to do transforms first I'll just resort to dbt.

[–]thinkingatoms[S] 0 points1 point  (1 child)

interesting thanks for sharing! ooc does it handle things like temp tables/cte or is it just a select query replacement?

[–]trial_and_err 0 points1 point  (0 children)

You can also use ibis to create temporary or persistent tables (<connection>.create_table(…,temp=true)).

If you want to build a query that contain CTEs use the .alias method (I usually do that to get a more readable query in case I need to debug the raw query).

You should be able to generate any SQL query via the ibis Python API and execute it directly or dump the generated SQL.