Commit 0927dda
committed
feat: add spatial type support (geography, geometry, hierarchyid)
Add SQL_SS_UDT (-151) handling so geography, geometry, and hierarchyid
columns are fetched as bytes instead of raising errors.
C++ changes (ddbc_bindings.cpp):
- Define SQL_SS_UDT constant
- Add case fallthroughs to SQL_BINARY in SQLGetData_wrap, SQLBindColums,
and FetchBatchData
- Separate calculateRowSize case with LOB-size fallback
- Include SQL_SS_UDT in LOB detection for FetchMany_wrap and FetchAll_wrap
Python changes:
- constants.py: SQL_SS_UDT = -151 in ConstantsDDBC enum
- cursor.py: SQL_SS_UDT -> SQL_C_BINARY in sql_to_c_type map
- cursor.py: SQL_SS_UDT -> bytes in sql_to_python_type map
Tests:
- 37 tests covering all three UDT types (geography, geometry, hierarchyid)
- Fetch paths: fetchone, fetchmany, fetchall, executemany
- NULL handling, mixed columns, binary round-trips, error cases
- Output converter and cursor.description metadata verification1 parent d424c6f commit 0927dda
4 files changed
Lines changed: 1102 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
| 367 | + | |
366 | 368 | | |
367 | 369 | | |
368 | 370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
| 868 | + | |
868 | 869 | | |
869 | 870 | | |
870 | 871 | | |
| |||
1052 | 1053 | | |
1053 | 1054 | | |
1054 | 1055 | | |
| 1056 | + | |
1055 | 1057 | | |
1056 | 1058 | | |
1057 | 1059 | | |
| |||
| 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