drift/extras/mysql/README.md

1.0 KiB

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
  • 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.