-
Notifications
You must be signed in to change notification settings - Fork 95
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
Support AUTO_INCREMENT. #250
Conversation
Codecov Report
@@ Coverage Diff @@
## master #250 +/- ##
==========================================
- Coverage 61.32% 61.09% -0.24%
==========================================
Files 68 68
Lines 6345 6428 +83
==========================================
+ Hits 3891 3927 +36
- Misses 1938 1969 +31
- Partials 516 532 +16
Continue to review full report at Codecov.
|
1264d41
to
8096c83
Compare
Add FieldBuffer #Copy. Fix comments.
@tzzed thanks for your work! What’s the current status of this PR? It looks like the counter is not being persisted. Step 1
Step 2
|
It was draft. I just submitted the idea, there is still some work. |
Looks nice! I’d also suggest using Though I’m not quite sure what we actually want from the auto increment feature. E.g. in SQLite it guarantees monotonically increasing 64-bit integer sequence for rowid (pk() in Genji) with an error on overflow. Also, I think it’s possible to compute non-primary key auto incremented value with (start, step) parameters given a document sequence number (that is strictly monotonically increasing, i.e. we’ll get an error on overflow). See also |
Note that we currently don’t handle integer overflows for sequence numbers. |
|
Rename AUTO_INCREMENT to AUTOINCREMENT. Remove updatefielconstraints method.
Trying to understand whether auto incrementing primary keys work, even though this PR wasn't accepted. The documentation says:
However, in a quick test locally this doesn't seem the case - at least not with only a |
@mrusme For now, only auto generated "docids" are generated. These are internal IDs, equivalent to SQLite's rowids. Regarding auto incremented user defined primary keys, they are not supported yet. |
This a proposal draft for #43.
SQL Server seems good because it proposes a customizable
AUTO_INCREMENT
with a "natural language".AUTO_INCREMENT
have to be applied only on number value type.INTEGER
andDOUBLE
About
ALTER TABLE table_name AUTO_INCREMENT=100
, If we keep it like that, we should be able to write the both following syntaxes:Thank you for your feedbacks.