From 0f0596bba70fbfbc8d4cb2d134312c08e8edba3c Mon Sep 17 00:00:00 2001 From: Isaque Neves Date: Mon, 8 Apr 2024 17:00:05 -0300 Subject: [PATCH] 3.0.1 --- CHANGELOG.md | 6 +++++- lib/src/query/query_builder.dart | 9 +++++---- pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81ee98b..022b2b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,4 +72,8 @@ final manager = Manager(); ## 3.0.0 -- implemented support for mysql through the 'mysql_client' package and also implemented support for posgress with the postgres v3 package, now you can choose the driver implementation through ``` 'driver_implementation': 'postgres_v3', ``` in addConnection method \ No newline at end of file +- implemented support for mysql through the 'mysql_client' package and also implemented support for posgress with the postgres v3 package, now you can choose the driver implementation through ``` 'driver_implementation': 'postgres_v3', ``` in addConnection method + +## 3.0.1 + +- fix bug on query builder count() diff --git a/lib/src/query/query_builder.dart b/lib/src/query/query_builder.dart index 31f4ed0..6567b88 100644 --- a/lib/src/query/query_builder.dart +++ b/lib/src/query/query_builder.dart @@ -1890,7 +1890,7 @@ class QueryBuilder { /// /// Retrieve the "count" result of the query. /// - /// @param String|List $columns + /// @param String|List columns /// @return int /// Future count([dynamic columns = '*']) async { @@ -1901,7 +1901,8 @@ class QueryBuilder { //__FUNCTION__ The function name, or {closure} for anonymous functions. //a constant __FUNCTION__ retorna o nome da corrent função https://www.php.net/manual/en/language.constants.magic.php - return await this.aggregate('count', columns); + final result = await this.aggregate('count', columns); + return result is int ? result : 0; } /// @@ -2056,8 +2057,8 @@ class QueryBuilder { /// @return int /// Future insertGetId(Map keyValues, - [String sequence = 'id']) async{ - final sql = this.grammar.compileInsertGetId(this, keyValues, sequence); + [String sequence = 'id']) async { + final sql = this.grammar.compileInsertGetId(this, keyValues, sequence); final values = this.cleanBindings(keyValues.values.toList()); return await this.processor.processInsertGetId(this, sql, values, sequence); } diff --git a/pubspec.yaml b/pubspec.yaml index e9d335a..2d618c2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: eloquent -version: 3.0.0 +version: 3.0.1 description: eloquent query builder port from PHP Laravel homepage: https://github.com/insinfo/eloquent_dart #publish_to: none