Gen postegres factory
This commit is contained in:
parent
576fdc6d8a
commit
4fad5a2c97
15 changed files with 74 additions and 3 deletions
|
@ -24,4 +24,5 @@ dev_dependencies:
|
||||||
#angel_migration: ^1.0.0-alpha
|
#angel_migration: ^1.0.0-alpha
|
||||||
#angel_test: ^1.0.0
|
#angel_test: ^1.0.0
|
||||||
build_runner: ^0.10.0
|
build_runner: ^0.10.0
|
||||||
|
postgres: ^1.0.0
|
||||||
test: ^1.0.0
|
test: ^1.0.0
|
||||||
|
|
|
@ -4,11 +4,15 @@
|
||||||
// OrmGenerator
|
// OrmGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
import 'dart:async';
|
|
||||||
import 'author.dart';
|
import 'author.dart';
|
||||||
|
import 'dart:async';
|
||||||
|
import 'package:postgres/postgres.dart';
|
||||||
part 'author.postgresql.orm.g.dart';
|
part 'author.postgresql.orm.g.dart';
|
||||||
|
|
||||||
abstract class AuthorOrm {
|
abstract class AuthorOrm {
|
||||||
|
factory AuthorOrm.postgreSql(PostgreSQLConnection connection) =
|
||||||
|
_PostgreSqlAuthorOrmImpl;
|
||||||
|
|
||||||
Future<List<Author>> getAll();
|
Future<List<Author>> getAll();
|
||||||
Future<Author> getById(id);
|
Future<Author> getById(id);
|
||||||
Future<Author> update(Author model);
|
Future<Author> update(Author model);
|
||||||
|
|
|
@ -5,3 +5,9 @@
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
part of 'author.orm.g.dart';
|
part of 'author.orm.g.dart';
|
||||||
|
|
||||||
|
class _PostgreSqlAuthorOrmImpl implements AuthorOrm {
|
||||||
|
_PostgreSqlAuthorOrmImpl(this.connection);
|
||||||
|
|
||||||
|
final PostgreSQLConnection connection;
|
||||||
|
}
|
||||||
|
|
|
@ -4,11 +4,15 @@
|
||||||
// OrmGenerator
|
// OrmGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
import 'dart:async';
|
|
||||||
import 'car.dart';
|
import 'car.dart';
|
||||||
|
import 'dart:async';
|
||||||
|
import 'package:postgres/postgres.dart';
|
||||||
part 'car.postgresql.orm.g.dart';
|
part 'car.postgresql.orm.g.dart';
|
||||||
|
|
||||||
abstract class CarOrm {
|
abstract class CarOrm {
|
||||||
|
factory CarOrm.postgreSql(PostgreSQLConnection connection) =
|
||||||
|
_PostgreSqlCarOrmImpl;
|
||||||
|
|
||||||
Future<List<Car>> getAll();
|
Future<List<Car>> getAll();
|
||||||
Future<Car> getById(id);
|
Future<Car> getById(id);
|
||||||
Future<Car> update(Car model);
|
Future<Car> update(Car model);
|
||||||
|
|
|
@ -5,3 +5,9 @@
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
part of 'car.orm.g.dart';
|
part of 'car.orm.g.dart';
|
||||||
|
|
||||||
|
class _PostgreSqlCarOrmImpl implements CarOrm {
|
||||||
|
_PostgreSqlCarOrmImpl(this.connection);
|
||||||
|
|
||||||
|
final PostgreSQLConnection connection;
|
||||||
|
}
|
||||||
|
|
|
@ -4,11 +4,15 @@
|
||||||
// OrmGenerator
|
// OrmGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
import 'dart:async';
|
|
||||||
import 'customer.dart';
|
import 'customer.dart';
|
||||||
|
import 'dart:async';
|
||||||
|
import 'package:postgres/postgres.dart';
|
||||||
part 'customer.postgresql.orm.g.dart';
|
part 'customer.postgresql.orm.g.dart';
|
||||||
|
|
||||||
abstract class CustomerOrm {
|
abstract class CustomerOrm {
|
||||||
|
factory CustomerOrm.postgreSql(PostgreSQLConnection connection) =
|
||||||
|
_PostgreSqlCustomerOrmImpl;
|
||||||
|
|
||||||
Future<List<Customer>> getAll();
|
Future<List<Customer>> getAll();
|
||||||
Future<Customer> getById(id);
|
Future<Customer> getById(id);
|
||||||
Future<Customer> update(Customer model);
|
Future<Customer> update(Customer model);
|
||||||
|
|
|
@ -5,3 +5,9 @@
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
part of 'customer.orm.g.dart';
|
part of 'customer.orm.g.dart';
|
||||||
|
|
||||||
|
class _PostgreSqlCustomerOrmImpl implements CustomerOrm {
|
||||||
|
_PostgreSqlCustomerOrmImpl(this.connection);
|
||||||
|
|
||||||
|
final PostgreSQLConnection connection;
|
||||||
|
}
|
||||||
|
|
|
@ -6,9 +6,13 @@
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'foot.dart';
|
import 'foot.dart';
|
||||||
|
import 'package:postgres/postgres.dart';
|
||||||
part 'foot.postgresql.orm.g.dart';
|
part 'foot.postgresql.orm.g.dart';
|
||||||
|
|
||||||
abstract class FootOrm {
|
abstract class FootOrm {
|
||||||
|
factory FootOrm.postgreSql(PostgreSQLConnection connection) =
|
||||||
|
_PostgreSqlFootOrmImpl;
|
||||||
|
|
||||||
Future<List<Foot>> getAll();
|
Future<List<Foot>> getAll();
|
||||||
Future<Foot> getById(id);
|
Future<Foot> getById(id);
|
||||||
Future<Foot> update(Foot model);
|
Future<Foot> update(Foot model);
|
||||||
|
|
|
@ -5,3 +5,9 @@
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
part of 'foot.orm.g.dart';
|
part of 'foot.orm.g.dart';
|
||||||
|
|
||||||
|
class _PostgreSqlFootOrmImpl implements FootOrm {
|
||||||
|
_PostgreSqlFootOrmImpl(this.connection);
|
||||||
|
|
||||||
|
final PostgreSQLConnection connection;
|
||||||
|
}
|
||||||
|
|
|
@ -6,9 +6,13 @@
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'fruit.dart';
|
import 'fruit.dart';
|
||||||
|
import 'package:postgres/postgres.dart';
|
||||||
part 'fruit.postgresql.orm.g.dart';
|
part 'fruit.postgresql.orm.g.dart';
|
||||||
|
|
||||||
abstract class FruitOrm {
|
abstract class FruitOrm {
|
||||||
|
factory FruitOrm.postgreSql(PostgreSQLConnection connection) =
|
||||||
|
_PostgreSqlFruitOrmImpl;
|
||||||
|
|
||||||
Future<List<Fruit>> getAll();
|
Future<List<Fruit>> getAll();
|
||||||
Future<Fruit> getById(id);
|
Future<Fruit> getById(id);
|
||||||
Future<Fruit> update(Fruit model);
|
Future<Fruit> update(Fruit model);
|
||||||
|
|
|
@ -5,3 +5,9 @@
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
part of 'fruit.orm.g.dart';
|
part of 'fruit.orm.g.dart';
|
||||||
|
|
||||||
|
class _PostgreSqlFruitOrmImpl implements FruitOrm {
|
||||||
|
_PostgreSqlFruitOrmImpl(this.connection);
|
||||||
|
|
||||||
|
final PostgreSQLConnection connection;
|
||||||
|
}
|
||||||
|
|
|
@ -6,9 +6,13 @@
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'order.dart';
|
import 'order.dart';
|
||||||
|
import 'package:postgres/postgres.dart';
|
||||||
part 'order.postgresql.orm.g.dart';
|
part 'order.postgresql.orm.g.dart';
|
||||||
|
|
||||||
abstract class OrderOrm {
|
abstract class OrderOrm {
|
||||||
|
factory OrderOrm.postgreSql(PostgreSQLConnection connection) =
|
||||||
|
_PostgreSqlOrderOrmImpl;
|
||||||
|
|
||||||
Future<List<Order>> getAll();
|
Future<List<Order>> getAll();
|
||||||
Future<Order> getById(id);
|
Future<Order> getById(id);
|
||||||
Future<Order> update(Order model);
|
Future<Order> update(Order model);
|
||||||
|
|
|
@ -5,3 +5,9 @@
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
part of 'order.orm.g.dart';
|
part of 'order.orm.g.dart';
|
||||||
|
|
||||||
|
class _PostgreSqlOrderOrmImpl implements OrderOrm {
|
||||||
|
_PostgreSqlOrderOrmImpl(this.connection);
|
||||||
|
|
||||||
|
final PostgreSQLConnection connection;
|
||||||
|
}
|
||||||
|
|
|
@ -5,10 +5,14 @@
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'package:postgres/postgres.dart';
|
||||||
import 'role.dart';
|
import 'role.dart';
|
||||||
part 'role.postgresql.orm.g.dart';
|
part 'role.postgresql.orm.g.dart';
|
||||||
|
|
||||||
abstract class RoleOrm {
|
abstract class RoleOrm {
|
||||||
|
factory RoleOrm.postgreSql(PostgreSQLConnection connection) =
|
||||||
|
_PostgreSqlRoleOrmImpl;
|
||||||
|
|
||||||
Future<List<Role>> getAll();
|
Future<List<Role>> getAll();
|
||||||
Future<Role> getById(id);
|
Future<Role> getById(id);
|
||||||
Future<Role> update(Role model);
|
Future<Role> update(Role model);
|
||||||
|
|
|
@ -5,3 +5,9 @@
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
part of 'role.orm.g.dart';
|
part of 'role.orm.g.dart';
|
||||||
|
|
||||||
|
class _PostgreSqlRoleOrmImpl implements RoleOrm {
|
||||||
|
_PostgreSqlRoleOrmImpl(this.connection);
|
||||||
|
|
||||||
|
final PostgreSQLConnection connection;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue