Skip to content

feat: add multi-database dialect support#3

Merged
RAprogramm merged 2 commits intomainfrom
feat/multi-db-dialect
Dec 24, 2025
Merged

feat: add multi-database dialect support#3
RAprogramm merged 2 commits intomainfrom
feat/multi-db-dialect

Conversation

@RAprogramm
Copy link
Owner

Summary

  • Add DatabaseDialect enum with support for PostgreSQL, ClickHouse, MongoDB
  • Feature-gated SQL generation per database dialect
  • PostgreSQL stable, ClickHouse/MongoDB as placeholders for future implementation
  • Refactor sql.rs to use dialect-specific placeholders

Changes

File Description
src/entity/parse/dialect.rs New DatabaseDialect enum with placeholder/set_clause generation
src/entity/sql.rs Refactored to use dialect, multi-db support structure
src/entity/parse.rs Export DatabaseDialect, add to EntityDef
Cargo.toml Add postgres, clickhouse, mongodb features, bump to 0.2.0

Usage

#[derive(Entity)]
#[entity(table = "users", dialect = "postgres")]
pub struct User { ... }

Test plan

  • All 15 unit tests pass
  • All integration tests pass
  • cargo clippy clean
  • cargo llvm-cov coverage check

- Add DatabaseDialect enum (Postgres, ClickHouse, MongoDB)
- Feature-gated SQL generation per database dialect
- PostgreSQL stable, ClickHouse/MongoDB placeholders
- Update Cargo.toml with postgres/clickhouse/mongodb features
- Refactor sql.rs to use dialect-specific placeholders
- Bump version to 0.2.0
@codecov
Copy link

codecov bot commented Dec 24, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

- Add UuidVersion enum with V4 and V7 variants
- Add uuid attribute to entity configuration
- Default to V7 (time-ordered), optional V4 (random)
- Update documentation with dialect and uuid attributes
- Add comprehensive tests for all new features
@RAprogramm RAprogramm merged commit 9185bc7 into main Dec 24, 2025
15 checks passed
@RAprogramm RAprogramm deleted the feat/multi-db-dialect branch December 24, 2025 06:15
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