Tds.Ecto.UUID (Ecto SQL v3.13.2)

View Source

A TDS adapter type for UUIDs strings.

If you are using Tds adapter and UUIDs in your project, instead of Ecto.UUID you should use Tds.Ecto.UUID to generate correct bytes that should be stored in database.

Summary

Types

A raw binary representation of a UUID.

t()

A hex-encoded UUID string.

Functions

Generates a version 4 (random) UUID in the binary format.

Casts to UUID.

Same as cast/1 but raises Ecto.CastError on invalid arguments.

Converts a string representing a UUID into a binary.

Callback implementation for Ecto.Type.embed_as/1.

Callback implementation for Ecto.Type.equal?/2.

Generates a version 4 (random) UUID.

Converts a binary UUID into a string.

Types

raw()

@type raw() :: <<_::128>>

A raw binary representation of a UUID.

t()

@type t() :: <<_::288>>

A hex-encoded UUID string.

Functions

bingenerate()

@spec bingenerate() :: raw()

Generates a version 4 (random) UUID in the binary format.

cast(arg1)

@spec cast(t() | raw() | any()) :: {:ok, t()} | :error

Casts to UUID.

cast!(value)

Same as cast/1 but raises Ecto.CastError on invalid arguments.

dump(arg1)

@spec dump(t() | any()) :: {:ok, raw()} | :error

Converts a string representing a UUID into a binary.

dump!(value)

embed_as(_)

Callback implementation for Ecto.Type.embed_as/1.

equal?(term1, term2)

Callback implementation for Ecto.Type.equal?/2.

generate()

@spec generate() :: t()

Generates a version 4 (random) UUID.

load(uuid)

@spec load(raw() | any()) :: {:ok, t()} | :error

Converts a binary UUID into a string.