- Notifications
You must be signed in to change notification settings - Fork54
elixir-sqlite/ecto_sqlite3
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
An Ecto SQLite3 Adapter. UsesExqliteas the driver to communicate with sqlite3.
SeeLimitationsin Hexdocs.
defpdepsdo[{:ecto_sqlite3,"~> 0.17"}]end
Define your repo similar to this.
defmoduleMyApp.RepodouseEcto.Repo,otp_app::my_app,adapter:Ecto.Adapters.SQLite3end
Configure your repository similar to the following. If you want to know moreabout the possible options to pass the repository, checkout the documentationforEcto.Adapters.SQLite. It will havemore information on what is configurable.
config:my_app,ecto_repos:[MyApp.Repo]config:my_app,MyApp.Repo,database:"path/to/my/database.db"
As of version 0.9,exqlite supports loading database engines at runtime rather than compilingsqlite3.c itself.This can be used to support database level encryption via alternate engines such asSQLCipheror theOfficial SEE extension. Once you have either of those projects installedon your system, use the following environment variables during compilation:
# tell exqlite that we wish to use some other sqlite installation. this will prevent sqlite3.c and friends from compilingexport EXQLITE_USE_SYSTEM=1# Tell exqlite where to find the `sqlite3.h` fileexport EXQLITE_SYSTEM_CFLAGS=-I/usr/local/include/sqlcipher# tell exqlite which sqlite implementation to useexport EXQLITE_SYSTEM_LDFLAGS=-L/usr/local/lib -lsqlcipher
Once you haveexqlite configured, you can use the:key option in the database config to enable encryption:
config:my_app,MyApp.Repo,database:"path/to/my/encrypted-database.db",key:"supersecret'
We have some benchmarks comparing it against theMySQL andPostgres adapters.
You can read more about those atbench/README.md.
Running unit tests
mixtestRunning integration tests
EXQLITE_INTEGRATION=true mixtestAbout
An Ecto SQLite3 adapter.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.