mirror of https://github.com/AMT-Cheif/drift.git
Make group_concat nullable
This commit is contained in:
parent
bce13f150f
commit
bdf0dc9985
|
@ -455,6 +455,7 @@ class TypeResolver extends RecursiveVisitor<TypeExpectation, void> {
|
|||
|
||||
ResolvedType? _resolveInvocation(ExpressionInvocation e) {
|
||||
final params = e.expandParameters();
|
||||
|
||||
void nullableIfChildIs() {
|
||||
session._addRelation(NullableIfSomeOtherIs(e, params));
|
||||
}
|
||||
|
@ -484,9 +485,10 @@ class TypeResolver extends RecursiveVisitor<TypeExpectation, void> {
|
|||
case 'substr':
|
||||
case 'trim':
|
||||
case 'upper':
|
||||
case 'group_concat':
|
||||
nullableIfChildIs();
|
||||
return _textType;
|
||||
case 'group_concat':
|
||||
return _textType.withNullable(true);
|
||||
case 'date':
|
||||
case 'time':
|
||||
case 'datetime':
|
||||
|
|
|
@ -42,6 +42,8 @@ const Map<String, ResolvedType?> _types = {
|
|||
ResolvedType.bool(),
|
||||
'INSERT INTO demo DEFAULT VALUES ON CONFLICT DO UPDATE SET id = id WHERE ?':
|
||||
ResolvedType.bool(),
|
||||
'SELECT GROUP_CONCAT(content) = ? FROM demo;':
|
||||
ResolvedType(type: BasicType.text, nullable: true),
|
||||
};
|
||||
|
||||
SqlEngine _spawnEngine() {
|
||||
|
|
Loading…
Reference in New Issue