Skip to content

TIME column type #43

Description

@DDecoene

Scope

Add a TIME column type to CREATE TABLE, alongside the existing CHAR/NUM/INT/LOGICAL/DATE families (see mapType() in src/interpreter/Executor.ts).

  • Canonical storage/display format HH:MM (24-hour), stored as SQLite TEXT, same family as DATE/CHAR.
  • Optional granularity qualifier: TIME(15) requires minutes to be a multiple of 15 (00/15/30/45). Plain TIME accepts any valid HH:MM. Check whether the existing CHAR(n) / NUM(p,s) parenthesized-arg grammar in src/interpreter/Lexer.ts / Parser.ts already parses TIME(15) for free — extend only if needed.
  • Validate on write (APPEND RECORD defaults + REPLACE ... WITH): reject malformed HH:MM (hours 00-23, minutes 00-59) and reject minute values violating the column's granularity qualifier. Surface a clear error — no silent coercion.
  • LIST STRUCTURE prints the column as TIME or TIME(15).
  • Update CLAUDE.md command/type docs.

Branch

feature/<name> off release/v1.2.0, PR targets release/v1.2.0.

Tests

Unit tests following the pattern in tests/AlterTable.test.ts / tests/Session.test.ts: table creation with TIME/TIME(15), valid/invalid writes via APPEND RECORD and REPLACE, LIST STRUCTURE output.

Definition of done

Per CLAUDE.md → Definition of done: tests green (vitest + playwright), version/changelog/README/CLAUDE.md updated as applicable, Assistant parity note (this is a schema-level type, not a standalone command — note in the PR whether/why it needs Assistant surfacing, e.g. via the TableWizard column-type picker).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions