atoti-client-directquery-redshift 0.9.0__py3-none-any.whl

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,24 @@
1
+ Metadata-Version: 2.1
2
+ Name: atoti-client-directquery-redshift
3
+ Version: 0.9.0
4
+ Summary: Code to use DirectQuery on Redshift
5
+ Home-page: https://www.atoti.io
6
+ License: Proprietary
7
+ Keywords: atoti,cloud,database,directquery,redshift
8
+ Author: ActiveViam
9
+ Author-email: dev@atoti.io
10
+ Requires-Python: >=3.10
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: License :: Free To Use But Restricted
13
+ Classifier: License :: Other/Proprietary License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Typing :: Typed
20
+ Requires-Dist: atoti-client (==0.9.0)
21
+ Requires-Dist: pydantic (>=2.6.0)
22
+ Requires-Dist: typing-extensions (>=4.6.1)
23
+ Project-URL: Bug Tracker, https://github.com/atoti/atoti/issues
24
+ Project-URL: Documentation, https://docs.atoti.io/0.9.0/api/atoti_directquery_redshift.html
@@ -0,0 +1,7 @@
1
+ atoti_directquery_redshift/__init__.py,sha256=aOv4OgEzcvV-upqEDWUX6jtipCMtSrQUqtIryWO8HSo,211
2
+ atoti_directquery_redshift/connection_config.py,sha256=cTtAZv7Qh_hab7HAdxjGEpmMWSCC86RazgAbyQROGO8,2205
3
+ atoti_directquery_redshift/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ atoti_directquery_redshift/table_config.py,sha256=7CadjwF-k-7tHYTagkWNDNE4yWF0gkIy94zPxphHZsc,525
5
+ atoti_client_directquery_redshift-0.9.0.dist-info/METADATA,sha256=FGwD7pnGnkHhMdPi1fY5IwNFtVrcamJG2EjPHJxGw8c,986
6
+ atoti_client_directquery_redshift-0.9.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
7
+ atoti_client_directquery_redshift-0.9.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 1.8.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,4 @@
1
+ """Code to use DirectQuery on Amazon `Redshift <https://aws.amazon.com/redshift/>`__."""
2
+
3
+ from .connection_config import ConnectionConfig as ConnectionConfig
4
+ from .table_config import TableConfig as TableConfig
@@ -0,0 +1,75 @@
1
+ from typing import Annotated, final
2
+
3
+ from atoti._pydantic import PYDANTIC_CONFIG as _PYDANTIC_CONFIG
4
+ from atoti.directquery._external_database_connection_config import (
5
+ AutoMultiColumnArrayConversionConfig,
6
+ CacheConfig,
7
+ ExternalDatabaseConnectionConfig,
8
+ PasswordConfig,
9
+ )
10
+ from pydantic import Field
11
+ from pydantic.dataclasses import dataclass
12
+ from typing_extensions import override
13
+
14
+
15
+ @final
16
+ @dataclass(config=_PYDANTIC_CONFIG, frozen=True, kw_only=True)
17
+ class ConnectionConfig(
18
+ ExternalDatabaseConnectionConfig,
19
+ AutoMultiColumnArrayConversionConfig,
20
+ CacheConfig,
21
+ PasswordConfig,
22
+ ):
23
+ """Config to connect to a Redshift database.
24
+
25
+ Example:
26
+ >>> import os
27
+ >>> from atoti_directquery_redshift import ConnectionConfig
28
+ >>> connection_config = ConnectionConfig(
29
+ ... url="jdbc:redshift://"
30
+ ... + os.environ["REDSHIFT_ACCOUNT_IDENTIFIER"]
31
+ ... + ".redshift.amazonaws.com:5439/dev?user="
32
+ ... + os.environ["REDSHIFT_USERNAME"]
33
+ ... + "&schema=test_resources",
34
+ ... password=os.environ["REDSHIFT_PASSWORD"],
35
+ ... )
36
+ >>> external_database = session.connect_to_external_database(connection_config)
37
+
38
+ """
39
+
40
+ url: str
41
+ """The JDBC connection string."""
42
+
43
+ connection_pool_size: Annotated[
44
+ int,
45
+ Field(gt=0),
46
+ ] = 450 # Keep in sync with Java default
47
+ """The maximum size that the pool is allowed to reach, including both idle and in-use connections.
48
+
49
+ When the pool reaches this size, and no idle connections are available, the creation of new connections will block.
50
+ """
51
+
52
+ @property
53
+ @override
54
+ def _database_key(self) -> str:
55
+ return "REDSHIFT"
56
+
57
+ @property
58
+ @override
59
+ def _options(self) -> dict[str, str]:
60
+ return {
61
+ **super()._options,
62
+ **self._auto_multi_array_conversion_options,
63
+ **self._cache_options,
64
+ "CONNECTION_POOL_SIZE": str(self.connection_pool_size),
65
+ }
66
+
67
+ @property
68
+ @override
69
+ def _password(self) -> str | None:
70
+ return self.password
71
+
72
+ @property
73
+ @override
74
+ def _url(self) -> str | None:
75
+ return self.url
File without changes
@@ -0,0 +1,19 @@
1
+ from typing import final
2
+
3
+ from atoti._pydantic import PYDANTIC_CONFIG as _PYDANTIC_CONFIG
4
+ from atoti.directquery._external_table_config import (
5
+ ArrayConversionConfig,
6
+ ExternalTableConfig,
7
+ )
8
+ from pydantic.dataclasses import dataclass
9
+
10
+ from .connection_config import ConnectionConfig
11
+
12
+
13
+ @final
14
+ @dataclass(config=_PYDANTIC_CONFIG, frozen=True, kw_only=True)
15
+ class TableConfig(
16
+ ExternalTableConfig[ConnectionConfig],
17
+ ArrayConversionConfig,
18
+ ):
19
+ """Config passed to :meth:`~atoti.Session.add_external_table`."""