drift/extras/mysql
Simon Binder 60d3bf05e1
Remove coupling between QueryExecutor and generated db
Closes #372
2020-03-15 14:55:02 +01:00
..
lib Remove coupling between QueryExecutor and generated db 2020-03-15 14:55:02 +01:00
.gitignore Make mysql example a sub-library that we won't publish 2019-07-24 18:25:59 +02:00
README.md Provide information about the sql dialect at runtime 2019-07-28 14:21:39 +02:00
docker-compose.yaml Make mysql example a sub-library that we won't publish 2019-07-24 18:25:59 +02:00
pubspec.yaml Adapt tests for new equals methods 2019-12-12 18:00:29 +01:00

README.md

Experimental support for using Moor with an MySQL server.

Using this

For general notes on using moor, see this guide. To use the MySQL backend, also add this to your pubspec (you don't need to depend on moor_flutter).

dependencies:
  moor: "$latest version"
  moor_mysql:
   git:
    url: https://github.com/simolus3/moor.git
    path: extras/mysql 

Then, instead of using a FlutterQueryExecutor, use a MySqlBackend with the right ConnectionSettings. You'll need to import package:moor_mysql/moor_mysql.dart.

Limitations

We're currently experimenting with other database engines - Moor was mainly designed for sqlite and supporting advanced features of MySQL is not a priority right now.

  • No migrations - you'll need to create your tables manually
  • Some statements don't work
  • Compiled custom queries don't work - we can only parse sqlite. Of course, runtime custom queries with customSelect and customUpdate will work as expected.