Search code examples
databaseprimary-keyuuidslickauto-generate

Auto-generate UUID in Slick


Wonder if Slick supports auto-generation of a primary key of the table as UUID?

I have a table that has a primary key (Long format) being autogenerated each time I insert to the table by auto-incrementing. Now, I want to change that to UUID autogenerated id.


Solution

  • Slick doesn't support auto-generating UUIDs, but your database might. Why not do it in the db?