How to implement AUTOINCREMENT in sophia?

48 views
Skip to first unread message

Amirouche Boubekki

unread,
Jul 19, 2016, 7:37:35 PM7/19/16
to Sophia database
I'd like to implement the an AUTOINCREMENT primary key in sophia, similar to how single column records works in wiredtiger or how it works in RDBMS.

Thanks

Dmitry Simonenko

unread,
Jul 20, 2016, 3:59:09 AM7/20/16
to Sophia database
This feature will be available in next release (2.2). Right now it can be implemented using
following simple workflow:

Define key field as a numeric type (u8-u64).

(on application start): get max key value, cache it
(transaction): auto-increment cached value, use it as the key

Amirouche Boubekki

unread,
Jul 20, 2016, 4:52:54 AM7/20/16
to Sophia database


On Wednesday, July 20, 2016 at 9:59:09 AM UTC+2, Dmitry Simonenko wrote:
This feature will be available in next release (2.2). Right now it can be implemented using
following simple workflow:

Define key field as a numeric type (u8-u64).

(on application start): get max key value, cache it
(transaction): auto-increment cached value, use it as the key

Thanks!
 
Reply all
Reply to author
Forward
0 new messages