Improve docs related to builders and alternatives

This commit is contained in:
Simon Binder 2021-01-26 20:47:27 +01:00
parent 821a1009cf
commit 4394dceffc
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
2 changed files with 12 additions and 11 deletions

View File

@ -128,21 +128,18 @@ and minor code changes. Put this content in a file called `build.yaml` next to y
targets:
$default:
builders:
# disable the default generator and enable the one emitting a .moor.dart file
moor_generator:
enabled: false
# disable the default generators, we'll only use the non-shared moor generator here
auto_apply_builders: false
moor_generator|moor_generator_not_shared:
enabled: true
# If needed, you can configure the builder like this:
# options:
# skip_verification_code: true
# use_experimental_inference: true
# Run built_value_generator when moor is done, which is not in this target.
built_value_generator|built_value:
enabled: false
# all other builders that need to work on moor classes should be disabled here
# as well
# This builder is necessary for moor-file preprocessing. You can disable it if you're not
# using .moor files with type converters.
moor_generator|preparing_builder:
enabled: true
run_built_value:
dependencies: ['your_package_name']

View File

@ -73,9 +73,10 @@ That said, here's an incomplete (and obviously biased) list of great libraries a
If you have experience with any of these (or other) libraries and want to share how they compare to moor, please
feel invited to contribute to this page.
## sqflite
## sqflite, sqlite3
Sqflite is a Flutter package that provides bindings to the sqlite api for both iOS and Android. It's well maintained
and has stable api. In fact, moor is built on top of sqflite to send queries to the database. But even though sqflite
and has stable api. In fact, the `moor_flutter` variant is built on top of sqflite. But even though sqflite
has an api to construct some simple queries in Dart, moor goes a bit further by
* Generating typesafe mapping code for your queries
@ -85,6 +86,9 @@ has an api to construct some simple queries in Dart, moor goes a bit further by
Still, for most apps that don't need these features, sqflite can be a very fitting persistence library.
The same thing applies to the `sqlite3` package - `package:moor/ffi.dart` uses that library, but provides
additional services on top.
### sqlcool
Sqlcool is a lightweight library around sqflite that makes writing queries and schema management easier, it also has
auto-updating streams. It can be a decent alternative to moor if you don't want/need generated code to parse the