dbt-confluent 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. dbt_confluent-0.1.0/.github/CODEOWNERS +1 -0
  2. dbt_confluent-0.1.0/.gitignore +133 -0
  3. dbt_confluent-0.1.0/.gitmodules +0 -0
  4. dbt_confluent-0.1.0/.python-version +1 -0
  5. dbt_confluent-0.1.0/.semaphore/publish_to_pypi.yml +23 -0
  6. dbt_confluent-0.1.0/.semaphore/semaphore.yml +83 -0
  7. dbt_confluent-0.1.0/LICENSE +177 -0
  8. dbt_confluent-0.1.0/MANIFEST.in +1 -0
  9. dbt_confluent-0.1.0/MATERIALIZATIONS.md +19 -0
  10. dbt_confluent-0.1.0/PKG-INFO +192 -0
  11. dbt_confluent-0.1.0/README.md +155 -0
  12. dbt_confluent-0.1.0/dbt/__init__.py +3 -0
  13. dbt_confluent-0.1.0/dbt/adapters/confluent/__init__.py +16 -0
  14. dbt_confluent-0.1.0/dbt/adapters/confluent/__version__.py +1 -0
  15. dbt_confluent-0.1.0/dbt/adapters/confluent/column.py +14 -0
  16. dbt_confluent-0.1.0/dbt/adapters/confluent/connections.py +360 -0
  17. dbt_confluent-0.1.0/dbt/adapters/confluent/impl.py +313 -0
  18. dbt_confluent-0.1.0/dbt/adapters/confluent/utils.py +78 -0
  19. dbt_confluent-0.1.0/dbt/include/confluent/__init__.py +3 -0
  20. dbt_confluent-0.1.0/dbt/include/confluent/dbt_project.yml +7 -0
  21. dbt_confluent-0.1.0/dbt/include/confluent/macros/adapters/columns.sql +19 -0
  22. dbt_confluent-0.1.0/dbt/include/confluent/macros/adapters/metadata.sql +95 -0
  23. dbt_confluent-0.1.0/dbt/include/confluent/macros/adapters/relation.sql +8 -0
  24. dbt_confluent-0.1.0/dbt/include/confluent/macros/adapters/schema.sql +14 -0
  25. dbt_confluent-0.1.0/dbt/include/confluent/macros/etc/statement.sql +37 -0
  26. dbt_confluent-0.1.0/dbt/include/confluent/macros/get_custom_name/get_custom_schema.sql +9 -0
  27. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/models/helpers.sql +15 -0
  28. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/models/incremental/incremental.sql +6 -0
  29. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/models/materialized_view.sql +26 -0
  30. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/models/streaming_source.sql +47 -0
  31. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/models/streaming_table.sql +52 -0
  32. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/models/table.sql +24 -0
  33. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/models/view.sql +24 -0
  34. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/seeds/helpers.sql +49 -0
  35. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/tests/helpers.sql +22 -0
  36. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/tests/test.sql +70 -0
  37. dbt_confluent-0.1.0/dbt/include/confluent/macros/materializations/tests/unit.sql +85 -0
  38. dbt_confluent-0.1.0/dbt/include/confluent/macros/relations/drop.sql +13 -0
  39. dbt_confluent-0.1.0/dbt/include/confluent/macros/relations/materialized_view/alter.sql +5 -0
  40. dbt_confluent-0.1.0/dbt/include/confluent/macros/relations/materialized_view/create.sql +7 -0
  41. dbt_confluent-0.1.0/dbt/include/confluent/macros/relations/materialized_view/drop.sql +6 -0
  42. dbt_confluent-0.1.0/dbt/include/confluent/macros/relations/materialized_view/refresh.sql +5 -0
  43. dbt_confluent-0.1.0/dbt/include/confluent/macros/relations/table/create.sql +20 -0
  44. dbt_confluent-0.1.0/dbt/include/confluent/macros/relations/table/drop.sql +5 -0
  45. dbt_confluent-0.1.0/dbt/include/confluent/macros/relations/views/drop.sql +4 -0
  46. dbt_confluent-0.1.0/dbt/include/confluent/macros/timestamps.sql +12 -0
  47. dbt_confluent-0.1.0/dbt/include/confluent/profile_template.yml +38 -0
  48. dbt_confluent-0.1.0/pyproject.toml +98 -0
  49. dbt_confluent-0.1.0/service.yml +19 -0
  50. dbt_confluent-0.1.0/tests/__init__.py +0 -0
  51. dbt_confluent-0.1.0/tests/conftest.py +126 -0
  52. dbt_confluent-0.1.0/tests/functional/adapter/fixtures.py +76 -0
  53. dbt_confluent-0.1.0/tests/functional/adapter/test_basic.py +284 -0
  54. dbt_confluent-0.1.0/tests/functional/adapter/test_materialized_views.py +115 -0
  55. dbt_confluent-0.1.0/tests/functional/adapter/test_streaming_table.py +75 -0
  56. dbt_confluent-0.1.0/tests/functional/adapter/test_unit_materialization.py +201 -0
  57. dbt_confluent-0.1.0/tox.ini +27 -0
  58. dbt_confluent-0.1.0/uv.lock +1907 -0
