init angel_orm_test

This commit is contained in:
Tobe O 2019-02-13 07:57:06 -05:00
parent c8b3be6811
commit 2f41383187
2 changed files with 13 additions and 3 deletions

View file

@ -24,6 +24,9 @@ class MySqlExecutor extends QueryExecutor {
query = query.replaceAll('@$name', '?');
}
logger?.fine('Query: $query');
logger?.fine('Values: $substitutionValues');
if (returningFields?.isNotEmpty != true) {
return _connection
.prepared(query, substitutionValues.values)
@ -36,9 +39,10 @@ class MySqlExecutor extends QueryExecutor {
var writeResults =
await _transaction.prepared(query, substitutionValues.values);
var fieldSet = returningFields.map((s) => '`$s`').join(',');
var readResults = await _transaction.prepared(
'select $fieldSet from $tableName where id = ?;',
[writeResults.insertId]);
var fetchSql = 'select $fieldSet from $tableName where id = ?;';
logger?.fine(fetchSql);
var readResults =
await _transaction.prepared(fetchSql, [writeResults.insertId]);
var mapped = readResults.map((r) => r.toList()).toList();
await _transaction.commit();
return mapped;

View file

@ -0,0 +1,6 @@
name: angel_orm_test
publish_to: none
dependencies:
angel_orm:
path: ../angel_orm
test: ^1.0.0