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