conn.go, driver.go: add opt-in time format without monotonic readings

Closes #259 (closed).

Add _time_format=string_no_monotonic for applications that need a scanned timestamp to match its stored text when rebound in UPDATE/DELETE predicates. It uses the existing layout map and formatting path, with output equivalent to t.Round(0).String(). formatTime() is unchanged from upstream.

The default continues to use t.String(), including any monotonic reading, preserving existing text comparisons and UNIQUE constraints. The new option preserves the legacy wall-clock layout, timezone and nanosecond precision while omitting the process-local monotonic reading. Existing sqlite/datetime formats, timezone handling and integer-format precedence are unchanged. It does not rewrite existing database values; applications must normalize legacy strings separately when needed.

Regression coverage includes DATE/DATETIME/TIMESTAMP with direct and prepared UPDATE/DELETE predicates under the new option; preservation of default monotonic output and distinct UNIQUE values; equivalence to t.Round(0).String() for monotonic, zero, UTC, named-zone and unnamed-zone times; timezone/integer options; and reading legacy strings without modifying them.

Validation on Go 1.27.1 / linux-arm64:

  • go test -race -run '^Test(Time|Timezone|IntegerFormat)' -count=1 -timeout=3m .: passed.
  • Downstream shim tests passed with the new option explicitly selected.
  • make all: compilation/build steps passed; staticcheck reports existing upstream diagnostics. After ignoring shifted line numbers, its output matches unmodified master b122d041 exactly.

No generated SQLite/libc code or dependency versions are changed in this MR.

Edited by r27153733

Merge request reports

Loading
Loading