angel3_orm_generator 4.1.3 copy "angel3_orm_generator: ^4.1.3" to clipboard
angel3_orm_generator: ^4.1.3 copied to clipboard


Code generators for Angel3 ORM. Generates query builder classes.


import 'dart:async';
import 'package:angel3_migration/angel3_migration.dart';
import 'package:angel3_model/angel3_model.dart';
import 'package:angel3_orm/angel3_orm.dart';
import 'package:angel3_orm/src/query.dart';
import 'package:angel3_serialize/angel3_serialize.dart';
import 'package:optional/optional.dart';
part 'main.g.dart';

void main() async {
  var query = EmployeeQuery()
    ..orWhere((w) => w.salary.greaterThanOrEqualTo(75000))
    ..join('companies', 'company_id', 'id');

  var richPerson = await (query.getOne(_FakeExecutor()) as FutureOr<Employee>);

class _FakeExecutor extends QueryExecutor {
  const _FakeExecutor();

  Future<List<List>> query(
      String tableName, String? query, Map<String, dynamic> substitutionValues,
      [returningFields = const []]) async {
    var now =;
        '_FakeExecutor received query: $query and values: $substitutionValues');
    return [
      [1, 'Rich', 'Person', 100000.0, now, now]

  Future<T> transaction<T>(FutureOr<T> Function(QueryExecutor) f) {
    throw UnsupportedError('Transactions are not supported.');

abstract class _Employee extends Model {
  String? get firstName;

  String? get lastName;

  @Column(indexType: IndexType.unique)
  String? uniqueId;

  double? get salary;