Skip to content

docs(bsql): document supported date/time formats + cover them with tests#137

Merged
pquerna merged 1 commit into
mainfrom
pquerna/datetime-docs-and-tests
Jun 5, 2026
Merged

docs(bsql): document supported date/time formats + cover them with tests#137
pquerna merged 1 commit into
mainfrom
pquerna/datetime-docs-and-tests

Conversation

@c1-squire-dev

@c1-squire-dev c1-squire-dev Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extends TestParseTime with 16 new table-driven cases covering every format accepted by parseTime: 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.
  • Adds 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.
  • No new formats were added to the format list — the audit confirmed the existing list is complete for the targeted DB families.

Test plan

  • go build ./... green
  • go test ./... green — all 28 TestParseTime cases + all TestParseTimeWithEngine cases pass
  • Pre-existing lint issues in provisioning.go, nhi_test.go, query_test.go, user_syncer_test.go are unchanged; no new issues introduced

🏰 Opened from a Squire environment: frozen-llama-24883
Task: 186711ac-7c9b-48e8-9bf1-1f5794610812

Open this environment in Squire

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>
@c1-squire-dev c1-squire-dev Bot requested a review from a team June 5, 2026 20:19
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Connector PR Review: docs(bsql): document supported date/time formats + cover them with tests

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Review mode: full
View review run

Review Summary

This PR adds 16 new test cases to TestParseTime covering every format in the timeFormats slice (RFC 3339 with offsets, fractional-second SQL timestamps, US/European slash notation, Oracle NLS variants, and DB2), plus a standalone docs/datetime-formats.md reference. No implementation code was changed. All new test expectations are consistent with the existing parseTime format list and epoch-range guards, and the documentation accurately reflects the tested behavior including the US/EU ambiguity note and best-effort skip semantics.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found.

@pquerna pquerna merged commit 59e4184 into main Jun 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant