Skip to content

Commit ad2ca39

Browse files
committed
Update README
1 parent 08971d6 commit ad2ca39

File tree

1 file changed

+10
-59
lines changed

1 file changed

+10
-59
lines changed

README.md

Lines changed: 10 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Exqlite
1+
# Ecto SQLite3 Adapter
22

3-
An SQLite3 library with an Ecto adapter implementation.
3+
An Ecto SQLite3 Adapter.
44

55

66
## Caveats
@@ -24,53 +24,23 @@ An SQLite3 library with an Ecto adapter implementation.
2424

2525
```elixir
2626
defp deps do
27-
{:exqlite, "~> 0.4.8"}
27+
{:ecto_sqlite3, "~> 0.5.0"}
2828
end
2929
```
3030

31-
32-
## Usage Without Ecto
33-
34-
The `Exqlite.Sqlite3` module usage is fairly straight forward.
35-
36-
```elixir
37-
# We'll just keep it in memory right now
38-
{:ok, conn} = Exqlite.Sqlite3.open(":memory:")
39-
40-
# Create the table
41-
:ok = Exqlite.Sqlite3.execute(conn, "create table test (id integer primary key, stuff text)");
42-
43-
# Prepare a statement
44-
{:ok, statement} = Exqlite.Sqlite3.prepare(conn, "insert into test (stuff) values (?1)")
45-
:ok = Exqlite.Sqlite3.bind(conn, statement, ["Hello world"])
46-
47-
# Step is used to run statements
48-
:done = Exqlite.Sqlite3.step(conn, statement)
49-
50-
# Prepare a select statement
51-
{:ok, statement} = Exqlite.Sqlite3.prepare(conn, "select id, stuff from test");
52-
53-
# Get the results
54-
{:row, [1, "Hello world"]} = Exqlite.Sqlite3.step(conn, statement)
55-
56-
# No more results
57-
:done = Exqlite.Sqlite3.step(conn, statement)
58-
```
59-
60-
61-
## Usage With Ecto
31+
## Usage
6232

6333
Define your repo similar to this.
6434

6535
```elixir
6636
defmodule MyApp.Repo do
67-
use Ecto.Repo, otp_app: :my_app, adapter: Ecto.Adapters.Exqlite
37+
use Ecto.Repo, otp_app: :my_app, adapter: Ecto.Adapters.SQLite3
6838
end
6939
```
7040

7141
Configure your repository similar to the following. If you want to know more
7242
about the possible options to pass the repository, checkout the documentation
73-
for `Exqlite.Connection.connect/1`. It will have more information on what is
43+
for `SQLite3.Connection.connect/1`. It will have more information on what is
7444
configurable.
7545

7646
```elixir
@@ -96,32 +66,13 @@ config :my_app, MyApp.Repo,
9666
* Cache size is a negative number because that is how SQLite3 defines the cache
9767
size in kilobytes. If you make it positive, that is the number of pages in
9868
memory to use. Both have their pros and cons. Check the documentation out for
99-
[SQLite3][2].
100-
101-
102-
## Why SQLite3
103-
104-
I needed an Ecto3 adapter to store time series data for a personal project. I
105-
didn't want to go through the hassle of trying to setup a postgres database or
106-
mysql database when I was just wanting to explore data ingestion and some map
107-
reduce problems.
108-
109-
I also noticed that other SQLite3 implementations didn't really fit my needs. At
110-
some point I also wanted to use this with a nerves project on an embedded device
111-
that would be resiliant to power outages and still maintain some state that
112-
`ets` can not afford.
113-
114-
115-
## Under The Hood
116-
117-
We are using the Dirty NIF scheduler to execute the sqlite calls. The rationale
118-
behind this is that maintaining each sqlite's connection command pool is
119-
complicated and error prone.
69+
[SQLite3][pragma].
12070

71+
* Uses [Exqlite][exqlite] as the driver to communicate with sqlite3.
12172

12273
## Contributing
12374

12475
Feel free to check the project out and submit pull requests.
12576

126-
[1]: <https://github.com/mmzeeman/esqlite>
127-
[2]: <https://www.sqlite.org/pragma.html>
77+
[pragma]: <https://www.sqlite.org/pragma.html>
78+
[exqlite]: <https://github.com/warmwaffles/exqlite>

0 commit comments

Comments
 (0)