mirror of https://github.com/AMT-Cheif/drift.git
Add recommended build options for drift postgres
This commit is contained in:
parent
417c2c1207
commit
98fd6a0ef0
|
@ -4,8 +4,10 @@ talking to PostgreSQL databases by using the `postgres` package.
|
|||
## Using this
|
||||
|
||||
For general notes on using drift, see [this guide](https://drift.simonbinder.eu/getting-started/).
|
||||
Detailed docs on getting started with `drift_postgres` are available [here](https://drift.simonbinder.eu/docs/platforms/postgres/#setup).
|
||||
|
||||
To use drift_postgres, add this to your `pubspec.yaml`
|
||||
|
||||
```yaml
|
||||
dependencies:
|
||||
drift: "$latest version"
|
||||
|
@ -25,6 +27,21 @@ final database = AppDatabase(PgDatabase(
|
|||
));
|
||||
```
|
||||
|
||||
Also, consider adding builder options to make drift generate postgres-specific code:
|
||||
|
||||
```yaml
|
||||
# build.yaml
|
||||
targets:
|
||||
$default:
|
||||
builders:
|
||||
drift_dev:
|
||||
options:
|
||||
sql:
|
||||
dialects:
|
||||
- sqlite # remove this line if you only need postgres
|
||||
- postgres
|
||||
```
|
||||
|
||||
## Running tests
|
||||
|
||||
To test this package, first run
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
targets:
|
||||
$default:
|
||||
builders:
|
||||
drift_dev:
|
||||
options:
|
||||
sql:
|
||||
dialects:
|
||||
- sqlite # remove this line if you only need postgres
|
||||
- postgres
|
Loading…
Reference in New Issue