Skip to content

fix(db): preserve DOUBLE type in SQLite export#43

Merged
Lazialize merged 1 commit intomainfrom
fix/27-sqlite-double-type-export
Feb 8, 2026
Merged

fix(db): preserve DOUBLE type in SQLite export#43
Lazialize merged 1 commit intomainfrom
fix/27-sqlite-double-type-export

Conversation

@Lazialize
Copy link
Owner

Summary

SQLite の型マッパーが FLOAT と DOUBLE の両方を REAL に変換していたため、エクスポート時に REALFLOAT へマッピングされ、DOUBLE カラムが FLOAT として出力されていた。

修正内容:

  • format_sql_type: DOUBLE → DOUBLE(SQLite は任意の型名を受け入れ、REAL アフィニティとして扱う)
  • parse_sql_type: DOUBLE 宣言型 → ColumnType::DOUBLE へ正しくマッピング

Related Issue

Fixes #27

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation update
  • CI/CD or tooling changes

Test Plan

  • Added/updated unit tests
  • Tested manually with PostgreSQL
  • Tested manually with MySQL
  • Tested manually with SQLite

Checklist

  • My code follows the project's coding style
  • I have run cargo fmt and cargo clippy
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass (cargo test)
  • I have updated documentation if needed

…to FLOAT

SQLite's type mapper was converting both FLOAT and DOUBLE to REAL in SQL
generation, then mapping REAL back to FLOAT during introspection, losing
the DOUBLE distinction. Now DOUBLE is preserved as DOUBLE in generated
SQL (SQLite accepts any type name with REAL affinity), and DOUBLE
declared types are correctly parsed back to ColumnType::DOUBLE.

Fixes #27

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Lazialize Lazialize merged commit 4e62be2 into main Feb 8, 2026
1 check passed
@Lazialize Lazialize deleted the fix/27-sqlite-double-type-export branch February 8, 2026 09:11
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.

export: SQLite DOUBLE type is exported as FLOAT

1 participant