Skip to content

Commit 9a9b921

Browse files
committed
refactor: simplify null handling in execute
1 parent 25a3f0d commit 9a9b921

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

package/src/operations/execute.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import {
2-
NITRO_SQLITE_NULL,
3-
isNitroSQLiteNull,
4-
isSimpleNullHandlingEnabled,
5-
} from '..'
1+
import { isNitroSQLiteNull, isSimpleNullHandlingEnabled } from '../nullHandling'
62
import { HybridNitroSQLite } from '../nitro'
3+
import { replaceWithNativeNullValue } from '../nullHandling'
74
import type { NativeQueryResult } from '../specs/NativeQueryResult.nitro'
85
import type {
96
QueryResult,
@@ -51,12 +48,7 @@ export async function executeAsync<Row extends QueryResultRow = never>(
5148
function toNativeQueryParams(
5249
params: SQLiteQueryParams | undefined
5350
): NativeSQLiteQueryParams | undefined {
54-
return params?.map((param) => {
55-
if (param === undefined || param === null) {
56-
return NITRO_SQLITE_NULL
57-
}
58-
return param
59-
})
51+
return params?.map((param) => replaceWithNativeNullValue(param))
6052
}
6153

6254
function buildJsQueryResult<Row extends QueryResultRow = never>({

0 commit comments

Comments
 (0)