2018-12-01 17:21:34 +00:00
|
|
|
const Orm orm = const Orm();
|
2017-12-07 08:21:49 +00:00
|
|
|
|
2018-08-24 14:17:12 +00:00
|
|
|
class Orm {
|
2018-12-09 17:44:16 +00:00
|
|
|
/// The name of the table to query.
|
2018-12-31 11:36:08 +00:00
|
|
|
///
|
2018-12-09 17:44:16 +00:00
|
|
|
/// Inferred if not present.
|
2018-08-24 12:30:38 +00:00
|
|
|
final String tableName;
|
2018-12-31 11:36:08 +00:00
|
|
|
|
2018-12-09 17:44:16 +00:00
|
|
|
/// Whether to generate migrations for this model.
|
2018-12-31 11:36:08 +00:00
|
|
|
///
|
2018-12-09 17:44:16 +00:00
|
|
|
/// Defaults to [:true:].
|
|
|
|
final bool generateMigrations;
|
2018-08-24 12:30:38 +00:00
|
|
|
|
2018-12-09 17:44:16 +00:00
|
|
|
const Orm({this.tableName, this.generateMigrations: true});
|
2017-06-18 04:19:05 +00:00
|
|
|
}
|
|
|
|
|
2019-01-11 00:25:23 +00:00
|
|
|
@deprecated
|
2018-12-01 18:27:42 +00:00
|
|
|
class Join {
|
|
|
|
final Type against;
|
2018-08-24 12:30:38 +00:00
|
|
|
final String foreignKey;
|
2018-12-01 18:27:42 +00:00
|
|
|
final JoinType type;
|
2018-05-04 03:51:17 +00:00
|
|
|
|
2018-12-01 18:27:42 +00:00
|
|
|
const Join(this.against, this.foreignKey, {this.type: JoinType.inner});
|
2018-05-04 03:51:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// The various types of [Join].
|
2018-12-01 18:23:50 +00:00
|
|
|
enum JoinType { inner, left, right, full, self }
|