sqlspec 0.62.1__py3-none-any.whl → 0.62.2__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.
- sqlspec/builder/_ddl.py +7 -5
- sqlspec/extensions/litestar/plugin.py +12 -3
- {sqlspec-0.62.1.dist-info → sqlspec-0.62.2.dist-info}/METADATA +1 -1
- {sqlspec-0.62.1.dist-info → sqlspec-0.62.2.dist-info}/RECORD +7 -7
- {sqlspec-0.62.1.dist-info → sqlspec-0.62.2.dist-info}/WHEEL +0 -0
- {sqlspec-0.62.1.dist-info → sqlspec-0.62.2.dist-info}/entry_points.txt +0 -0
- {sqlspec-0.62.1.dist-info → sqlspec-0.62.2.dist-info}/licenses/LICENSE +0 -0
sqlspec/builder/_ddl.py
CHANGED
|
@@ -688,7 +688,7 @@ class _SingleObjectDropBuilder(DDLBuilder, _IfExistsDDLMixin, _CascadeRestrictDD
|
|
|
688
688
|
self._require(self._name, f"{self._object_label} name must be set for DROP {self._drop_kind}.")
|
|
689
689
|
return exp.Drop(
|
|
690
690
|
kind=self._drop_kind,
|
|
691
|
-
|
|
691
|
+
tables=[self._build_drop_this()],
|
|
692
692
|
exists=self._if_exists,
|
|
693
693
|
cascade=self._cascade,
|
|
694
694
|
**self._drop_expression_args(),
|
|
@@ -1464,10 +1464,10 @@ class AlterTable(DDLBuilder, _IfExistsDDLMixin):
|
|
|
1464
1464
|
return build_column_expression(op.column_definition)
|
|
1465
1465
|
|
|
1466
1466
|
if op_type == "DROP COLUMN":
|
|
1467
|
-
return exp.Drop(
|
|
1467
|
+
return exp.Drop(tables=[exp.to_identifier(op.column_name)], kind="COLUMN", exists=True)
|
|
1468
1468
|
|
|
1469
1469
|
if op_type == "DROP COLUMN CASCADE":
|
|
1470
|
-
return exp.Drop(
|
|
1470
|
+
return exp.Drop(tables=[exp.to_identifier(op.column_name)], kind="COLUMN", cascade=True, exists=True)
|
|
1471
1471
|
|
|
1472
1472
|
if op_type == "ALTER COLUMN TYPE":
|
|
1473
1473
|
if not op.new_type:
|
|
@@ -1488,10 +1488,12 @@ class AlterTable(DDLBuilder, _IfExistsDDLMixin):
|
|
|
1488
1488
|
return exp.AddConstraint(expressions=[constraint_expr])
|
|
1489
1489
|
|
|
1490
1490
|
if op_type == "DROP CONSTRAINT":
|
|
1491
|
-
return exp.Drop(
|
|
1491
|
+
return exp.Drop(tables=[exp.to_identifier(op.constraint_name)], kind="CONSTRAINT", exists=True)
|
|
1492
1492
|
|
|
1493
1493
|
if op_type == "DROP CONSTRAINT CASCADE":
|
|
1494
|
-
return exp.Drop(
|
|
1494
|
+
return exp.Drop(
|
|
1495
|
+
tables=[exp.to_identifier(op.constraint_name)], kind="CONSTRAINT", cascade=True, exists=True
|
|
1496
|
+
)
|
|
1495
1497
|
|
|
1496
1498
|
if op_type == "ALTER COLUMN SET NOT NULL":
|
|
1497
1499
|
return exp.AlterColumn(this=exp.to_identifier(op.column_name), allow_null=False)
|
|
@@ -833,12 +833,21 @@ class SQLSpecPlugin(InitPluginProtocol, CLIPlugin):
|
|
|
833
833
|
Args:
|
|
834
834
|
name: A ``session_key``, ``connection_key``, or ``pool_key``.
|
|
835
835
|
|
|
836
|
+
Raises:
|
|
837
|
+
KeyError: If ``name`` is not a known dependency key.
|
|
838
|
+
|
|
836
839
|
Returns:
|
|
837
840
|
The matching plugin state.
|
|
838
841
|
"""
|
|
839
|
-
if
|
|
840
|
-
self.
|
|
841
|
-
|
|
842
|
+
if isinstance(name, str) and any(
|
|
843
|
+
name in {state.connection_key, state.pool_key, state.session_key} for state in self._plugin_configs
|
|
844
|
+
):
|
|
845
|
+
if any(state.annotation is None for state in self._plugin_configs):
|
|
846
|
+
self._raise_plugin_not_registered()
|
|
847
|
+
return self._get_plugin_state(name)
|
|
848
|
+
self._raise_config_not_found(name)
|
|
849
|
+
msg = "unreachable"
|
|
850
|
+
raise AssertionError(msg)
|
|
842
851
|
|
|
843
852
|
def _get_plugin_state(
|
|
844
853
|
self, key: "str | DatabaseConfigProtocol[Any, Any, Any] | type[DatabaseConfigProtocol[Any, Any, Any]]"
|
|
@@ -274,7 +274,7 @@ sqlspec/adapters/sqlite/litestar/store.py,sha256=d8Uk2YdbbkpIWKhLmVWue16fXVRfALx
|
|
|
274
274
|
sqlspec/builder/__init__.py,sha256=S-yrPxGah-kKg0OtDE05qkB8nIRsVlNmtsP5dEchKW8,4380
|
|
275
275
|
sqlspec/builder/_base.py,sha256=JPhbA_NyHsvB1cCvkyX4qYmfYKIR5-Hb3Xt3h4y3ACA,39774
|
|
276
276
|
sqlspec/builder/_column.py,sha256=_Do3Xt7wkk2uEmdNKIIx3uMgEjdeXhGMmQbMbIefQ1Y,16312
|
|
277
|
-
sqlspec/builder/_ddl.py,sha256=
|
|
277
|
+
sqlspec/builder/_ddl.py,sha256=bNpLdHYo9z_N5U518dR2ua2Se8sFgD2pR8a8OAFQk_M,58106
|
|
278
278
|
sqlspec/builder/_delete.py,sha256=--KFsRs1XUA3TE1PZNd5YQgmyCJGaA4GvEGgiUho80U,2614
|
|
279
279
|
sqlspec/builder/_dml.py,sha256=1uQJ9jcXXHTQcfe00voNmEIxLvoaRAjZgScLZF_jO4w,15373
|
|
280
280
|
sqlspec/builder/_explain.py,sha256=S7wDHWeraZDft_hJZm6ajgJiwIzRo6E5-yIXThhTsH4,18813
|
|
@@ -583,7 +583,7 @@ sqlspec/extensions/litestar/channels.py,sha256=W-EKVEmXOPrdrcsNh1a-FzIWGcdEE6V24
|
|
|
583
583
|
sqlspec/extensions/litestar/cli.py,sha256=6ZHIWNT0RPzgr3LOKVAIEk9hUcyJTMUKgnpjkBrdliA,3476
|
|
584
584
|
sqlspec/extensions/litestar/config.py,sha256=EvHRJjAdGuJkbRj0Ke7QsU6eXef_okLLPm0-atD4uXM,3597
|
|
585
585
|
sqlspec/extensions/litestar/handlers.py,sha256=VTtBoCfl8zxtEe9N1_aZrFA4ILrEbP_2FjFuFg-9FF4,11162
|
|
586
|
-
sqlspec/extensions/litestar/plugin.py,sha256=
|
|
586
|
+
sqlspec/extensions/litestar/plugin.py,sha256=t_e1MHDOx-8Hzn9s7Ua7elcWh68Ove8GVED0xaN6a_8,46506
|
|
587
587
|
sqlspec/extensions/litestar/providers.py,sha256=ofpZf9EJbXVmVyqKkAM2ef1HM_4bEzpAT7EvK1Ejf7k,41361
|
|
588
588
|
sqlspec/extensions/litestar/store.py,sha256=4b9QC4s7R7Xh_6WDbrGKyES__XZuIhtpWw_6uUTDHBg,9996
|
|
589
589
|
sqlspec/extensions/litestar/migrations/0001_create_session_table.py,sha256=60HehSre1tXoHaOBx_75Hha-7smWP61RYrRVBYnIo8w,4206
|
|
@@ -665,8 +665,8 @@ sqlspec/utils/serializers/__init__.py,sha256=X99t8YMHVGmKwrqPxumnSXu4JMJL8SpKoU7
|
|
|
665
665
|
sqlspec/utils/serializers/_json.py,sha256=5PBan5kHoDAGqbOqT33SdEK17VZzNjzZKneWI_BnDzY,18136
|
|
666
666
|
sqlspec/utils/serializers/_numpy.py,sha256=_LllCtVn_gyLrRG2naHM7Unjtpot86BPTvGPlZuAGRw,1742
|
|
667
667
|
sqlspec/utils/serializers/_schema.py,sha256=kN8lW8GJa08yMi_qN_x8A7XpO7V6aAaoYqKq72rxaCk,11416
|
|
668
|
-
sqlspec-0.62.
|
|
669
|
-
sqlspec-0.62.
|
|
670
|
-
sqlspec-0.62.
|
|
671
|
-
sqlspec-0.62.
|
|
672
|
-
sqlspec-0.62.
|
|
668
|
+
sqlspec-0.62.2.dist-info/METADATA,sha256=pdDXwLK4BTqODd8EBgo8AAaRs7cRPDUh4sRvnZYACyY,9066
|
|
669
|
+
sqlspec-0.62.2.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
670
|
+
sqlspec-0.62.2.dist-info/entry_points.txt,sha256=T_1g2gTpkUsl6YC-KSCoNS5r7CPG2kn6wyp1WyMvpqU,404
|
|
671
|
+
sqlspec-0.62.2.dist-info/licenses/LICENSE,sha256=MdujfZ6l5HuLz4mElxlu049itenOR3gnhN1_Nd3nVcM,1078
|
|
672
|
+
sqlspec-0.62.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|