Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An Ecto SQLite3 adapter.

License

NotificationsYou must be signed in to change notification settings

elixir-sqlite/ecto_sqlite3

Repository files navigation

Build StatusHex PackageHex Docs

An Ecto SQLite3 Adapter. UsesExqliteas the driver to communicate with sqlite3.

Caveats and limitations

SeeLimitationsin Hexdocs.

Installation

defpdepsdo[{:ecto_sqlite3,"~> 0.17"}]end

Usage

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"

Database Encryption

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'

Benchmarks

We have some benchmarks comparing it against theMySQL andPostgres adapters.

You can read more about those atbench/README.md.

Running Tests

Running unit tests

mixtest

Running integration tests

EXQLITE_INTEGRATION=true mixtest

About

An Ecto SQLite3 adapter.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors40

Languages


[8]ページ先頭

©2009-2025 Movatter.jp