From 2f41383187d19ce43d66d908802750ddf3d70d4a Mon Sep 17 00:00:00 2001 From: Tobe O Date: Wed, 13 Feb 2019 07:57:06 -0500 Subject: [PATCH] init angel_orm_test --- angel_orm_mysql/lib/angel_orm_mysql.dart | 10 +++++++--- angel_orm_test/pubspec.yaml | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 angel_orm_test/pubspec.yaml diff --git a/angel_orm_mysql/lib/angel_orm_mysql.dart b/angel_orm_mysql/lib/angel_orm_mysql.dart index e9ce1e04..5856b919 100644 --- a/angel_orm_mysql/lib/angel_orm_mysql.dart +++ b/angel_orm_mysql/lib/angel_orm_mysql.dart @@ -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; diff --git a/angel_orm_test/pubspec.yaml b/angel_orm_test/pubspec.yaml new file mode 100644 index 00000000..6ba02cce --- /dev/null +++ b/angel_orm_test/pubspec.yaml @@ -0,0 +1,6 @@ +name: angel_orm_test +publish_to: none +dependencies: + angel_orm: + path: ../angel_orm + test: ^1.0.0 \ No newline at end of file