Skip to content

Identity Types

The identity type provides automatic UUID primary key generation.

Generates a UUID v4 primary key column.

Expands To
uuid + primary_key + default(uuid_generate_v4())
schemas/auth/user.js
export default table({
id: col.id(),
name: col.name(),
});
  • Always use col.id() as the first column in your table
  • UUIDs are generated server-side, not client-side
  • Compatible with distributed systems and replication