Does pocketbase support sqlite auto-increment ? #3275
Unanswered
Jeyanthinath
asked this question in
Q&A
Replies: 1 comment
-
|
No this is not supported at the moment (in the future there are plans for a more "native" SQLite dev experience and to allow more control over the system fields, but for now remains a low priority). If the only reason you want an auto-increment field is to make the url path more easy readable, then I'd suggest to reconsider it, especially for auth related records. From security standpoint, using a random string as resource identifier is often considered better as it prevents enumeration attacks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For my use-case, I need to insert the records into the table with some auto-increment field (https://www.sqlite.org/autoinc.html).
The reason I need auto-incremental field is, my URL slug won't feel like some random UUID.
I don't want to insert the number in an incremental fashion from the code as it might not satisfy atomicity.
currently: using the
idfield auto created by pb, I can only be able to achieve. these kind of URLshttp://localhost:3000/user/profile/gi7o2a3cxay8c4tbut I need something like this.
http://localhost:3000/user/profile/1http://localhost:3000/user/profile/2http://localhost:3000/user/profile/3any ways of achieving this with the current setup?
Beta Was this translation helpful? Give feedback.
All reactions