@@ -0,0 +1 @@
1
+ * @confluentinc/pyflink
@@ -0,0 +1,133 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ test.env
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # .python-version is tracked in git for project-wide version
87
+
88
+ # pipenv
89
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
91
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
92
+ # install all needed dependencies.
93
+ #Pipfile.lock
94
+
95
+ # uv
96
+ # uv.lock should be committed to version control
97
+
98
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
99
+ __pypackages__/
100
+
101
+ # Celery stuff
102
+ celerybeat-schedule
103
+ celerybeat.pid
104
+
105
+ # SageMath parsed files
106
+ *.sage.py
107
+
108
+ # Environments
109
+ .env
110
+ .venv
111
+ env/
112
+ venv/
113
+ ENV/
114
+ env.bak/
115
+ venv.bak/
116
+
117
+ # Spyder project settings
118
+ .spyderproject
119
+ .spyproject
120
+
121
+ # Rope project settings
122
+ .ropeproject
123
+
124
+ # mkdocs documentation
125
+ /site
126
+
127
+ # mypy
128
+ .mypy_cache/
129
+ .dmypy.json
130
+ dmypy.json
131
+
132
+ # Pyre type checker
133
+ .pyre/
File without changes
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,23 @@
1
+
2
+ version: v1.0
3
+ name: Publish `dbt_confluent` to PyPi
4
+ agent:
5
+ machine:
6
+ type: s1-prod-ubuntu24-04-amd64-1
7
+
8
+ global_job_config:
9
+ prologue:
10
+ commands:
11
+ - checkout
12
+ - . vault-setup
13
+ - curl -LsSf https://astral.sh/uv/install.sh | sh
14
+
15
+ blocks:
16
+ - name: Publish `dbt_confluent` to PyPi
17
+ task:
18
+ jobs:
19
+ - name: Publish `dbt_confluent` to PyPi
20
+ commands:
21
+ - DBT_CONFLUENT_KEY=$(vault kv get -field=dbt-confluent v1/ci/kv/pypi/pypi.org)
22
+ - uv build
23
+ - uv publish -u __token__ -p "$DBT_CONFLUENT_KEY" dist/*
@@ -0,0 +1,83 @@
1
+ version: v1.0
2
+ name: build-test-release
3
+ agent:
4
+ machine:
5
+ type: s1-prod-ubuntu24-04-amd64-1
6
+
7
+ auto_cancel:
8
+ running:
9
+ when: "branch != 'main'"
10
+
11
+ execution_time_limit:
12
+ hours: 1
13
+
14
+ queue:
15
+ - when: "branch != 'main'"
16
+ processing: parallel
17
+
18
+ global_job_config:
19
+ prologue:
20
+ commands:
21
+ - checkout
22
+ - . vault-setup
23
+ - git submodule update --init
24
+ - curl -LsSf https://astral.sh/uv/install.sh | sh
25
+ - uv sync --extra dev --extra test
26
+
27
+ blocks:
28
+ - name: "Lint"
29
+ dependencies: []
30
+ task:
31
+ jobs:
32
+ - name: "Ruff Check"
33
+ commands:
34
+ - uv run ruff check dbt/ tests/
35
+ - name: "Ruff Format Check"
36
+ commands:
37
+ - uv run ruff format --check dbt/ tests/
38
+
39
+ - name: "Build"
40
+ dependencies: []
41
+ task:
42
+ jobs:
43
+ - name: "Build Package"
44
+ commands:
45
+ - uv build
46
+ # Install it locally and check that it can be imported.
47
+ # Clean the venv created in the prologue first
48
+ - uv venv --clear
49
+ - uv pip install dist/dbt_confluent-*.whl
50
+ - uv run python -c "import confluent_sql; import dbt.adapters.confluent; print('OK')"
51
+
52
+ - name: "Test"
53
+ dependencies:
54
+ - "Lint"
55
+ - "Build"
56
+ task:
57
+ jobs:
58
+ - name: "Run Tests"
59
+ commands:
60
+ - |
61
+ if [ -z "${CONFLUENT_FLINK_API_KEY:-}" ]; then
62
+ echo "CONFLUENT_FLINK_API_KEY not set, skipping tests"
63
+ else
64
+ uv run pytest --junitxml=test-results.xml
65
+ fi
66
+ epilogue:
67
+ always:
68
+ commands:
69
+ - |
70
+ if [[ -f test-results.xml ]]; then
71
+ test-results publish test-results.xml
72
+ fi
73
+
74
+ after_pipeline:
75
+ task:
76
+ jobs:
77
+ - name: Publish Test Results to Semaphore
78
+ commands:
79
+ - test-results gen-pipeline-report || echo "Could not publish pipeline test result report. Are there any test results to publish?"
80
+
81
+ promotions:
82
+ - name: Publish dbt-confluent to PyPi
83
+ pipeline_file: publish_to_pypi.yml
@@ -0,0 +1,177 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
@@ -0,0 +1 @@
1
+ recursive-include dbt/include *.sql *.yml *.md
@@ -0,0 +1,19 @@
1
+ # Materializations
2
+
3
+ ## Supported
4
+
5
+ | Materialization | Description |
6
+ |---|---|
7
+ | `table` | Creates a table via `CREATE TABLE ... AS SELECT` (CTAS). Runs in snapshot mode — the query executes once and completes. Requires `--full-refresh` to replace an existing table. |
8
+ | `view` | Drop-and-recreate view. |
9
+ | `materialized_view` | Creates a Flink table via CTAS that is continuously updated by Flink. No manual refresh needed. Note: despite the dbt name, this creates a Flink table with a continuous query, not a traditional database materialized view. |
10
+ | `streaming_table` | Creates a table then runs a separate continuous `INSERT INTO ... SELECT` statement. This two-statement approach is currently the preferred way to build streaming pipelines (until Flink's materialized table feature reaches GA). Supports table options via `config(with={...})`. Requires `--full-refresh` to replace an existing table. |
11
+ | `streaming_source` | Creates a connector-backed source table (e.g., Datagen). Requires `config(connector='...')`. The model SQL defines the column definitions. Supports additional connector options via `config(with={...})`. Requires `--full-refresh` to replace an existing table. See the [Confluent connector catalog](https://docs.confluent.io/cloud/current/connectors/index.html) and [Flink CREATE TABLE documentation](https://docs.confluent.io/cloud/current/flink/reference/statements/create-table.html) for available connectors and options. |
12
+ | `ephemeral` | Standard dbt CTE-based query fragment, not materialized in Flink. |
13
+
14
+ ## Not Supported
15
+
16
+ | Materialization | Reason |
17
+ |---|---|
18
+ | `incremental` | dbt's batch-incremental semantics does not map to Flink's continuous processing model. Use `streaming_table` instead. |
19
+ | `snapshot` | Flink SQL lacks the batch operations (MERGE, UPDATE) required by dbt snapshots. |
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.4
2
+ Name: dbt-confluent
3
+ Version: 0.1.0
4
+ Summary: The Confluent Cloud adapter plugin for DBT
5
+ Project-URL: Homepage, https://github.com/confluentinc/dbt-confluent
6
+ Project-URL: Repository, https://github.com/confluentinc/dbt-confluent
7
+ Author-email: Confluent <dev@confluent.io>
8
+ Maintainer-email: Confluent <dev@confluent.io>
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: adapter,cloud,confluent,dbt
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Operating System :: MacOS :: MacOS X
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Requires-Python: >=3.10.0
21
+ Requires-Dist: agate~=1.0
22
+ Requires-Dist: confluent-sql~=0.1
23
+ Requires-Dist: dbt-adapters~=1.16
24
+ Requires-Dist: dbt-common~=1.12
25
+ Requires-Dist: dbt-core~=1.11
26
+ Requires-Dist: httpx<0.29.0,>=0.23.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: ipdb>=0.13.0; extra == 'dev'
29
+ Requires-Dist: mypy>=1.13.0; extra == 'dev'
30
+ Requires-Dist: pre-commit>=4.0.0; extra == 'dev'
31
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
32
+ Provides-Extra: test
33
+ Requires-Dist: dbt-tests-adapter>=1.10; extra == 'test'
34
+ Requires-Dist: pytest-dotenv>=0.5.2; extra == 'test'
35
+ Requires-Dist: pytest>=8.4.2; extra == 'test'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # dbt-confluent
39
+
40
+ The [dbt](https://www.getdbt.com/) adapter for [Confluent Cloud](https://confluent.io/confluent-cloud/) Flink SQL.
41
+
42
+ Build, test, and manage streaming data transformations on Confluent Cloud using dbt's familiar development workflow.
43
+
44
+ ## Overview
45
+
46
+ `dbt-confluent` lets you use dbt to define and run SQL transformations on Confluent Cloud's fully managed Apache Flink service. It supports both batch-style and streaming materializations, enabling continuous data pipelines defined as dbt models.
47
+
48
+ Features:
49
+ - Standard dbt materializations (table, view, ephemeral) adapted for Flink SQL
50
+ - Streaming-native materializations (`streaming_table`, `streaming_source`) for continuous data pipelines
51
+ - Materialized views powered by Flink's continuous query execution
52
+ - Integration with Confluent Cloud connectors (e.g., Datagen/Faker) via `streaming_source`
53
+
54
+ See [Materializations](MATERIALIZATIONS.md) for the full list and details.
55
+
56
+ ## Installation
57
+
58
+ ```bash
59
+ pip install dbt-confluent
60
+ ```
61
+
62
+ or with [uv](https://docs.astral.sh/uv/):
63
+
64
+ ```bash
65
+ uv add dbt-confluent
66
+ ```
67
+
68
+ Requires Python 3.10+.
69
+
70
+ ## Configuration
71
+
72
+ After installing, scaffold a new project with:
73
+
74
+ ```bash
75
+ dbt init my_project
76
+ ```
77
+
78
+ Select `confluent` as the adapter and fill in the prompts for your Confluent Cloud credentials (API key, compute pool, environment, etc.).
79
+
80
+ ### Concept mapping
81
+
82
+ Confluent Cloud Flink uses different terminology than traditional databases. Here's how dbt concepts map to Flink and Confluent Cloud:
83
+
84
+ | dbt concept | Flink concept | Confluent Cloud entity |
85
+ |---|---|---|
86
+ | `database` | Catalog | Environment |
87
+ | `schema` | Database | Kafka cluster |
88
+
89
+ ### Schema configuration
90
+
91
+ Unlike most dbt adapters, `dbt-confluent` cannot create or drop schemas — a dbt schema maps to a Flink database (Kafka cluster) in Confluent Cloud, which is managed externally. Both the `dbname` in your `profiles.yml` and any model-level `schema` config must reference an existing Flink database by name:
92
+
93
+ ```yaml
94
+ # dbt_project.yml
95
+ models:
96
+ my_project:
97
+ +schema: my-kafka-cluster
98
+ ```
99
+
100
+ ## Usage
101
+
102
+ ### Streaming table
103
+
104
+ A streaming table creates a table and runs a continuous INSERT query against it:
105
+
106
+ ```sql
107
+ -- models/pageviews_enriched.sql
108
+ {{
109
+ config(
110
+ materialized='streaming_table',
111
+ with={'changelog.mode': 'append'}
112
+ )
113
+ }}
114
+
115
+ SELECT
116
+ p.user_id,
117
+ p.page_url,
118
+ u.username
119
+ FROM {{ ref('pageviews') }} p
120
+ JOIN {{ ref('users') }} u ON p.user_id = u.user_id
121
+ ```
122
+
123
+ ### Streaming source
124
+
125
+ A streaming source creates a connector-backed source table. The model SQL defines the column definitions:
126
+
127
+ ```sql
128
+ -- models/datagen_users.sql
129
+ {{
130
+ config(
131
+ materialized='streaming_source',
132
+ connector='faker',
133
+ with={'rows-per-second': '10'}
134
+ )
135
+ }}
136
+
137
+ `user_id` INT,
138
+ `username` STRING,
139
+ `email` STRING
140
+ ```
141
+
142
+ See [Materializations](MATERIALIZATIONS.md) for the full list and details.
143
+
144
+ ## Known Limitations
145
+
146
+ - **No schema management**: Flink databases (Kafka clusters) cannot be created or dropped — they are managed in Confluent Cloud.
147
+ - **No table renames**: `ALTER TABLE RENAME` is not supported; to effectively rename a model you must drop and recreate the underlying table, which for `table`, `streaming_table`, and `streaming_source` materializations requires running with `--full-refresh`.
148
+ - **No transactions**: Flink SQL is non-transactional.
149
+ - **No snapshots**: Flink SQL lacks the batch operations (MERGE, UPDATE) required by dbt snapshots.
150
+ - **No incremental**: dbt's batch-incremental semantics does not map to Flink's continuous processing model. Use `streaming_table` instead.
151
+
152
+ ## Development
153
+
154
+ ```bash
155
+ git clone https://github.com/confluentinc/dbt-confluent
156
+ cd dbt-confluent
157
+ uv sync --extra dev --extra test
158
+ ```
159
+
160
+ ### Code quality
161
+
162
+ ```bash
163
+ uv run ruff check dbt/ tests/
164
+ uv run ruff format --check dbt/ tests/
165
+ ```
166
+
167
+ ### Running tests
168
+
169
+ Tests require a Confluent Cloud environment. Set the following environment variables (or add them to a `test.env` file):
170
+
171
+ ```bash
172
+ export CONFLUENT_ENV_ID=env-xxxxxx
173
+ export CONFLUENT_ORG_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
174
+ export CONFLUENT_COMPUTE_POOL_ID=lfcp-xxxxx
175
+ export CONFLUENT_CLOUD_PROVIDER=aws
176
+ export CONFLUENT_CLOUD_REGION=us-west-6
177
+ export CONFLUENT_TEST_DBNAME=dbname
178
+ export CONFLUENT_FLINK_API_KEY=xxx
179
+ export CONFLUENT_FLINK_API_SECRET=xxx
180
+ ```
181
+
182
+ ```bash
183
+ uv run pytest
184
+ ```
185
+
186
+ ## Versioning
187
+
188
+ This adapter follows [semantic versioning](https://semver.org/) and is versioned independently from dbt Core. Compatibility with dbt Core is declared via dependencies (currently requires `dbt-core~=1.11`).
189
+
190
+ ## License
191
+
192
+ Apache-2.0 — see [LICENSE](./LICENSE) for details.