Define a unique id type
import { Model } from 'pinia-orm'class User extends Model { static entity = 'users' static fields () { return { id: this.uid() } }}
import { Model, Uid } from 'pinia-orm'class User extends Model { static entity = 'users' @Uid() id!: string}
function uid(): Uid