vonH

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

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

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

OvermindDL1

Absolutely what @tme_317 said, the old sqlite_ecto library is not for ecto2, but rather for ecto1, use the new linked sqlite_ecto2 library and it works fine (it is still in dev but just working on final bugs last I saw, its basically solid and done now). :slight_smile:

scouten

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

scouten

Sounds good. Keep me posted!

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54260 488
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement