Skip to content

Feat/config mysql sqlite support - #8

Merged
rekurt merged 10 commits into
masterfrom
feat/config-mysql-sqlite-support
Apr 7, 2026
Merged

rekurt merged 10 commits into
masterfrom
feat/config-mysql-sqlite-support

Conversation

@rekurt

@rekurt rekurt commented Apr 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

rekurt and others added 10 commits April 6, 2026 09:49
- Add .dbdiff.yml config with table/column ignore patterns (*.col, table.*, table.col)
- Add --config CLI flag (defaults to .dbdiff.yml)
- Add MySQL/MariaDB loader via mysql_async (information_schema introspection)
- Add SQLite loader via rusqlite with bundled SQLite (PRAGMA introspection)
- Add Cargo feature flags: postgres, mysql, sqlite (all default-enabled)
- Make database backends optional via conditional compilation
- Bump version to 0.2.0

https://claude.ai/code/session_011ybGPfyvWTRUPcii7Yeqxq
- Install libssl-dev and pkg-config on Ubuntu for mysql_async
- Use --all-features for clippy and docs to check all feature-gated code
- Add system deps to release workflow for cross-compilation

https://claude.ai/code/session_011ybGPfyvWTRUPcii7Yeqxq
ci: harden workflow permissions and pin rust-toolchain action
@rekurt
rekurt merged commit cda9c00 into master Apr 7, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

dbdiff/src/migration.rs

Lines 274 to 279 in e41698d

if old.default != new.default {
match &new.default {
Some(default) => {
stmts.push(MigrationStatement {
sql: format!(
"ALTER TABLE {table} ALTER COLUMN {} SET DEFAULT {default};",

P1 Badge Emit SQLite-safe SQL when defaults change

When dialect is SqlDialect::Sqlite, default-only column diffs still generate ALTER TABLE ... ALTER COLUMN ... SET/DROP DEFAULT statements, but SQLite does not support ALTER COLUMN syntax. This means any SQLite schema drift involving a default value produces a migration that fails at execution time, even though type/nullability changes are already handled as manual migrations in this function.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/loader/sqlite.rs
Comment on lines +105 to +107
.query_map([], |row| row.get::<_, Option<String>>(2))?
.filter_map(|r| r.ok().flatten())
.collect();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip SQLite indexes that contain expression terms

PRAGMA index_info returns NULL for expression terms; this code drops those entries with filter_map and keeps the index if any named column remains. For mixed indexes (for example, lower(name), created_at), the loader records only created_at, so diffs and generated migrations can silently rewrite the index to a different definition. Treating any NULL term as unsupported (and skipping the whole index) would avoid incorrect migrations.

Useful? React with 👍 / 👎.

@rekurt
rekurt deleted the feat/config-mysql-sqlite-support branch April 7, 2026 21:19
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