Skip to content

Touch up docs a bit. #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2017
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ I will add one more: If there is *any* potential that more than one server node

## Help Wanted!

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:
I would welcome any assistance in improving `sqlite_ecto2`. Some specific areas of concern:

**Documentation:**

* 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?
* I'd like to have at least one public example application.
* Review `@moduledoc` and `@doc` comments for accuracy.
* Add a more formal contribution guide, similar to the one from Ecto.

**Code quality:**
Expand Down
43 changes: 24 additions & 19 deletions lib/sqlite_ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,33 @@ defmodule Sqlite.Ecto2 do

It uses Sqlitex and Esqlite for accessing the SQLite database.

## Features

## Options

There are a limited number of options available because SQLite is so simple to use.

### Compile time options

These options should be set in the config file and require recompilation in
order to make an effect.

* `:adapter` - The adapter name, in this case, `Sqlite.Ecto2`
* `:timeout` - The default timeout to use on queries, defaults to `5000`
## Configuration Options

When creating an `Ecto.Repo` that uses a SQLite database, you should configure
it as follows:

```elixir
# In your config/config.exs file
config :my_app, Repo,
adapter: Sqlite.Ecto2,
database: "ecto_simple.sqlite3"

# In your application code
defmodule Repo do
use Ecto.Repo,
otp_app: :my_app,
adapter: Sqlite.Ecto2
end
```

### Connection options
You may use other options as specified in the `Ecto.Repo` documentation.

* `:database` - This option can take the form of a path to the SQLite
database file or `":memory:"` for an in-memory database. See the
[SQLite docs](https://sqlite.org/uri.html) for more options such as
shared memory caches.
* `:after_connect` - A `{mod, fun, args}` to be invoked after a connection is established
Note that the `:database` option is passed as the `filename` argument to
[`sqlite3_open_v2`](http://sqlite.org/c3ref/open.html). This implies that you
may use `:memory:` to create a private, temporary in-memory database.

See also [SQLite's interpretation of URI "filenames"](https://sqlite.org/uri.html)
for more options such as shared memory caches.
"""

# Inherit all behaviour from Ecto.Adapters.SQL
Expand Down