View Source Utilx.EctoUtils.ObjectID (Utilx v0.6.2)

A Ecto type that facilitates the generation of prefixed base62 encoded UUIDv7 for use as primary and foreign keys in Ecto schemas.

Examples

@primary_key {:id, Utilx.EctoUtils.ObjectID, prefix: "user", autogenerate: true}
@foreign_key_type Utilx.EctoUtils.ObjectID

Resources

Summary

Types

@type opts() :: [schema: atom(), field: atom(), prefix: String.t()]