Explain how to install sqlite for moor_ffi unit tests

This commit is contained in:
Simon Binder 2019-10-28 20:42:02 +01:00
parent 0667191f14
commit 71ef36ff83
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 11 additions and 0 deletions

View File

@ -52,6 +52,17 @@ class MyDatabase extends _$MyDatabase {
}
```
{{% alert title="Installing sqlite" %}}
We can't distribute an sqlite installation as a pub package (at least
not as something that works outside of a Flutter build), so you need
to ensure that you have the sqlite3 shared library installed on your
system. On macOS, it's installed by default. On Linux, you can use the
`libsqlite3-dev` package on Ubuntu and the `sqlite3` package on Arch
(other distros will have similar packages). I'm not sure how it works
on Windows, but [downloading sqlite](https://www.sqlite.org/download.html)
and extracting `sqlite3.dll` into your application folder might work.
{{% /alert %}}
## Writing tests
We can create an in-memory version of the database by using a