mirror of
https://github.com/ash-project/ash_sqlite.git
synced 2024-09-20 05:13:19 +12:00
20 lines
454 B
Elixir
20 lines
454 B
Elixir
|
defmodule AshSqlite.Type do
|
||
|
@moduledoc """
|
||
|
Sqlite specific callbacks for `Ash.Type`.
|
||
|
|
||
|
Use this in addition to `Ash.Type`.
|
||
|
"""
|
||
|
|
||
|
@callback value_to_sqlite_default(Ash.Type.t(), Ash.Type.constraints(), term) ::
|
||
|
{:ok, String.t()} | :error
|
||
|
|
||
|
defmacro __using__(_) do
|
||
|
quote do
|
||
|
@behaviour AshSqlite.Type
|
||
|
def value_to_sqlite_default(_, _, _), do: :error
|
||
|
|
||
|
defoverridable value_to_sqlite_default: 3
|
||
|
end
|
||
|
end
|
||
|
end
|