-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Support cache when creating a sequence #11261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If nobody is working on this, I would like to give it a try |
Sounds good @ilmax. Just keep in mind that at this stage we may choose not to take the PR in 2.1. |
Ok, no problem! I'm working on it now |
I made some progress on this, some unit tests are still missing but the implementation should mostly be done. I have a some questions though and would like to get some feedback because adding cache size support ended up in a breaking change, I've also left a couple of TODOs around. |
@ilmax - Feel free to open PR. We can always merge it after 2.1 or merge into feature branch if 2.1 is not fully done. |
@ilmax if things are working out, could you try fitting in "NO CACHE" as well? |
@ajcvickers As you removed the help wanted tag - can you tell something about the current state of this issue? Thanks! |
@Compufreak345 There were some inconsistencies in how Beyond that, this issue is in the |
@ajcvickers @smitpatel Hi. I'd be happy to implement this feature. sequence documentation for for sql server https://learn.microsoft.com/en-us/sql/t-sql/statements/create-sequence-transact-sql?view=sql-server-ver16 CREATE SEQUENCE [schema_name . ] sequence_name Defaults to CACHE. Cache statement will be added when translation to sql in the end. There are two variants
|
Perhaps another function name would be appropriate |
In SQL Server, it's possible to use both Also, our Fluent API methods generally start with a verb (e.g. UseThis, HasThat). So I think we should have: .UseCache(5) // CACHE 5
.UseCache() // CACHE (default)
.UseNoCache() // NO CACHE Finally, note that SQL Server, PostgreSQL and Oracle support this option, so we should add support in Relational (and not just in the SQL Server provider). |
Great! Thanks a lot for feedback |
merge fix more tests for sequence cache
Reverting this from 9. We will revisit in the future and agree on how it should be implemented. |
Is it possible to include an option for "ORDER" and "NOORDER"?. Oracle has this option too: CREATE SEQUENCE [schema_name . ] sequence_name https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/CREATE-SEQUENCE.html |
Hi,
May I know are there any plan for ef core to support cache size for sequence, something like this:
modelBuilder.HasSequence("OrderNumbers", schema: "shared")
.StartsAt(1000)
.IncrementsBy(5)
.CacheSize(10);
Thanks,
Bruce'
The text was updated successfully, but these errors were encountered: