# SPDX-FileCopyrightText: 2023 ash_sqlite contributors <https://github.com/ash-project/ash_sqlite/graphs.contributors>
#
# SPDX-License-Identifier: MIT
defmodule AshSqlite.CustomExtension do
@moduledoc """
A custom extension implementation.
"""
@callback install(version :: integer) :: String.t()
@callback uninstall(version :: integer) :: String.t()
defmacro __using__(name: name, latest_version: latest_version) do
quote do
@behaviour AshSqlite.CustomExtension
@extension_name unquote(name)
@extension_latest_version unquote(latest_version)
def extension, do: {@extension_name, @extension_latest_version, &install/1, &uninstall/1}
end
end
end