Fixed trailing comma bug and nameOfCreationMethod

This commit is contained in:
Daniel Brauner 2022-01-17 23:05:09 +01:00
parent 23de4c5cee
commit e99b66486d
2 changed files with 5 additions and 3 deletions

View File

@ -70,9 +70,9 @@ class QueryWriter {
String _nameOfCreationMethod(SqlSelectQuery select) {
if (!select.declaredInMoorFile && !options.compactQueryMethods) {
return select.name;
} else {
return '${select.name}Query';
} else {
return select.name;
}
}
@ -149,7 +149,7 @@ class QueryWriter {
_writeCustomSelectStatement(nested.query);
_buffer.write('.get()');
_buffer.write('.get(),');
}
}
_buffer.write(');\n}');

View File

@ -147,6 +147,8 @@ class SqlWriter extends NodeSqlBuilder {
query!.placeholders.singleWhere((p) => p.astNode == e);
_writeRawInSpaces('\${${placeholderContextName(moorPlaceholder)}.sql}');
} else if (e is NestedQueryColumn) {
_out.write('0');
} else {
return super.visitMoorSpecificNode(e, arg);
}