docs(bsql): document supported date/time formats + cover them with tests#137
Merged
Conversation
Extend TestParseTime with 16 new table-driven cases that exercise every format the connector accepts: RFC3339/Nano with offsets, MySQL/PostgreSQL space-separated timestamps at ms/µs/ns precision, ISO8601 with fractional seconds and timezone offsets, European and US slash notation (datetime and date-only), Oracle NLS_DATE_FORMAT variants (uppercase/mixed-case/short-year abbreviations, long and full month names, date-only), DB2 TIMESTAMP, and numeric Unix epoch seconds and milliseconds. Add docs/datetime-formats.md, an end-user config reference that documents exactly the tested set: grouped by DB family, one concrete example per format, the epoch range guards, the US/EU slash ambiguity note, the best-effort skip-on-failure behaviour, and an escape hatch (cast to ISO 8601 in the query) for unlisted formats. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Contributor
Connector PR Review: docs(bsql): document supported date/time formats + cover them with testsBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryThis PR adds 16 new test cases to Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. |
pquerna
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TestParseTimewith 16 new table-driven cases covering every format accepted byparseTime: RFC3339/Nano (with and without timezone offsets), MySQL/PostgreSQL space-separated timestamps at ms/µs/ns precision, ISO 8601 with fractional seconds and offsets, European and US slash notation (with and without time), all Oracle NLS_DATE_FORMAT variants (uppercase/mixed-case/short-year abbreviations, long and full month names, date-only variants), DB2 TIMESTAMP, and numeric Unix epoch seconds and milliseconds. Two negative cases (unparseable string, empty string) remain.docs/datetime-formats.md: an end-user config reference documenting exactly the tested format set, grouped by DB family, with one concrete example per format, the epoch range guards, the US/EU slash ambiguity note, the best-effort skip-on-failure behaviour, and a cast-to-ISO-8601 escape hatch for unlisted formats.Test plan
go build ./...greengo test ./...green — all 28TestParseTimecases + allTestParseTimeWithEnginecases passprovisioning.go,nhi_test.go,query_test.go,user_syncer_test.goare unchanged; no new issues introduced🏰 Opened from a Squire environment: frozen-llama-24883
Task: 186711ac-7c9b-48e8-9bf1-1f5794610812
Open this environment in Squire