https://github.com/ecsx-framework/ecsx_persistence_ecto
An Ecto Persistence Adapter for ECSx
https://github.com/ecsx-framework/ecsx_persistence_ecto
Last synced: 6 months ago
JSON representation
An Ecto Persistence Adapter for ECSx
- Host: GitHub
- URL: https://github.com/ecsx-framework/ecsx_persistence_ecto
- Owner: ecsx-framework
- License: gpl-3.0
- Created: 2023-05-27T00:54:54.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-05T22:44:46.000Z (over 2 years ago)
- Last Synced: 2025-07-22T13:57:31.922Z (11 months ago)
- Language: Elixir
- Size: 21.5 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# EcsxPersistenceEcto
[](https://hex.pm/packages/ecsx_persistence_ecto)
[](https://github.com/ecsx-framework/ecsx_persistence_ecto/blob/master/LICENSE)
[](https://hexdocs.pm/ecsx_persistence_ecto)
Ecto Persistence Adapter for ECSx
## Installation
EcsxPersistenceEcto can be installed by adding `ecsx_persistence_ecto` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:ecsx_persistence_ecto, "~> 0.1"}
]
end
```
## Configure
To configure ECSx in your app with Ecto as the persistence adapter, update `:ecsx` in your `config.exs` file:
```elixir
config :ecsx,
...
persistence_adapter: ECSx.Persistence.Ecto
```
and specify your repo:
```elixir
config :ecsx_persistence_ecto, repo: MyApp.Repo
```
## Add the database table
Generate a migration script:
```
mix ecto.gen.migration ecto_persistence
```
and update the change function in the migration:
```elixir
def change do
create table "ecsx_components" do
add :module, :string
add :data, :string
timestamps()
end
end
```
Finally, run the migration script:
```
mix ecto.migrate
```