The entrypoint for managing PGMQ-related Ecto.Migration implementations.
Summary
EctoPGMQ API
Creates a queue with the given name in an Ecto.Migration.
Drops the given queue in an Ecto.Migration.
Updates the given queue in an Ecto.Migration.
Extension Installation API
Creates the PGMQ extension in an Ecto.Migration.
Drops the PGMQ extension in an Ecto.Migration.
Updates the PGMQ extension to the default version in an Ecto.Migration.
Updates the PGMQ extension in an Ecto.Migration.
SQL Installation API
Drops the PGMQ schema in an Ecto.Migration.
Imports a PGMQ schema file in an Ecto.Migration.
EctoPGMQ API
@spec create_queue(EctoPGMQ.Queue.name(), EctoPGMQ.queue_create_attributes(), [ EctoPGMQ.PGMQ.query_opt() ]) :: :ok
Creates a queue with the given name in an Ecto.Migration.
For more information, see EctoPGMQ.create_queue/3.
Examples
create_queue("my_queue")
@spec drop_queue( EctoPGMQ.Queue.name(), keyword() ) :: :ok
Drops the given queue in an Ecto.Migration.
For more information, see EctoPGMQ.drop_queue/3.
Examples
drop_queue("my_queue")
@spec update_queue(EctoPGMQ.Queue.name(), EctoPGMQ.queue_update_attributes(), [ EctoPGMQ.PGMQ.query_opt() ]) :: :ok
Updates the given queue in an Ecto.Migration.
For more information, see EctoPGMQ.update_queue/4.
Examples
update_queue("my_queue", %{notifications: 1_000})
Extension Installation API
@spec create_extension() :: :ok
Creates the PGMQ extension in an Ecto.Migration.
For more information, see PGMQ Installation.
Examples
create_extension()
@spec drop_extension() :: :ok
Drops the PGMQ extension in an Ecto.Migration.
For more information, see PGMQ Installation.
Examples
drop_extension()
Updates the PGMQ extension to the default version in an Ecto.Migration.
For more information, see PGMQ Installation.
Examples
update_extension()
@spec update_extension(Version.version()) :: :ok
Updates the PGMQ extension in an Ecto.Migration.
For more information, see PGMQ Installation.
Examples
update_extension("1.9.0")
update_extension(Version.parse!("1.9.0"))
SQL Installation API
@spec drop_schema() :: :ok
Drops the PGMQ schema in an Ecto.Migration.
Warning
This function should NOT be used if PGMQ is installed as an extension.
For more information, see PGMQ Installation.
Examples
drop_schema()
@spec import_schema(Path.t()) :: :ok
Imports a PGMQ schema file in an Ecto.Migration.
Warning
This function leverages the same adapter callback as
mix ecto.load and
therefore, requires that the psql shell utility is available.
For more information, see PGMQ Installation.
Examples
path =
:my_app
|> :code.priv_dir()
|> Path.join("repo/extensions/pgmq--1.9.0.sql")
import_schema(path)