Skip to content

Refactor: Major architectural overhaul inspired by sqlparser-rs (instead of sea-query) - #2

Closed
awolverp wants to merge 9 commits into
masterfrom
migrate
Closed

awolverp wants to merge 9 commits into
masterfrom
migrate

Conversation

@awolverp

@awolverp awolverp commented Jun 18, 2026 •

Copy link
Copy Markdown
Owner

Based on feedback received from my friends, I decided to migrate to a customized sqlparser-rs.

Initially, the plan was to migrate directly to a customized version of sqlparser-rs. However, after further investigation, direct usage was not feasible.
Instead, I'm taking strong inspiration from sqlparser-rs while implementing our own solution tailored to the needs of this library.

Reasons:

  • Complete elimination of panic risks and much higher production safety compared to sea-query

  • Support for more than 10 dialects:

    • BigQuery
    • DataBricks
    • DuckDB
    • Hive
    • MsSQL
    • MySQL
    • Oracle
    • PostgreSQL
    • RedShift
    • Snowflake
    • Spark
    • SQLite
    • TeraData
  • Support for all data types.

  • This opens the door to adding SQL parsing capabilities in the future.

  • I will be able to offer a better and more complete interface to developers.

  • All SQL features become available without any limitations.

  • This greatly simplifies building an ORM and keeps options open.

I'll try to keep this update as backward-compatible as possible, but I can't make any guarantees.

@awolverp awolverp added the type:documentation Improvements or additions to documentation label Jun 18, 2026
@awolverp awolverp changed the title Migration to sqlparser-rs instead of sea-query Refactor: migration to sqlparser-rs instead of sea-query Jun 18, 2026
awolverp added 6 commits June 21, 2026 17:38
- Completely separated native (Rust) implementation from Python layer
- Restructured project architecture for better maintainability and development experience
- Improved test coverage and accuracy across DataType, Serializers, and Dialects
- Reduced memory consumption through interning and optimization of common data types
- Observed overall performance improvements
@awolverp awolverp changed the title Refactor: migration to sqlparser-rs instead of sea-query Refactor: Major architectural overhaul inspired by sqlparser-rs (instead of sea-query) Jul 16, 2026
prepare foundation

Rewrite SqlDialect string/identifier/bytes/bits formatting to write into
any fmt::Write instead of always allocating Strings. Add matching
*_as_string helpers for call sites that still need owned values.

Introduce efficient single-pass string utilities (str_replace_to,
replace_many_ascii_to) and reorganize internal utils into a module.

Add PrepareStatement trait + PrepareStatementContext for building
parameterized SQL, plus Ident/CompoundIdent and a PrepareStatement
impl for DataTypeName.

Bump edition to 2024, add once_cell + hashbrown, and update serializers
to the new dialect APIs.
- Change Ident from ArcStr newtype to Content | Asterisk enum
- Add IdentList for multipart (dotted) identifiers with
  parsing/validation
- Integrate escape + quote into dialect.escape_identifier(..., quote)
- Update PrepareStatement trait and helpers to take dialect explicitly
- Expose Ident and Asterisk to Python (Asterisk subclasses Ident)
- Add derive_more dependency; support Python 3.14/3.15 classifiers
- Misc: typeref check helpers, FmtError, serializer exact-type checks
@awolverp

awolverp commented Sep 6, 2026

Copy link
Copy Markdown
Owner Author

I tried hard to push this update forward, but unfortunately, due to the current situation in my country, I am unable to continue this work for now. I am therefore closing this PR until I have enough time to resume.

@awolverp awolverp closed this Sep 6, 2026
@awolverp
awolverp deleted the migrate branch October 12, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant