Skip to content

Commit c6230a3

Browse files
authored
Touch up docs a bit. (#186)
1 parent 76c64fd commit c6230a3

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ I will add one more: If there is *any* potential that more than one server node
2525

2626
## Help Wanted!
2727

28-
If you are willing to live on the bleeding edge, I would welcome any assistance in getting `sqlite_ecto2` to a production quality 2.0.0 release. Some specific areas of concern:
28+
I would welcome any assistance in improving `sqlite_ecto2`. Some specific areas of concern:
2929

3030
**Documentation:**
3131

3232
* Newcomers, especially: I'd like feedback on the getting started content. What works and what is confusing? How can we make adopting this library more intuitive?
3333
* I'd like to have at least one public example application.
34-
* Review `@moduledoc` and `@doc` comments for accuracy.
3534
* Add a more formal contribution guide, similar to the one from Ecto.
3635

3736
**Code quality:**

lib/sqlite_ecto.ex

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,33 @@ defmodule Sqlite.Ecto2 do
44
55
It uses Sqlitex and Esqlite for accessing the SQLite database.
66
7-
## Features
8-
9-
## Options
10-
11-
There are a limited number of options available because SQLite is so simple to use.
12-
13-
### Compile time options
14-
15-
These options should be set in the config file and require recompilation in
16-
order to make an effect.
17-
18-
* `:adapter` - The adapter name, in this case, `Sqlite.Ecto2`
19-
* `:timeout` - The default timeout to use on queries, defaults to `5000`
7+
## Configuration Options
8+
9+
When creating an `Ecto.Repo` that uses a SQLite database, you should configure
10+
it as follows:
11+
12+
```elixir
13+
# In your config/config.exs file
14+
config :my_app, Repo,
15+
adapter: Sqlite.Ecto2,
16+
database: "ecto_simple.sqlite3"
17+
18+
# In your application code
19+
defmodule Repo do
20+
use Ecto.Repo,
21+
otp_app: :my_app,
22+
adapter: Sqlite.Ecto2
23+
end
24+
```
2025
21-
### Connection options
26+
You may use other options as specified in the `Ecto.Repo` documentation.
2227
23-
* `:database` - This option can take the form of a path to the SQLite
24-
database file or `":memory:"` for an in-memory database. See the
25-
[SQLite docs](https://sqlite.org/uri.html) for more options such as
26-
shared memory caches.
27-
* `:after_connect` - A `{mod, fun, args}` to be invoked after a connection is established
28+
Note that the `:database` option is passed as the `filename` argument to
29+
[`sqlite3_open_v2`](http://sqlite.org/c3ref/open.html). This implies that you
30+
may use `:memory:` to create a private, temporary in-memory database.
2831
32+
See also [SQLite's interpretation of URI "filenames"](https://sqlite.org/uri.html)
33+
for more options such as shared memory caches.
2934
"""
3035

3136
# Inherit all behaviour from Ecto.Adapters.SQL

0 commit comments

Comments
 (0)