tigrbl_engine_snowflake 0.1.1.dev2__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.
@@ -0,0 +1,190 @@
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 definition, 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 Contributions were 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
+ (a) You must give any other recipients of the Work or
94
+ Derivative Works a copy of this License; and
95
+ (b) You must cause any modified files to carry prominent notices
96
+ stating that You changed the files; and
97
+ (c) You must retain, in the Source form of any Derivative Works
98
+ that You distribute, all copyright, patent, trademark, and
99
+ attribution notices from the Source form of the Work,
100
+ excluding those notices that do not pertain to any part of
101
+ the Derivative Works; and
102
+ (d) If the Work includes a "NOTICE" text file as part of its
103
+ distribution, then any Derivative Works that You distribute must
104
+ include a readable copy of the attribution notices contained
105
+ within such NOTICE file, excluding those notices that do not
106
+ pertain to any part of the Derivative Works, in at least one
107
+ of the following places: within a NOTICE text file distributed
108
+ as part of the Derivative Works; within the Source form or
109
+ documentation, if provided along with the Derivative Works; or,
110
+ within a display generated by the Derivative Works, if and
111
+ wherever such third-party notices normally appear. The contents
112
+ of the NOTICE file are for informational purposes only and
113
+ do not modify the License. You may add Your own attribution
114
+ notices within Derivative Works that You distribute, alongside
115
+ or as an addendum to the NOTICE text from the Work, provided
116
+ that such additional attribution notices cannot be construed
117
+ as modifying the License.
118
+
119
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
120
+ any Contribution intentionally submitted for inclusion in the Work
121
+ by You to the Licensor shall be under the terms and conditions of
122
+ this License, without any additional terms or conditions.
123
+ Notwithstanding the above, nothing herein shall supersede or modify
124
+ the terms of any separate license agreement you may have executed
125
+ with Licensor regarding such Contributions.
126
+
127
+ 6. Trademarks. This License does not grant permission to use the trade
128
+ names, trademarks, service marks, or product names of the Licensor,
129
+ except as required for reasonable and customary use in describing the
130
+ origin of the Work and reproducing the content of the NOTICE file.
131
+
132
+ 7. Disclaimer of Warranty. Unless required by applicable law or
133
+ agreed to in writing, Licensor provides the Work (and each
134
+ Contributor provides its Contributions) on an "AS IS" BASIS,
135
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
136
+ implied, including, without limitation, any warranties or conditions
137
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
138
+ PARTICULAR PURPOSE. You are solely responsible for determining the
139
+ appropriateness of using or redistributing the Work and assume any
140
+ risks associated with Your exercise of permissions under this License.
141
+
142
+ 8. Limitation of Liability. In no event and under no legal theory,
143
+ whether in tort (including negligence), contract, or otherwise,
144
+ unless required by applicable law (such as deliberate and grossly
145
+ negligent acts) or agreed to in writing, shall any Contributor be
146
+ liable to You for damages, including any direct, indirect, special,
147
+ incidental, or consequential damages of any character arising as a
148
+ result of this License or out of the use or inability to use the
149
+ Work (including but not limited to damages for loss of goodwill,
150
+ work stoppage, computer failure or malfunction, or any and all
151
+ other commercial damages or losses), even if such Contributor
152
+ has been advised of the possibility of such damages.
153
+
154
+ 9. Accepting Warranty or Additional Liability. While redistributing
155
+ the Work or Derivative Works thereof, You may choose to offer,
156
+ and charge a fee for, acceptance of support, warranty, indemnity,
157
+ or other liability obligations and/or rights consistent with this
158
+ License. However, in accepting such obligations, You may act only
159
+ on Your own behalf and on Your sole responsibility, not on behalf
160
+ of any other Contributor, and only if You agree to indemnify,
161
+ defend, and hold each Contributor harmless for any liability
162
+ incurred by, or claims asserted against, such Contributor by reason
163
+ of your accepting any such warranty or additional liability.
164
+
165
+ END OF TERMS AND CONDITIONS
166
+
167
+ APPENDIX: How to apply the Apache License to your work.
168
+
169
+ To apply the Apache License to your work, attach the following
170
+ boilerplate notice, with the fields enclosed by brackets "[]"
171
+ replaced with your own identifying information. (Don't include
172
+ the brackets!) The text should be enclosed in the appropriate
173
+ comment syntax for the file format. We also recommend that a
174
+ file or class name and description of purpose be included on the
175
+ same "printed page" as the copyright notice for easier
176
+ identification within third-party archives.
177
+
178
+ Copyright [yyyy] [name of copyright owner]
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,74 @@
1
+ Metadata-Version: 2.4
2
+ Name: tigrbl_engine_snowflake
3
+ Version: 0.1.1.dev2
4
+ Summary: Tigrbl engine plugin for Snowflake, auto-registered via entry points.
5
+ Author-email: Jacob Stewart <jacob@swarmauri.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/swarmauri/swarmauri-sdk
8
+ Project-URL: Repository, https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/tigrbl_engine_snowflake
9
+ Keywords: tigrbl,engine,plugin,snowflake,database,analytics
10
+ Classifier: Development Status :: 1 - Planning
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Environment :: Plugins
19
+ Classifier: Intended Audience :: Developers
20
+ Classifier: Topic :: Database
21
+ Classifier: Topic :: Software Development :: Libraries
22
+ Requires-Python: <3.13,>=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: SQLAlchemy<3.0,>=2.0
26
+ Requires-Dist: snowflake-sqlalchemy<2.0,>=1.5
27
+ Requires-Dist: snowflake-connector-python<4.0,>=3.0
28
+ Dynamic: license-file
29
+
30
+ # tigrbl_engine_snowflake
31
+
32
+ **Tigrbl engine plugin for Snowflake**, auto-registered via the `tigrbl.engine` entry-point group.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ pip install -e .
38
+ ```
39
+
40
+ ## Usage (inside Tigrbl)
41
+
42
+ ```python
43
+ from tigrbl.engine import Engine
44
+ from tigrbl.engine.engine_spec import EngineSpec
45
+
46
+ # DSN (Snowflake SQLAlchemy URL)
47
+ spec = EngineSpec(kind="snowflake", dsn="snowflake://USER:PWD@ACCOUNT/DB/SCHEMA?warehouse=WH&role=ROLE")
48
+
49
+ # Or provide a mapping; the plugin builds the DSN
50
+ spec = EngineSpec(kind="snowflake", mapping={
51
+ "account": "myacct-xy123",
52
+ "user": "USER",
53
+ "pwd": "PWD",
54
+ "db": "DB",
55
+ "schema": "PUBLIC",
56
+ "warehouse": "COMPUTE_WH",
57
+ "role": "SYSADMIN",
58
+ "pool_size": 10,
59
+ "max_overflow": 20
60
+ })
61
+
62
+ engine = Engine(spec)
63
+ with engine.session() as s:
64
+ s.execute("SELECT CURRENT_ROLE()").all()
65
+ ```
66
+
67
+ ## Entry-point
68
+
69
+ Declared in `pyproject.toml`:
70
+
71
+ ```toml
72
+ [project.entry-points."tigrbl.engine"]
73
+ snowflake = "tigrbl_engine_snowflake:register"
74
+ ```
@@ -0,0 +1,45 @@
1
+ # tigrbl_engine_snowflake
2
+
3
+ **Tigrbl engine plugin for Snowflake**, auto-registered via the `tigrbl.engine` entry-point group.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install -e .
9
+ ```
10
+
11
+ ## Usage (inside Tigrbl)
12
+
13
+ ```python
14
+ from tigrbl.engine import Engine
15
+ from tigrbl.engine.engine_spec import EngineSpec
16
+
17
+ # DSN (Snowflake SQLAlchemy URL)
18
+ spec = EngineSpec(kind="snowflake", dsn="snowflake://USER:PWD@ACCOUNT/DB/SCHEMA?warehouse=WH&role=ROLE")
19
+
20
+ # Or provide a mapping; the plugin builds the DSN
21
+ spec = EngineSpec(kind="snowflake", mapping={
22
+ "account": "myacct-xy123",
23
+ "user": "USER",
24
+ "pwd": "PWD",
25
+ "db": "DB",
26
+ "schema": "PUBLIC",
27
+ "warehouse": "COMPUTE_WH",
28
+ "role": "SYSADMIN",
29
+ "pool_size": 10,
30
+ "max_overflow": 20
31
+ })
32
+
33
+ engine = Engine(spec)
34
+ with engine.session() as s:
35
+ s.execute("SELECT CURRENT_ROLE()").all()
36
+ ```
37
+
38
+ ## Entry-point
39
+
40
+ Declared in `pyproject.toml`:
41
+
42
+ ```toml
43
+ [project.entry-points."tigrbl.engine"]
44
+ snowflake = "tigrbl_engine_snowflake:register"
45
+ ```
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "tigrbl_engine_snowflake"
7
+ version = "0.1.1.dev2"
8
+ description = "Tigrbl engine plugin for Snowflake, auto-registered via entry points."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10,<3.13"
11
+ license = { text = "Apache-2.0" }
12
+ authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
13
+ classifiers = [
14
+ "Development Status :: 1 - Planning",
15
+ "License :: OSI Approved :: Apache Software License",
16
+ "Programming Language :: Python",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3 :: Only",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Environment :: Plugins",
23
+ "Intended Audience :: Developers",
24
+ "Topic :: Database",
25
+ "Topic :: Software Development :: Libraries",
26
+ ]
27
+ keywords = [
28
+ "tigrbl",
29
+ "engine",
30
+ "plugin",
31
+ "snowflake",
32
+ "database",
33
+ "analytics",
34
+ ]
35
+
36
+ dependencies = [
37
+ "SQLAlchemy>=2.0,<3.0",
38
+ "snowflake-sqlalchemy>=1.5,<2.0",
39
+ "snowflake-connector-python>=3.0,<4.0",
40
+ ]
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/swarmauri/swarmauri-sdk"
44
+ Repository = "https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/tigrbl_engine_snowflake"
45
+
46
+ # Auto-registration with Tigrbl
47
+ [project.entry-points."tigrbl.engine"]
48
+ snowflake = "tigrbl_engine_snowflake:register"
49
+
50
+ [tool.setuptools.package-dir]
51
+ "" = "src"
52
+
53
+ [tool.setuptools.packages.find]
54
+ where = ["src"]
55
+
56
+ [dependency-groups]
57
+ dev = [
58
+ "pytest>=8.0",
59
+ "pytest-asyncio>=0.24.0",
60
+ "pytest-xdist>=3.6.1",
61
+ "pytest-json-report>=1.5.0",
62
+ "python-dotenv",
63
+ "requests>=2.32.3",
64
+ "flake8>=7.0",
65
+ "pytest-timeout>=2.3.1",
66
+ "ruff>=0.9.9",
67
+ "pytest-benchmark>=4.0.0",
68
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,30 @@
1
+ """Snowflake engine plugin for Tigrbl.
2
+
3
+ Exports:
4
+ - snowflake_engine(): builder used by Tigrbl's registry
5
+ - snowflake_capabilities(): optional capability metadata
6
+ - SnowflakeSession: SQLAlchemy Session alias
7
+ - register(): entry-point hook to register with Tigrbl
8
+
9
+ The package auto-registers via pyproject entry-points under group 'tigrbl.engine'.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from .engine import snowflake_engine, snowflake_capabilities
15
+ from .session import SnowflakeSession
16
+
17
+
18
+ def register() -> None:
19
+ # Late import to avoid importing tigrbl at module import-time
20
+ from tigrbl.engine.registry import register_engine
21
+
22
+ register_engine("snowflake", snowflake_engine, snowflake_capabilities)
23
+
24
+
25
+ __all__ = [
26
+ "snowflake_engine",
27
+ "snowflake_capabilities",
28
+ "SnowflakeSession",
29
+ "register",
30
+ ]
@@ -0,0 +1,96 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any, Mapping, Tuple
4
+ from urllib.parse import quote_plus
5
+
6
+ from sqlalchemy import create_engine
7
+ from sqlalchemy.orm import sessionmaker
8
+
9
+ SessionFactory = sessionmaker
10
+
11
+
12
+ def _build_url(mapping: Mapping[str, Any] | None, dsn: str | None) -> str:
13
+ """Build a Snowflake SQLAlchemy URL.
14
+ If `dsn` is provided and already begins with 'snowflake://', return it unchanged.
15
+ Otherwise construct from mapping keys: account, user, pwd, db, schema, warehouse, role.
16
+ """
17
+ if dsn:
18
+ return dsn if dsn.startswith("snowflake://") else dsn
19
+
20
+ if not mapping:
21
+ raise ValueError("snowflake_engine requires either a DSN or a mapping.")
22
+
23
+ account = str(mapping.get("account") or "").strip()
24
+ user = str(mapping.get("user") or "").strip()
25
+ pwd = str(mapping.get("pwd") or "").strip()
26
+ database = str(mapping.get("db") or "").strip()
27
+ schema = str(mapping.get("schema") or "").strip()
28
+ wh = str(mapping.get("warehouse") or "").strip()
29
+ role = str(mapping.get("role") or "").strip()
30
+
31
+ if not (account and user and pwd and database and schema):
32
+ missing = [
33
+ k
34
+ for k, v in [
35
+ ("account", account),
36
+ ("user", user),
37
+ ("pwd", pwd),
38
+ ("db", database),
39
+ ("schema", schema),
40
+ ]
41
+ if not v
42
+ ]
43
+ raise ValueError(
44
+ f"Missing required Snowflake mapping keys: {', '.join(missing)}"
45
+ )
46
+
47
+ qp = []
48
+ if wh:
49
+ qp.append(f"warehouse={quote_plus(wh)}")
50
+ if role:
51
+ qp.append(f"role={quote_plus(role)}")
52
+ params = f"?{'&'.join(qp)}" if qp else ""
53
+
54
+ return (
55
+ f"snowflake://{quote_plus(user)}:{quote_plus(pwd)}@{account}/"
56
+ f"{quote_plus(database)}/{quote_plus(schema)}{params}"
57
+ )
58
+
59
+
60
+ def snowflake_engine(
61
+ *,
62
+ mapping: Mapping[str, Any] | None = None,
63
+ spec: Any | None = None,
64
+ dsn: str | None = None,
65
+ **_,
66
+ ) -> Tuple[Any, SessionFactory]:
67
+ """Tigrbl engine builder for Snowflake.
68
+ Returns a (sqlalchemy.Engine, sessionmaker) tuple.
69
+ Signature accepts (mapping, spec, dsn) to match Tigrbl's registry call-site.
70
+ """
71
+ url = _build_url(mapping, dsn)
72
+
73
+ # Pool knobs: prefer values from mapping, then from spec, else defaults.
74
+ pool_size = int(
75
+ (mapping or {}).get("pool_size") or getattr(spec, "pool_size", 10) or 10
76
+ )
77
+ max_overflow = int(
78
+ (mapping or {}).get("max_overflow") or getattr(spec, "max", 20) or 20
79
+ )
80
+
81
+ eng = create_engine(
82
+ url,
83
+ pool_size=pool_size,
84
+ max_overflow=max_overflow,
85
+ connect_args={"client_session_keep_alive": True},
86
+ )
87
+ return eng, sessionmaker(bind=eng, expire_on_commit=False)
88
+
89
+
90
+ def snowflake_capabilities() -> dict[str, Any]:
91
+ return {
92
+ "dialect": "snowflake",
93
+ "supports_transactions": True,
94
+ "async": False,
95
+ "notes": "Requires snowflake-sqlalchemy; returns blocking SQLAlchemy sessions.",
96
+ }
@@ -0,0 +1,7 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TypeAlias
4
+ from sqlalchemy.orm import Session as _SASession
5
+
6
+ # Explicit alias for consumer typing
7
+ SnowflakeSession: TypeAlias = _SASession
@@ -0,0 +1,74 @@
1
+ Metadata-Version: 2.4
2
+ Name: tigrbl_engine_snowflake
3
+ Version: 0.1.1.dev2
4
+ Summary: Tigrbl engine plugin for Snowflake, auto-registered via entry points.
5
+ Author-email: Jacob Stewart <jacob@swarmauri.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/swarmauri/swarmauri-sdk
8
+ Project-URL: Repository, https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/tigrbl_engine_snowflake
9
+ Keywords: tigrbl,engine,plugin,snowflake,database,analytics
10
+ Classifier: Development Status :: 1 - Planning
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Environment :: Plugins
19
+ Classifier: Intended Audience :: Developers
20
+ Classifier: Topic :: Database
21
+ Classifier: Topic :: Software Development :: Libraries
22
+ Requires-Python: <3.13,>=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: SQLAlchemy<3.0,>=2.0
26
+ Requires-Dist: snowflake-sqlalchemy<2.0,>=1.5
27
+ Requires-Dist: snowflake-connector-python<4.0,>=3.0
28
+ Dynamic: license-file
29
+
30
+ # tigrbl_engine_snowflake
31
+
32
+ **Tigrbl engine plugin for Snowflake**, auto-registered via the `tigrbl.engine` entry-point group.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ pip install -e .
38
+ ```
39
+
40
+ ## Usage (inside Tigrbl)
41
+
42
+ ```python
43
+ from tigrbl.engine import Engine
44
+ from tigrbl.engine.engine_spec import EngineSpec
45
+
46
+ # DSN (Snowflake SQLAlchemy URL)
47
+ spec = EngineSpec(kind="snowflake", dsn="snowflake://USER:PWD@ACCOUNT/DB/SCHEMA?warehouse=WH&role=ROLE")
48
+
49
+ # Or provide a mapping; the plugin builds the DSN
50
+ spec = EngineSpec(kind="snowflake", mapping={
51
+ "account": "myacct-xy123",
52
+ "user": "USER",
53
+ "pwd": "PWD",
54
+ "db": "DB",
55
+ "schema": "PUBLIC",
56
+ "warehouse": "COMPUTE_WH",
57
+ "role": "SYSADMIN",
58
+ "pool_size": 10,
59
+ "max_overflow": 20
60
+ })
61
+
62
+ engine = Engine(spec)
63
+ with engine.session() as s:
64
+ s.execute("SELECT CURRENT_ROLE()").all()
65
+ ```
66
+
67
+ ## Entry-point
68
+
69
+ Declared in `pyproject.toml`:
70
+
71
+ ```toml
72
+ [project.entry-points."tigrbl.engine"]
73
+ snowflake = "tigrbl_engine_snowflake:register"
74
+ ```
@@ -0,0 +1,13 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/tigrbl_engine_snowflake/__init__.py
5
+ src/tigrbl_engine_snowflake/engine.py
6
+ src/tigrbl_engine_snowflake/session.py
7
+ src/tigrbl_engine_snowflake.egg-info/PKG-INFO
8
+ src/tigrbl_engine_snowflake.egg-info/SOURCES.txt
9
+ src/tigrbl_engine_snowflake.egg-info/dependency_links.txt
10
+ src/tigrbl_engine_snowflake.egg-info/entry_points.txt
11
+ src/tigrbl_engine_snowflake.egg-info/requires.txt
12
+ src/tigrbl_engine_snowflake.egg-info/top_level.txt
13
+ tests/test_smoke.py
@@ -0,0 +1,2 @@
1
+ [tigrbl.engine]
2
+ snowflake = tigrbl_engine_snowflake:register
@@ -0,0 +1,3 @@
1
+ SQLAlchemy<3.0,>=2.0
2
+ snowflake-sqlalchemy<2.0,>=1.5
3
+ snowflake-connector-python<4.0,>=3.0
@@ -0,0 +1,8 @@
1
+ from pathlib import Path
2
+
3
+
4
+ def test_package_assets_present() -> None:
5
+ package_dir = Path(__file__).resolve().parents[1]
6
+ assert (package_dir / "README.md").is_file()
7
+ assert (package_dir / "LICENSE").is_file()
8
+ assert (package_dir / "pyproject.toml").is_file()