View Source EcsxPersistenceEcto
Ecto Persistence Adapter for ECSx
Installation
EcsxPersistenceEcto can be installed by adding ecsx_persistence_ecto to your list of dependencies in mix.exs:
def deps do
[
{:ecsx_persistence_ecto, "~> 0.1.0"}
]
endConfigure
To configure ECSx in your app with Ecto as the persistence adapter, update :ecsx in your config.exs file:
config :ecsx,
...
persistence_adapter: ECSx.Persistence.Ectoand specify your repo:
config :ecsx_persistence_ecto, repo: MyApp.RepoAdd the database table
Generate a migration script:
mix ecto.gen.migration ecto_persistenceand update the change function in the migration:
def change do
create table "ecsx_components" do
add :module, :string
add :data, :string
timestamps()
end
endFinally, run the migration script:
mix ecto.migrate