diff --git a/src/db/ModelQuery.ts b/src/db/ModelQuery.ts index 0708c02..b67f1d1 100644 --- a/src/db/ModelQuery.ts +++ b/src/db/ModelQuery.ts @@ -263,7 +263,7 @@ class FieldValue { } public toString(first: boolean = true): string { - return `${!first ? ',' : ''}${this.field}${this.test}${this.raw || this.value instanceof ModelQuery ? this.value : (Array.isArray(this.value) ? '(?)' : '?')}`; + return `${!first ? ',' : ''}${this.field}${this.test}${this.raw || this.value === null || this.value instanceof ModelQuery ? this.value : (Array.isArray(this.value) ? '(?)' : '?')}`; } protected get test(): string { @@ -299,6 +299,13 @@ class WhereFieldValue extends FieldValue { } protected get test(): string { + if (this.value === null) { + if (this._test === WhereTest.EQ) { + return ' IS '; + } else if (this._test === WhereTest.NE) { + return ' IS NOT '; + } + } return this._test; } } \ No newline at end of file