snowflake-sqlalchemy 1.7.3__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.
Files changed (39) hide show
  1. snowflake/sqlalchemy/__init__.py +162 -0
  2. snowflake/sqlalchemy/_constants.py +14 -0
  3. snowflake/sqlalchemy/base.py +1188 -0
  4. snowflake/sqlalchemy/compat.py +36 -0
  5. snowflake/sqlalchemy/custom_commands.py +627 -0
  6. snowflake/sqlalchemy/custom_types.py +155 -0
  7. snowflake/sqlalchemy/exc.py +82 -0
  8. snowflake/sqlalchemy/functions.py +16 -0
  9. snowflake/sqlalchemy/parser/custom_type_parser.py +245 -0
  10. snowflake/sqlalchemy/provision.py +12 -0
  11. snowflake/sqlalchemy/requirements.py +313 -0
  12. snowflake/sqlalchemy/snowdialect.py +1029 -0
  13. snowflake/sqlalchemy/sql/__init__.py +3 -0
  14. snowflake/sqlalchemy/sql/custom_schema/__init__.py +9 -0
  15. snowflake/sqlalchemy/sql/custom_schema/clustered_table.py +37 -0
  16. snowflake/sqlalchemy/sql/custom_schema/custom_table_base.py +127 -0
  17. snowflake/sqlalchemy/sql/custom_schema/custom_table_prefix.py +13 -0
  18. snowflake/sqlalchemy/sql/custom_schema/dynamic_table.py +117 -0
  19. snowflake/sqlalchemy/sql/custom_schema/hybrid_table.py +63 -0
  20. snowflake/sqlalchemy/sql/custom_schema/iceberg_table.py +102 -0
  21. snowflake/sqlalchemy/sql/custom_schema/options/__init__.py +33 -0
  22. snowflake/sqlalchemy/sql/custom_schema/options/as_query_option.py +63 -0
  23. snowflake/sqlalchemy/sql/custom_schema/options/cluster_by_option.py +58 -0
  24. snowflake/sqlalchemy/sql/custom_schema/options/identifier_option.py +63 -0
  25. snowflake/sqlalchemy/sql/custom_schema/options/invalid_table_option.py +25 -0
  26. snowflake/sqlalchemy/sql/custom_schema/options/keyword_option.py +65 -0
  27. snowflake/sqlalchemy/sql/custom_schema/options/keywords.py +14 -0
  28. snowflake/sqlalchemy/sql/custom_schema/options/literal_option.py +67 -0
  29. snowflake/sqlalchemy/sql/custom_schema/options/table_option.py +84 -0
  30. snowflake/sqlalchemy/sql/custom_schema/options/target_lag_option.py +94 -0
  31. snowflake/sqlalchemy/sql/custom_schema/snowflake_table.py +70 -0
  32. snowflake/sqlalchemy/sql/custom_schema/table_from_query.py +54 -0
  33. snowflake/sqlalchemy/util.py +344 -0
  34. snowflake/sqlalchemy/version.py +6 -0
  35. snowflake_sqlalchemy-1.7.3.dist-info/METADATA +737 -0
  36. snowflake_sqlalchemy-1.7.3.dist-info/RECORD +39 -0
  37. snowflake_sqlalchemy-1.7.3.dist-info/WHEEL +4 -0
  38. snowflake_sqlalchemy-1.7.3.dist-info/entry_points.txt +2 -0
  39. snowflake_sqlalchemy-1.7.3.dist-info/licenses/LICENSE.txt +202 -0
@@ -0,0 +1,162 @@
1
+ #
2
+ # Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
3
+ #
4
+
5
+ import sys
6
+
7
+ if sys.version_info < (3, 8):
8
+ import importlib_metadata
9
+ else:
10
+ import importlib.metadata as importlib_metadata
11
+
12
+ from sqlalchemy.types import ( # noqa
13
+ BIGINT,
14
+ BINARY,
15
+ BOOLEAN,
16
+ CHAR,
17
+ DATE,
18
+ DATETIME,
19
+ DECIMAL,
20
+ FLOAT,
21
+ INT,
22
+ INTEGER,
23
+ REAL,
24
+ SMALLINT,
25
+ TIME,
26
+ TIMESTAMP,
27
+ VARCHAR,
28
+ )
29
+
30
+ from . import base, snowdialect # noqa
31
+ from .custom_commands import ( # noqa
32
+ AWSBucket,
33
+ AzureContainer,
34
+ CopyFormatter,
35
+ CopyIntoStorage,
36
+ CreateFileFormat,
37
+ CreateStage,
38
+ CSVFormatter,
39
+ ExternalStage,
40
+ JSONFormatter,
41
+ MergeInto,
42
+ PARQUETFormatter,
43
+ )
44
+ from .custom_types import ( # noqa
45
+ ARRAY,
46
+ BYTEINT,
47
+ CHARACTER,
48
+ DEC,
49
+ DOUBLE,
50
+ FIXED,
51
+ GEOGRAPHY,
52
+ GEOMETRY,
53
+ MAP,
54
+ NUMBER,
55
+ OBJECT,
56
+ STRING,
57
+ TEXT,
58
+ TIMESTAMP_LTZ,
59
+ TIMESTAMP_NTZ,
60
+ TIMESTAMP_TZ,
61
+ TINYINT,
62
+ VARBINARY,
63
+ VARIANT,
64
+ )
65
+ from .sql.custom_schema import ( # noqa
66
+ DynamicTable,
67
+ HybridTable,
68
+ IcebergTable,
69
+ SnowflakeTable,
70
+ )
71
+ from .sql.custom_schema.options import ( # noqa
72
+ AsQueryOption,
73
+ ClusterByOption,
74
+ IdentifierOption,
75
+ KeywordOption,
76
+ LiteralOption,
77
+ SnowflakeKeyword,
78
+ TableOptionKey,
79
+ TargetLagOption,
80
+ TimeUnit,
81
+ )
82
+ from .util import _url as URL # noqa
83
+
84
+ base.dialect = dialect = snowdialect.dialect
85
+
86
+ __version__ = importlib_metadata.version("snowflake-sqlalchemy")
87
+
88
+ _custom_types = (
89
+ "BIGINT",
90
+ "BINARY",
91
+ "BOOLEAN",
92
+ "CHAR",
93
+ "DATE",
94
+ "DATETIME",
95
+ "DECIMAL",
96
+ "FLOAT",
97
+ "INT",
98
+ "INTEGER",
99
+ "REAL",
100
+ "SMALLINT",
101
+ "TIME",
102
+ "TIMESTAMP",
103
+ "URL",
104
+ "VARCHAR",
105
+ "ARRAY",
106
+ "BYTEINT",
107
+ "CHARACTER",
108
+ "DEC",
109
+ "DOUBLE",
110
+ "FIXED",
111
+ "GEOGRAPHY",
112
+ "GEOMETRY",
113
+ "OBJECT",
114
+ "NUMBER",
115
+ "STRING",
116
+ "TEXT",
117
+ "TIMESTAMP_LTZ",
118
+ "TIMESTAMP_TZ",
119
+ "TIMESTAMP_NTZ",
120
+ "TINYINT",
121
+ "VARBINARY",
122
+ "VARIANT",
123
+ "MAP",
124
+ )
125
+
126
+ _custom_commands = (
127
+ "MergeInto",
128
+ "CSVFormatter",
129
+ "JSONFormatter",
130
+ "PARQUETFormatter",
131
+ "CopyFormatter",
132
+ "CopyIntoStorage",
133
+ "AWSBucket",
134
+ "AzureContainer",
135
+ "ExternalStage",
136
+ "CreateStage",
137
+ "CreateFileFormat",
138
+ )
139
+
140
+ _custom_tables = ("HybridTable", "DynamicTable", "IcebergTable", "SnowflakeTable")
141
+
142
+ _custom_table_options = (
143
+ "AsQueryOption",
144
+ "TargetLagOption",
145
+ "LiteralOption",
146
+ "IdentifierOption",
147
+ "KeywordOption",
148
+ "ClusterByOption",
149
+ )
150
+
151
+ _enums = (
152
+ "TimeUnit",
153
+ "TableOptionKey",
154
+ "SnowflakeKeyword",
155
+ )
156
+ __all__ = (
157
+ *_custom_types,
158
+ *_custom_commands,
159
+ *_custom_tables,
160
+ *_custom_table_options,
161
+ *_enums,
162
+ )
@@ -0,0 +1,14 @@
1
+ #
2
+ # Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
3
+ #
4
+ from .version import VERSION
5
+
6
+ # parameters needed for usage tracking
7
+ PARAM_APPLICATION = "application"
8
+ PARAM_INTERNAL_APPLICATION_NAME = "internal_application_name"
9
+ PARAM_INTERNAL_APPLICATION_VERSION = "internal_application_version"
10
+
11
+ APPLICATION_NAME = "SnowflakeSQLAlchemy"
12
+ SNOWFLAKE_SQLALCHEMY_VERSION = VERSION
13
+ DIALECT_NAME = "snowflake"
14
+ NOT_NULL = "NOT NULL"