Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ jobs:
mix deps.get

- run: mix test
- run: EXQLITE_INTEGRATION=true mix test
17 changes: 17 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

All notable changes will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog], and this project
adheres to [Semantic Versioning][semver].

## [Unreleased]

## [0.5.0] - 2021-03-17

### Removed
- Removed `Ecto.Adapters.Exqlite`. Replace with [Ecto Sqlite3 Library][ecto_sqlite3].

[keepachangelog]: <https://keepachangelog.com/en/1.0.0/>
[semver]: <https://semver.org/spec/v2.0.0.html>
[ecto_sqlite3]: <https://github.com/kevinlang/ecto_sqlite3>
58 changes: 9 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Exqlite

An SQLite3 library with an Ecto adapter implementation.
An Elixir SQLite3 library.

If you are looking for the Ecto adapater, take a look at the
[Ecto SQLite3 library][ecto_sqlite3].


## Caveats
Expand All @@ -9,9 +12,8 @@ An SQLite3 library with an Ecto adapter implementation.
* Prepared statements are not immutable. You must be careful when manipulating
statements and binding values to statements. Do not try to manipulate the
statements concurrently. Keep it isolated to one process.
* Adding a `CHECK` constraint is not supported by the Ecto adapter. This is due
to how Ecto handles specifying constraints. In SQLite you must specify the
`CHECK` on creation.
* Simultaneous writing is not supported by SQLite3 and will not be supported
here.
* All native calls are run through the Dirty NIF scheduler.
* Datetimes are stored without offsets. This is due to how SQLite3 handles date
and times. If you would like to store a timezone, you will need to create a
Expand All @@ -24,12 +26,12 @@ An SQLite3 library with an Ecto adapter implementation.

```elixir
defp deps do
{:exqlite, "~> 0.4.9"}
{:exqlite, "~> 0.5.0"}
end
```


## Usage Without Ecto
## Usage

The `Exqlite.Sqlite3` module usage is fairly straight forward.

Expand Down Expand Up @@ -58,47 +60,6 @@ The `Exqlite.Sqlite3` module usage is fairly straight forward.
```


## Usage With Ecto

Define your repo similar to this.

```elixir
defmodule MyApp.Repo do
use Ecto.Repo, otp_app: :my_app, adapter: Ecto.Adapters.Exqlite
end
```

Configure your repository similar to the following. If you want to know more
about the possible options to pass the repository, checkout the documentation
for `Exqlite.Connection.connect/1`. It will have more information on what is
configurable.

```elixir
config :my_app,
ecto_repos: [MyApp.Repo]

config :my_app, MyApp.Repo,
database: "path/to/my/database.db",
show_sensitive_data_on_connection_error: false,
journal_mode: :wal,
cache_size: -64000,
temp_store: :memory,
pool_size: 1
```


### Note

* Pool size is set to `1` but can be increased to `4`. When set to `10` there
was a lot of database busy errors. Currently this is a known issue and is
being looked in to.

* Cache size is a negative number because that is how SQLite3 defines the cache
size in kilobytes. If you make it positive, that is the number of pages in
memory to use. Both have their pros and cons. Check the documentation out for
[SQLite3][2].


## Why SQLite3

I needed an Ecto3 adapter to store time series data for a personal project. I
Expand All @@ -123,5 +84,4 @@ complicated and error prone.

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

[1]: <https://github.com/mmzeeman/esqlite>
[2]: <https://www.sqlite.org/pragma.html>
[ecto_sqlite3]: <https://github.com/kevinlang/ecto_sqlite3>
36 changes: 0 additions & 36 deletions bench/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions bench/bench_helper.exs

This file was deleted.

53 changes: 0 additions & 53 deletions bench/scripts/macro/all_bench.exs

This file was deleted.

46 changes: 0 additions & 46 deletions bench/scripts/macro/insert_bench.exs

This file was deleted.

55 changes: 0 additions & 55 deletions bench/scripts/micro/load_bench.exs

This file was deleted.

64 changes: 0 additions & 64 deletions bench/scripts/micro/to_sql_bench.exs

This file was deleted.

15 changes: 0 additions & 15 deletions bench/support/migrations.exs

This file was deleted.

Loading