vonH
Failure compiling sqlite_ecto2
I am trying to create an ecto project based on sqlite, first with sqlite_ecto, GitHub - jazzyb/sqlite_ecto: SQLite3 adapter for Ecto · GitHub which conflicts with ecto ~> 2.0, and now with sqlite_ecto2, GitHub - elixir-sqlite/sqlite_ecto2: Sqlite3 adapter for Ecto 2.2.x · GitHub
I get to the stage where I am required to do a mix deps.compile sqlite_ecto2
vonhabsi@ac02:~/DevProjects/learnphoenix/customers$ mix deps.compile sqlite_ecto2
==> sqlite_ecto2
Compiling 9 files (.ex)
== Compilation error on file lib/sqlite_db_connection/query.ex ==
** (ArgumentError) DBConnection.Query is not available
(elixir) lib/protocol.ex:69: Protocol.assert_protocol!/2
lib/sqlite_db_connection/query.ex:33: (file)
(elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.
spawn_compilers/1
could not compile dependency :sqlite_ecto2, "mix compile" failed. You can recompile this dep
endency with "mix deps.compile sqlite_ecto2", update it with "mix deps.update sqlite_ecto2"
or clean it with "mix deps.clean sqlite_ecto2"
vonhabs@ac02:~/DevProjects/learnphoenix/customers$
What is missing here? Could it be something in the erlang configuration. Am I missing some libraries or some build related tools?
PS. What do you do if you don’t have the permissions to add the tags you want?
First Post!
idi527
It seems like sqlite adapter (ecto-2.0 branch as well) for ecto is not compatible with ecto 2.0 [0][1]
If you need a lightweight database, may I suggest you use mnesia? It has an ecto adapter which is compatible with ecto 2.0 [2]. In case you don’t like it, there are other wrappers around mnesia, kvs [3] and amnesia [4]. And finally, you can use mnesia directly via :mnesia module.
[0] GitHub - elixir-ecto/ecto: A toolkit for data mapping and language integrated query. · GitHub
[1] sqlite_ecto/mix.exs at master · jazzyb/sqlite_ecto · GitHub
[2] GitHub - Nebo15/ecto_mnesia: Ecto adapter for Mnesia Erlang term database. · GitHub
[3] GitHub - synrc/kvs: KVS: xNVMe SSD Key-Value Store Abstraction Layer (SNIA) · GitHub
[4] GitHub - meh/amnesia: Mnesia wrapper for Elixir. · GitHub
Most Liked
tme_317
I’m not sure about GitHub - jazzyb/sqlite_ecto: SQLite3 adapter for Ecto · GitHub but the newest GitHub - elixir-sqlite/sqlite_ecto2: Sqlite3 adapter for Ecto 2.2.x · GitHub has been working great for me with the latest ecto 2.1.4.
If you add {:sqlite_ecto2, "~> 2.0.0-dev.2"} to your deps in mix.exs then run mix deps.get it will pull in the other dependencies automatically (such as ecto, esqlite, sqlitex). Follow that with mix deps.compile and it should compile fine.
There are some caveats listed in the readme for sqlite_ecto2 to be aware of such as compatible Erlang versions, etc.
OvermindDL1
scouten
Hi @vonH (and everybody), there are two different sqlite_ecto libraries.
The one you’ve linked to GitHub - jazzyb/sqlite_ecto: SQLite3 adapter for Ecto · GitHub is for Ecto version 1.x and appears to be no longer maintained. (There have been no commits in over a year now.)
I started a new project to updated this to Ecto version 2.x and which is located at GitHub - elixir-sqlite/sqlite_ecto2: Sqlite3 adapter for Ecto 2.2.x · GitHub. This version is in a prerelease state. It’s believed to be correct and working, but hasn’t had enough stress testing for me to call it a proper 2.0 release yet.
If you are still having trouble with compiling sqlite_ecto2, please file an issue on GitHub (Issues · elixir-sqlite/sqlite_ecto2 · GitHub). I won’t be able to look at it today, but I should have time over the weekend to follow up. A test repo that demonstrates the problem would be very helpful.
Last Post!
scouten
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









