main ← openexw:feat/stmt-tosql
已打开 10:04AM - 21 Sep 26 UTC
## Summary
- Add `ws/unified.Stmt.ToSQL()` to reconstruct executable SQL fr…om stmt2 data bound after `Prepare`.
- Support parameterized queries, fixed-table inserts, and dynamic subtable inserts using `insert into ? using ... tags(...)
values(...)`.
- Support multi-table and multi-row inserts, tags, string escaping, NULL, VARBINARY/BLOB, and DECIMAL serialization; return an
explicit error for GEOMETRY.
- Keep `ToSQL()` non-destructive so callers may still invoke `Exec()` afterward.
- Add table-driven unit tests for valid SQL, statement state errors, invalid bound data, invalid SQL templates, and SQL length
limits.
## Test Plan
- [x] `go test ./ws/unified -run '^TestStmtToSQL' -count=1`
## Notes
- `ToSQL()` supports only the new `Bind` API. Deprecated compatibility binding APIs do not preserve the original stmt2 types
and return an explicit error.
- SQL reconstruction reuses the existing `common.InterpolateParams` implementation; this change only adds the adapter from
stmt2 column-oriented bind data to row-oriented `VALUES` tuples.