fakesnow 0.9.17__py3-none-any.whl → 0.9.18__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/fakes.py CHANGED
@@ -611,7 +611,7 @@ class FakeSnowflakeConnection:
611
611
  cursors = [
612
612
  self.cursor(cursor_class).execute(e.sql(dialect="snowflake"))
613
613
  for e in sqlglot.parse(sql_text, read="snowflake")
614
- if e
614
+ if e and not isinstance(e, exp.Semicolon) # ignore comments
615
615
  ]
616
616
  return cursors if return_cursors else []
617
617
 
fakesnow/transforms.py CHANGED
@@ -119,9 +119,11 @@ def create_database(expression: exp.Expression, db_path: Path | None = None) ->
119
119
  db_name = ident.this
120
120
  db_file = f"{db_path/db_name}.db" if db_path else ":memory:"
121
121
 
122
+ if_not_exists = "IF NOT EXISTS " if expression.args.get("exists") else ""
123
+
122
124
  return exp.Command(
123
125
  this="ATTACH",
124
- expression=exp.Literal(this=f"DATABASE '{db_file}' AS {db_name}", is_string=True),
126
+ expression=exp.Literal(this=f"{if_not_exists}DATABASE '{db_file}' AS {db_name}", is_string=True),
125
127
  create_db_name=db_name,
126
128
  )
127
129
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fakesnow
3
- Version: 0.9.17
3
+ Version: 0.9.18
4
4
  Summary: Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally.
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -3,16 +3,16 @@ fakesnow/__main__.py,sha256=GDrGyNTvBFuqn_UfDjKs7b3LPtU6gDv1KwosVDrukIM,76
3
3
  fakesnow/checks.py,sha256=-QMvdcrRbhN60rnzxLBJ0IkUBWyLR8gGGKKmCS0w9mA,2383
4
4
  fakesnow/cli.py,sha256=9qfI-Ssr6mo8UmIlXkUAOz2z2YPBgDsrEVaZv9FjGFs,2201
5
5
  fakesnow/expr.py,sha256=CAxuYIUkwI339DQIBzvFF0F-m1tcVGKEPA5rDTzmH9A,892
6
- fakesnow/fakes.py,sha256=lKGuMyyvrO0n4-yVplL2rTYBvNvxUi369mbNHHgm9K4,30500
6
+ fakesnow/fakes.py,sha256=u2EDQ_fXQFFx5bq5pgLrUXV33Flgg5U82L7LIvFiqGw,30556
7
7
  fakesnow/fixtures.py,sha256=G-NkVeruSQAJ7fvSS2fR2oysUn0Yra1pohHlOvacKEk,455
8
8
  fakesnow/global_database.py,sha256=WTVIP1VhNvdCeX7TQncX1TRpGQU5rBf5Pbxim40zeSU,1399
9
9
  fakesnow/info_schema.py,sha256=CdIcGXHEQ_kmEAzdQKvA-PX41LA6wlK-4p1J45qgKYA,6266
10
10
  fakesnow/macros.py,sha256=pX1YJDnQOkFJSHYUjQ6ErEkYIKvFI6Ncz_au0vv1csA,265
11
11
  fakesnow/py.typed,sha256=B-DLSjYBi7pkKjwxCSdpVj2J02wgfJr-E7B1wOUyxYU,80
12
- fakesnow/transforms.py,sha256=OJfn5VQQnBBnaR7aumeOn-KsIR8rDmmheYXUr6iWNKc,52550
13
- fakesnow-0.9.17.dist-info/LICENSE,sha256=kW-7NWIyaRMQiDpryfSmF2DObDZHGR1cJZ39s6B1Svg,11344
14
- fakesnow-0.9.17.dist-info/METADATA,sha256=EeO3vtWPNrpM_Phvnaqa2unyRgync6U5Ea6YwWHtA78,17839
15
- fakesnow-0.9.17.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
16
- fakesnow-0.9.17.dist-info/entry_points.txt,sha256=2riAUgu928ZIHawtO8EsfrMEJhi-EH-z_Vq7Q44xKPM,47
17
- fakesnow-0.9.17.dist-info/top_level.txt,sha256=500evXI1IFX9so82cizGIEMHAb_dJNPaZvd2H9dcKTA,24
18
- fakesnow-0.9.17.dist-info/RECORD,,
12
+ fakesnow/transforms.py,sha256=1xok38tft_VowwSm8kKA3P3OEZEeGF09hqfpawxXNaY,52648
13
+ fakesnow-0.9.18.dist-info/LICENSE,sha256=kW-7NWIyaRMQiDpryfSmF2DObDZHGR1cJZ39s6B1Svg,11344
14
+ fakesnow-0.9.18.dist-info/METADATA,sha256=cmS6VqDOHlkSZgfhT7biB03DuSktq4DNtv3EYbFDrrg,17839
15
+ fakesnow-0.9.18.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
16
+ fakesnow-0.9.18.dist-info/entry_points.txt,sha256=2riAUgu928ZIHawtO8EsfrMEJhi-EH-z_Vq7Q44xKPM,47
17
+ fakesnow-0.9.18.dist-info/top_level.txt,sha256=500evXI1IFX9so82cizGIEMHAb_dJNPaZvd2H9dcKTA,24
18
+ fakesnow-0.9.18.dist-info/RECORD,,