Skip to content

Conversation

psarna
Copy link
Contributor

@psarna psarna commented Oct 27, 2022

With the new RANDOM ROWID keywords, a table can explicitly state that it wants its rowid to be generated randomly, not consecutively, without having to previously create a sentinel record with rowid == max(i64).
RANDOM ROWID is mutually exclusive with WITHOUT ROWID,
and cannot be combined with AUTOINCREMENT primary key.

This series come with tests.

Fixes #12

With the new RANDOM ROWID keywords, a table can explicitly
state that it wants its rowid to be generated randomly,
not consecutively, without having to previously create a sentinel
record with rowid == max(i64).
RANDOM ROWID is mutually exclusive with WITHOUT ROWID,
and cannot be combined with AUTOINCREMENT primary key.

Fixes tursodatabase#12
The test suite checks whether RANDOM ROWID keywords work
and its input is validated in the parser.
A paragraph explaining RANDOM ROWID syntax is added.
@psarna psarna changed the title wip: add RANDOM ROWID table option Add RANDOM ROWID keywords Oct 28, 2022
@psarna psarna marked this pull request as ready for review October 28, 2022 08:27
@psarna psarna requested a review from penberg October 28, 2022 08:28
@penberg penberg merged commit da54b0a into tursodatabase:main Nov 7, 2022
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.

Use random ROWID for inserted rows
2 participants