Skip to content

New iden paradigm#909

Merged
tyt2y3 merged 17 commits intomasterfrom
new-iden
Jul 14, 2025
Merged

New iden paradigm#909
tyt2y3 merged 17 commits intomasterfrom
new-iden

Conversation

@tyt2y3
Copy link
Copy Markdown
Member

@tyt2y3 tyt2y3 commented Jul 12, 2025

As discussed, Arc, vtable tricks are removed.

The biggest behaviour change is late binding to early binding. previously the Iden is only rendered when the AST is being serialized, now that we pre-render it as we store that into the AST.

For majority of usecases in SeaORM though, since they're 'static str anyway, there should be no difference.

It is still possible to have struct MyIden(String) with some dynamic behaviour.

@Huliiiiii

@tyt2y3 tyt2y3 requested a review from Expurple July 12, 2025 11:06
@tyt2y3
Copy link
Copy Markdown
Member Author

tyt2y3 commented Jul 12, 2025

there is no way to read this code diff other than going commit by commit. every commit is compilable.

but summary of changes:

  1. change unquoted() signature (biggest visible breaking change)
image
  1. change quoted() signature
fn quoted(&self) -> Cow<'static, str> {
  1. removed prepare() from Iden trait (moved into builder backend)
  2. DynIden is just a Cow, SeaRc is just a helper
  3. impl IntoIden for String (most asked, I guess)

hopefully this can get optimized
Copy link
Copy Markdown
Member

@Expurple Expurple left a comment

Choose a reason for hiding this comment

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

I love this

Comment thread sea-query-derive/Cargo.toml Outdated
Comment thread src/types.rs
Comment thread src/types.rs
Comment thread src/types.rs
Comment thread src/types.rs Outdated
tyt2y3 and others added 4 commits July 14, 2025 12:24
@tyt2y3
Copy link
Copy Markdown
Member Author

tyt2y3 commented Jul 14, 2025

special thanks to @Huliiiiii for bringing forward the proposal!

@tyt2y3 tyt2y3 merged commit 7e95403 into master Jul 14, 2025
20 checks passed
@tyt2y3 tyt2y3 deleted the new-iden branch July 14, 2025 12:15
SindriFr pushed a commit to SindriFr/sea-query that referenced this pull request Jul 21, 2025
* 1. change unquoted() signature

* 2. change quoted() signature

* 3. introduce unquoted_static

* 4. remove prepare from iden

* 5. remove type-sensitive comparison

* remove quote from quoted

* 6. revamp SeaRc and DynIden

* rename to prepare_iden

* tweaks

* Impl IntoIden for String

* improve tests

* clippy

* const fn is_static_iden

hopefully this can get optimized

* Apply suggestions from code review

Co-authored-by: Dmitrii Aleksandrov <[email protected]>

* Update src/types.rs

Co-authored-by: Dmitrii Aleksandrov <[email protected]>

* dep

* fix build

---------

Co-authored-by: Dmitrii Aleksandrov <[email protected]>
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.

2 participants