From 5ce5a48cff0522e30b901c8d295fe2845f9996db Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Tue, 23 Mar 2021 19:31:55 +0100 Subject: [PATCH] Prefer a space after a closing ) in functions --- moor/example/example.g.dart | 2 +- moor/test/data/tables/custom_tables.g.dart | 4 ++-- sqlparser/lib/utils/node_to_text.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/moor/example/example.g.dart b/moor/example/example.g.dart index 76c041cc..bdaa4b41 100644 --- a/moor/example/example.g.dart +++ b/moor/example/example.g.dart @@ -967,7 +967,7 @@ abstract class _$Database extends GeneratedDatabase { $IngredientInRecipesTable(this); Selectable totalWeight() { return customSelect( - 'SELECT r.title, SUM(ir.amount)AS total_weight FROM recipes AS r INNER JOIN recipe_ingredients AS ir ON ir.recipe = r.id GROUP BY r.id', + 'SELECT r.title, SUM(ir.amount) AS total_weight FROM recipes AS r INNER JOIN recipe_ingredients AS ir ON ir.recipe = r.id GROUP BY r.id', variables: [], readsFrom: {recipes, ingredientInRecipes}).map((QueryRow row) { return TotalWeightResult( diff --git a/moor/test/data/tables/custom_tables.g.dart b/moor/test/data/tables/custom_tables.g.dart index 012326fa..8b1e8930 100644 --- a/moor/test/data/tables/custom_tables.g.dart +++ b/moor/test/data/tables/custom_tables.g.dart @@ -1649,7 +1649,7 @@ abstract class _$CustomTablesDb extends GeneratedDatabase { Selectable another() { return customSelect( - 'SELECT \'one\' AS "key", NULLIF(\'two\', \'another\')AS value', + 'SELECT \'one\' AS "key", NULLIF(\'two\', \'another\') AS value', variables: [], readsFrom: {}).map((QueryRow row) { return JsonResult( @@ -1724,7 +1724,7 @@ abstract class _$CustomTablesDb extends GeneratedDatabase { } Selectable nullableQuery() { - return customSelect('SELECT MAX(oid)FROM config', + return customSelect('SELECT MAX(oid) FROM config', variables: [], readsFrom: {config}).map((QueryRow row) => row.read('MAX(oid)')); } diff --git a/sqlparser/lib/utils/node_to_text.dart b/sqlparser/lib/utils/node_to_text.dart index 20bcaa0d..76a60ea0 100644 --- a/sqlparser/lib/utils/node_to_text.dart +++ b/sqlparser/lib/utils/node_to_text.dart @@ -649,7 +649,7 @@ class NodeSqlBuilder extends AstVisitor { _identifier(e.name); _symbol('('); visit(e.parameters, arg); - _symbol(')'); + _symbol(')', spaceAfter: true); } @override