sqlspec 0.72.1__py3-none-any.whl → 0.72.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/driver/_common.py CHANGED
@@ -1989,24 +1989,32 @@ class CommonDriverAttributesMixin:
1989
1989
 
1990
1990
  @overload
1991
1991
  @staticmethod
1992
- def to_schema(data: "list[dict[str, Any]]", *, schema_type: "type[SchemaT]") -> "list[SchemaT]": ...
1992
+ def to_schema(
1993
+ data: "list[dict[str, Any]]", *, schema_type: "type[SchemaT]", normalize_nested: bool = True
1994
+ ) -> "list[SchemaT]": ...
1993
1995
  @overload
1994
1996
  @staticmethod
1995
- def to_schema(data: "list[dict[str, Any]]", *, schema_type: None = None) -> "list[dict[str, Any]]": ...
1997
+ def to_schema(
1998
+ data: "list[dict[str, Any]]", *, schema_type: None = None, normalize_nested: bool = True
1999
+ ) -> "list[dict[str, Any]]": ...
1996
2000
  @overload
1997
2001
  @staticmethod
1998
- def to_schema(data: "dict[str, Any]", *, schema_type: "type[SchemaT]") -> "SchemaT": ...
2002
+ def to_schema(
2003
+ data: "dict[str, Any]", *, schema_type: "type[SchemaT]", normalize_nested: bool = True
2004
+ ) -> "SchemaT": ...
1999
2005
  @overload
2000
2006
  @staticmethod
2001
- def to_schema(data: "dict[str, Any]", *, schema_type: None = None) -> "dict[str, Any]": ...
2007
+ def to_schema(
2008
+ data: "dict[str, Any]", *, schema_type: None = None, normalize_nested: bool = True
2009
+ ) -> "dict[str, Any]": ...
2002
2010
  @overload
2003
2011
  @staticmethod
2004
- def to_schema(data: Any, *, schema_type: "type[SchemaT]") -> Any: ...
2012
+ def to_schema(data: Any, *, schema_type: "type[SchemaT]", normalize_nested: bool = True) -> Any: ...
2005
2013
  @overload
2006
2014
  @staticmethod
2007
- def to_schema(data: Any, *, schema_type: None = None) -> Any: ...
2015
+ def to_schema(data: Any, *, schema_type: None = None, normalize_nested: bool = True) -> Any: ...
2008
2016
  @staticmethod
2009
- def to_schema(data: Any, *, schema_type: "type[Any] | None" = None) -> Any:
2017
+ def to_schema(data: Any, *, schema_type: "type[Any] | None" = None, normalize_nested: bool = True) -> Any:
2010
2018
  """Convert data to a specified schema type.
2011
2019
 
2012
2020
  Supports transformation to various schema types including:
@@ -2019,11 +2027,14 @@ class CommonDriverAttributesMixin:
2019
2027
  Args:
2020
2028
  data: Input data to convert (dict, list of dicts, or other).
2021
2029
  schema_type: Target schema type for conversion. If None, returns data unchanged.
2030
+ normalize_nested: Accept Python field names inside nested msgspec Structs.
2031
+ Defaults to True for driver-level SQL mapping; pass False to require
2032
+ encoded field names in nested structs.
2022
2033
 
2023
2034
  Returns:
2024
2035
  Converted data in the specified schema type, or original data if schema_type is None.
2025
2036
  """
2026
- return _to_schema_impl(data, schema_type=schema_type)
2037
+ return _to_schema_impl(data, schema_type=schema_type, normalize_nested=normalize_nested)
2027
2038
 
