queries property

Map<String, String> queries

Optionally, a list of named sql queries. During a build, drift will look at the defined sql, figure out what they do, and write appropriate methods in your generated database.

For instance, when using

  tables: [Users],
  queries: {
    'userById': 'SELECT * FROM users WHERE id = ?',

Drift will generate two methods for you: userById(int id) and watchUserById(int id).


final Map<String, String> queries;