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

Fix sqlite write #299

Merged
merged 2 commits into from
Dec 3, 2023
Merged

Fix sqlite write #299

merged 2 commits into from
Dec 3, 2023

Conversation

Nintorac
Copy link
Contributor

@Nintorac Nintorac commented Dec 1, 2023

Fixes #291

"type": "duckdb",
"path": dbt_profile_target.get("path", ":memory:"),
"attach": [
{'path': sqlite_test_db}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this need to have the sqlite type included? I thought the default assumed a DuckDB database was being attached

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They show this approach in the sqlite_scanner docs

I believe if the file has the .db extension it is assumed to be sqlite

{% macro duckdb__create_schema(relation) -%}
{%- call statement('create_schema') -%}
create schema if not exists {{ relation.without_identifier() }}
{% set sql %}
select type from duckdb_databases()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit-ish question: when was this method added? I want to know if we need to do a bump from the minimal duckdb >= 0.7.0 dependency we include in setup.py

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

image

Copy link
Collaborator

@jwills jwills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thank you so much @Nintorac!

@jwills jwills merged commit 0f093e9 into duckdb:master Dec 3, 2023
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Writing to an SQLite database
2 participants