2028
2039
  def create_execution_result(
2029
2040
  self,
@@ -104,26 +104,34 @@ class _RoutingSessionState:
104
104
 
105
105
  @overload
106
106
  @staticmethod
107
- def to_schema(data: "list[dict[str, Any]]", *, schema_type: "type[SchemaT]") -> "list[SchemaT]": ...
107
+ def to_schema(
108
+ data: "list[dict[str, Any]]", *, schema_type: "type[SchemaT]", normalize_nested: bool = True
109
+ ) -> "list[SchemaT]": ...
108
110
  @overload
109
111
  @staticmethod
110
- def to_schema(data: "list[dict[str, Any]]", *, schema_type: None = None) -> "list[dict[str, Any]]": ...
112
+ def to_schema(
113
+ data: "list[dict[str, Any]]", *, schema_type: None = None, normalize_nested: bool = True
114
+ ) -> "list[dict[str, Any]]": ...
111
115
  @overload
112
116
  @staticmethod
113
- def to_schema(data: "dict[str, Any]", *, schema_type: "type[SchemaT]") -> "SchemaT": ...
117
+ def to_schema(
118
+ data: "dict[str, Any]", *, schema_type: "type[SchemaT]", normalize_nested: bool = True
119
+ ) -> "SchemaT": ...
114
120
  @overload
115
121
  @staticmethod
116
- def to_schema(data: "dict[str, Any]", *, schema_type: None = None) -> "dict[str, Any]": ...
122
+ def to_schema(
123
+ data: "dict[str, Any]", *, schema_type: None = None, normalize_nested: bool = True
124
+ ) -> "dict[str, Any]": ...
117
125
  @overload
118
126
  @staticmethod
119
- def to_schema(data: Any, *, schema_type: "type[SchemaT]") -> Any: ...
127
+ def to_schema(data: Any, *, schema_type: "type[SchemaT]", normalize_nested: bool = True) -> Any: ...
120
128
  @overload
121
129
  @staticmethod
122
- def to_schema(data: Any, *, schema_type: None = None) -> Any: ...
130
+ def to_schema(data: Any, *, schema_type: None = None, normalize_nested: bool = True) -> Any: ...
123
131
  @staticmethod
124
- def to_schema(data: Any, *, schema_type: "type[Any] | None" = None) -> Any:
132
+ def to_schema(data: Any, *, schema_type: "type[Any] | None" = None, normalize_nested: bool = True) -> Any:
125
133
  """Map records to a public schema without checking out a connection."""
126
- return CommonDriverAttributesMixin.to_schema(data, schema_type=schema_type)
134
+ return CommonDriverAttributesMixin.to_schema(data, schema_type=schema_type, normalize_nested=normalize_nested)
127
135
 
128
136
  def storage_capabilities(self) -> "StorageCapabilities":
129
137
  """Return primary driver storage capabilities without acquiring a connection."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: sqlspec
3
- Version: 0.72.1
3
+ Version: 0.72.2
4
4
  Summary: SQL Experiments in Python
5
5
  Project-URL: Discord, https://discord.gg/litestar
6
6
  Project-URL: Documentation, https://sqlspec.dev
@@ -708,10 +708,10 @@ sqlspec/dialects/teradata/__init__.py,sha256=R1Jn05VGI9hqZnytJnpsfZ5nmpA0BN0Cg3N
708
708
  sqlspec/dialects/teradata/_generators.py,sha256=kaCsIBK6npbBrwPSLNonA9psFIg3UGvd0sjuPjvjp6Q,8621
709
709
  sqlspec/driver/__init__.py,sha256=DgH5_p3WXDyjNnWpoG3bykju1eBpb2zNeBsQipOwmFQ,6675
710
710
  sqlspec/driver/_async.py,sha256=7-rjny3xkxr_MpF9jsBguCQGlZw6xXNC1AaNkpQeqgo,137804
711
- sqlspec/driver/_common.py,sha256=7O0E6KLZVNoYk8wbJmoa_49O3DvpkFP9_Rx5RDWXQfk,203698
711
+ sqlspec/driver/_common.py,sha256=1GywgdYvu1DiFvFpUmWwoDhkrhFd3z7Y2Ul4XbrWtPM,204233
712
712
  sqlspec/driver/_deferred.py,sha256=EFxPixSKiBgyG3NE_qs5NI98rLZ1gz1zVUoaqrVSIz8,9254
713
713
  sqlspec/driver/_exception_handler.py,sha256=18vg4WzGHWpRZ6KJiN_SFc-oA81wNV6jrItnLRjHGxU,7775
714
- sqlspec/driver/_routing.py,sha256=3syZDCvuzFDDnU2IKP55VzqJ8LOE-PZdel7ov18lCqM,113644
714
+ sqlspec/driver/_routing.py,sha256=UnLBK1iZDFCpfUF77eKxinXln7fUCY5mUycOLStquDw,113952
715
715
  sqlspec/driver/_session.py,sha256=ZOILQTZRKLFIM8_QlWxDDyMZgO6QeQEfukwhaIWyv70,6958
716
716
  sqlspec/driver/_sql_helpers.py,sha256=EHo68qUfJLKnURluQpIZDkMMnwDcHW7XhJyZzux2rXY,3804
717
717
  sqlspec/driver/_stream.py,sha256=mvnEJW_JSw0e4BsO3rYJoWrsApC9bBmZbofvzBbx4JA,13741
@@ -863,8 +863,8 @@ sqlspec/utils/tenant/_context.py,sha256=O6lxlr6HSfeeZQP3OTFBum_W1DOG8iq5ChP34XMe
863
863
  sqlspec/utils/tenant/_cursor.py,sha256=kb0wLDytHCmzt90A87UudL2KGxQB0MhDeDqgipFICgI,1545
864
864
  sqlspec/utils/tenant/_mssql.py,sha256=uTnN01Cpr_2m0Pvb8kfZ6wqfDyFXZ4ukiG6FQLTJTcI,7917
865
865
  sqlspec/utils/tenant/_postgres.py,sha256=0gUO1Dl0FaqNyuc2PqNX1sSI3mRKQI6yJhHHQFwrv0M,6796
866
- sqlspec-0.72.1.dist-info/METADATA,sha256=X97vUetIPk-XFMIdoDNdwV8OdY-8raMDG4z6NTNyF_g,10961
867
- sqlspec-0.72.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
868
- sqlspec-0.72.1.dist-info/entry_points.txt,sha256=hsTkC00AkZrDhV7ZFQ4luVbx9IfSe_FtIRvdySwwe7M,473
869
- sqlspec-0.72.1.dist-info/licenses/LICENSE,sha256=MdujfZ6l5HuLz4mElxlu049itenOR3gnhN1_Nd3nVcM,1078
870
- sqlspec-0.72.1.dist-info/RECORD,,
866
+ sqlspec-0.72.2.dist-info/METADATA,sha256=tVXegUI--K-JKDahLaoiO8VtwWbkhOz-L-4c3TEtksc,10961
867
+ sqlspec-0.72.2.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
868
+ sqlspec-0.72.2.dist-info/entry_points.txt,sha256=hsTkC00AkZrDhV7ZFQ4luVbx9IfSe_FtIRvdySwwe7M,473
869
+ sqlspec-0.72.2.dist-info/licenses/LICENSE,sha256=MdujfZ6l5HuLz4mElxlu049itenOR3gnhN1_Nd3nVcM,1078
870
+ sqlspec-0.72.2.dist-info/RECORD,,