Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aosasona/migrant
Database migrations for SQLite
https://github.com/aosasona/migrant
Last synced: 27 days ago
JSON representation
Database migrations for SQLite
- Host: GitHub
- URL: https://github.com/aosasona/migrant
- Owner: aosasona
- License: mit
- Created: 2023-10-21T17:38:07.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-02T18:59:28.000Z (8 months ago)
- Last Synced: 2024-10-19T14:55:00.693Z (about 2 months ago)
- Language: Gleam
- Size: 55.7 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gleam - migrant - [📚](https://hexdocs.pm/migrant/) - Database migrations for SQLite in Gleam (Packages / Databases)
README
# Migrant
Database migrations for SQLite in Gleam
## Usage
```gleam
import gleam/erlang
import app/database
import migrantpub fn main() {
let db = database.connect()let assert Ok(priv_directory) = erlang.priv_directory("app")
let assert Ok(_) = migrant.migrate(db, priv_directory <> "/migrations")Nil
}
```## Installation
This library is currently being developed as it is used in projects & as needed, there are no stable (or really any) releases yet and there won't be for a while.
If you want to use it regardless, you can install it as a local dependency by cloning this repo and adding this to your `gleam.toml` file> UPDATE: there is an alpha release now (for convenience), use at your own risk
```toml
[dependencies]
migrant = { path = "path/to/migrant" }
```### Installing Alpha from Hex
Again, this has not been thoroughly tested, it has been built to suit what I need at the moment, use at your own risk.
```sh
gleam add migrant
```## Targets
In theory, this should work in both Javascript and Erlang targets since all the dependencies have support for both targets, but it is only currently being developed and tested against the Erlang/BEAM runtime.