This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
SQL loading natively in Hamilton -- help choose the API! #315
elijahbenizzy
started this conversation in
Polls
Replies: 1 comment
-
Driver code:# this could be included in the decorator if you want to do ad-hoc
config = {
"postgres_connection":
{
type: "postgres",
database: "spend_data" ,
password: os.environ["SECURELY_STORED_PASSWORD"],
port: 5432,
username: "elijah",
url: "postgres_url"
}
}
driver = driver.Driver(config, data_loaders)
driver.execute(
["facebook_spend", ...],
inputs={
"start_date" : "2021-03-01",
"end_date" : "2021-05-01",
"business_line" : "womens"
} The idea is to use sqlglot to transpile between dialects as needed, allowing you to specify a dialect if you really want to bypass (otherwise we'll likely assume duckdb).```
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey folks, we're planning to build support for natively running SQL queries to load data with Hamilton. We want your help figuring out how!
We currently have two options we're considering, but are open to more. See original issue, and original design doc (it's evolved since then)
For the following, we'll be using the (somewhat complex, parameterized as a jinja template) query. Its based on our duckdb example.
Here's what it would look like currently:
SQL as part of the decorator
SQL returned by the function
<Your idea here!>
3 votes ·
Beta Was this translation helpful? Give feedback.
All reactions