Commit 85b0ec6
committed
feat: add spatial type support (geography, geometry, hierarchyid)
Add SQL_SS_UDT (-151) handling for SQL Server spatial types, enabling
geography, geometry, and hierarchyid columns to be fetched as raw bytes.
C++ changes (ddbc_bindings.cpp):
- SQLGetData_wrap: SQL_SS_UDT falls through to SQL_BINARY
- SQLBindColumns: SQL_SS_UDT falls through to SQL_BINARY
- FetchBatchData: SQL_SS_UDT falls through to ProcessBinary
- calculateRowSize: SQL_SS_UDT with LOB-size fallback for 0/SQL_NO_TOTAL
- FetchMany_wrap/FetchAll_wrap: SQL_SS_UDT added to LOB detection
Python changes:
- constants.py: SQL_SS_UDT = -151 in ConstantsDDBC enum + get_valid_types()
- cursor.py: SQL_SS_UDT -> SQL_C_BINARY in _get_c_type_for_sql_type,
SQL_SS_UDT -> bytes in _map_data_type
Tests: 37 tests covering all three spatial types across fetch paths
(fetchone, fetchmany, fetchall, executemany), NULL handling, mixed-column
queries, output converters, description metadata, spatial methods, error
handling, and binary output consistency.1 parent c4e647e commit 85b0ec6
File tree
4 files changed
+842
-2
lines changed- mssql_python
- pybind
- tests
4 files changed
+842
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
374 | 375 | | |
375 | 376 | | |
376 | 377 | | |
| 378 | + | |
377 | 379 | | |
378 | 380 | | |
379 | 381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
| 868 | + | |
868 | 869 | | |
869 | 870 | | |
870 | 871 | | |
| |||
1097 | 1098 | | |
1098 | 1099 | | |
1099 | 1100 | | |
| 1101 | + | |
1100 | 1102 | | |
1101 | 1103 | | |
1102 | 1104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
3285 | 3286 | | |
3286 | 3287 | | |
3287 | 3288 | | |
| 3289 | + | |
3288 | 3290 | | |
3289 | 3291 | | |
3290 | 3292 | | |
| |||
3555 | 3557 | | |
3556 | 3558 | | |
3557 | 3559 | | |
| 3560 | + | |
3558 | 3561 | | |
3559 | 3562 | | |
3560 | 3563 | | |
| |||
3683 | 3686 | | |
3684 | 3687 | | |
3685 | 3688 | | |
| 3689 | + | |
3686 | 3690 | | |
3687 | 3691 | | |
3688 | 3692 | | |
| |||
3981 | 3985 | | |
3982 | 3986 | | |
3983 | 3987 | | |
| 3988 | + | |
| 3989 | + | |
| 3990 | + | |
| 3991 | + | |
3984 | 3992 | | |
3985 | 3993 | | |
3986 | 3994 | | |
| |||
4043 | 4051 | | |
4044 | 4052 | | |
4045 | 4053 | | |
4046 | | - | |
| 4054 | + | |
| 4055 | + | |
4047 | 4056 | | |
4048 | 4057 | | |
4049 | 4058 | | |
| |||
4177 | 4186 | | |
4178 | 4187 | | |
4179 | 4188 | | |
4180 | | - | |
| 4189 | + | |
| 4190 | + | |
4181 | 4191 | | |
4182 | 4192 | | |
4183 | 4193 | | |
| |||
0 commit comments