Skip to content

DuckDB reflects a declared Double/DOUBLE PRECISION column differently from its own type #55

Open

Description

@nicoloesch
  • DuckDB's dialect compiles a declared Double()/DOUBLE PRECISION column as "DOUBLE PRECISION", but reflecting that same column back gives a type that compiles as "DOUBLE".
  • Surfaced via Add DuckDB support omop-alchemy#68.
  • Affects SQLAlchemy >=2.0

Root cause

  • DuckDBTypeCompiler inherits from PGTypeCompiler and only overrides visit_FLOAT; the Double/DOUBLE-PRECISION rendering falls through to Postgres's spelling, which doesn't match DuckDB's own catalog name.
  • Breaks any consumer that compiles a declared and a reflected type and compares them, e.g. schema-drift reconciliation.

Fix direction

  • Add a reflects_double_precision_as_double flag to DialectProfile (True for DuckDB), alongside the existing reflects_float_as_double_precision/reflects_text_as_varchar flags.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions