fakesnow 0.6.0__py3-none-any.whl → 0.7.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.
- fakesnow/info_schema.py +19 -0
- {fakesnow-0.6.0.dist-info → fakesnow-0.7.0.dist-info}/METADATA +5 -1
- {fakesnow-0.6.0.dist-info → fakesnow-0.7.0.dist-info}/RECORD +6 -6
- {fakesnow-0.6.0.dist-info → fakesnow-0.7.0.dist-info}/WHEEL +1 -1
- {fakesnow-0.6.0.dist-info → fakesnow-0.7.0.dist-info}/LICENSE +0 -0
- {fakesnow-0.6.0.dist-info → fakesnow-0.7.0.dist-info}/top_level.txt +0 -0
fakesnow/info_schema.py
CHANGED
@@ -59,12 +59,31 @@ AND ext_table_name = table_name AND ext_column_name = column_name
|
|
59
59
|
"""
|
60
60
|
)
|
61
61
|
|
62
|
+
# replicates https://docs.snowflake.com/sql-reference/info-schema/databases
|
63
|
+
SQL_CREATE_INFORMATION_SCHEMA_DATABASES_VIEW = Template(
|
64
|
+
"""
|
65
|
+
create view ${catalog}.information_schema.databases AS
|
66
|
+
select
|
67
|
+
catalog_name as database_name,
|
68
|
+
'SYSADMIN' as database_owner,
|
69
|
+
'NO' as is_transient,
|
70
|
+
null as comment,
|
71
|
+
to_timestamp(0)::timestamptz as created,
|
72
|
+
to_timestamp(0)::timestamptz as last_altered,
|
73
|
+
1 as retention_time,
|
74
|
+
'STANDARD' as type
|
75
|
+
from information_schema.schemata
|
76
|
+
where catalog_name not in ('memory', 'system', 'temp') and schema_name = 'information_schema'
|
77
|
+
"""
|
78
|
+
)
|
79
|
+
|
62
80
|
|
63
81
|
def creation_sql(catalog: str) -> str:
|
64
82
|
return f"""
|
65
83
|
{SQL_CREATE_INFORMATION_SCHEMA_TABLES_EXT.substitute(catalog=catalog)};
|
66
84
|
{SQL_CREATE_INFORMATION_SCHEMA_COLUMNS_EXT.substitute(catalog=catalog)};
|
67
85
|
{SQL_CREATE_INFORMATION_SCHEMA_COLUMNS_VIEW.substitute(catalog=catalog)};
|
86
|
+
{SQL_CREATE_INFORMATION_SCHEMA_DATABASES_VIEW.substitute(catalog=catalog)};
|
68
87
|
"""
|
69
88
|
|
70
89
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fakesnow
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.7.0
|
4
4
|
Summary: Fake Snowflake Connector for Python. Run Snowflake DB locally.
|
5
5
|
License: MIT License
|
6
6
|
|
@@ -144,6 +144,10 @@ Partial support
|
|
144
144
|
|
145
145
|
For more detail see [tests/test_fakes.py](tests/test_fakes.py)
|
146
146
|
|
147
|
+
## Caveats
|
148
|
+
|
149
|
+
- VARCHAR field sizes are not enforced unlike Snowflake which will error with "User character length limit (xxx) exceeded by string" when you try to insert a string longer than the column limit.
|
150
|
+
|
147
151
|
## Contributing
|
148
152
|
|
149
153
|
See [CONTRIBUTING.md](CONTRIBUTING.md) to get started and develop in this repo.
|
@@ -3,11 +3,11 @@ fakesnow/checks.py,sha256=1qVLR0ZB3z3UPij3Hm8hqlkcNLH2QJnwe8OqkoFCwv8,2356
|
|
3
3
|
fakesnow/expr.py,sha256=CAxuYIUkwI339DQIBzvFF0F-m1tcVGKEPA5rDTzmH9A,892
|
4
4
|
fakesnow/fakes.py,sha256=xlhuB0teuW3ftNUra93h1HiiRwyupDnoqQYW8RosGwA,21508
|
5
5
|
fakesnow/fixtures.py,sha256=LANb4LuiUjKbTZRHmgnAi50xC1rs1xF8SHLoBikB88c,509
|
6
|
-
fakesnow/info_schema.py,sha256=
|
6
|
+
fakesnow/info_schema.py,sha256=3lkpRI_ByXbA1PwZ3hh4PtB9aLAsRbkI4MM_hTaOce8,4544
|
7
7
|
fakesnow/py.typed,sha256=B-DLSjYBi7pkKjwxCSdpVj2J02wgfJr-E7B1wOUyxYU,80
|
8
8
|
fakesnow/transforms.py,sha256=v7-Erd5cyK4dqw5jXkkQKIWp9j7lYeWaGhFeAnjGQsY,22962
|
9
|
-
fakesnow-0.
|
10
|
-
fakesnow-0.
|
11
|
-
fakesnow-0.
|
12
|
-
fakesnow-0.
|
13
|
-
fakesnow-0.
|
9
|
+
fakesnow-0.7.0.dist-info/LICENSE,sha256=BL6v_VTnU7xdsocviIQJMFr3stX_-uRfTyByo3gRu4M,1071
|
10
|
+
fakesnow-0.7.0.dist-info/METADATA,sha256=UMNSLxz4REM3ha9JGd-dh_y06fv6C8EczHyI_SFo1bo,5421
|
11
|
+
fakesnow-0.7.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
12
|
+
fakesnow-0.7.0.dist-info/top_level.txt,sha256=x8S-sMmvfgNm2_1w0zlIF5YlDs2hR7eNQdVA6TgmPZE,14
|
13
|
+
fakesnow-0.7.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|