platform/angel_orm/lib/src/annotations.dart

27 lines
579 B
Dart
Raw Normal View History

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.
///
/// Inferred if not present.
2018-08-24 12:30:38 +00:00
final String tableName;
2018-12-09 17:44:16 +00:00
/// Whether to generate migrations for this model.
///
/// 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
}
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-12-01 18:27:42 +00:00
const Join(this.against, this.foreignKey, {this.type: JoinType.inner});
}
/// The various types of [Join].
2018-12-01 18:23:50 +00:00
enum JoinType { inner, left, right, full, self }