File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change 1- import { NITRO_SQLITE_NULL , isSimpleNullHandlingEnabled } from '../nullHandling'
1+ import {
2+ isSimpleNullHandlingEnabled ,
3+ replaceWithNativeNullValue ,
4+ } from '../nullHandling'
25import { HybridNitroSQLite } from '../nitro'
36import type {
47 NativeSQLiteQueryParams ,
58 BatchQueryResult ,
69 BatchQueryCommand ,
710 NativeBatchQueryCommand ,
8- SQLiteValue ,
9- SQLiteQueryParamItem ,
1011} from '../types'
1112
1213export function executeBatch (
@@ -36,22 +37,15 @@ export async function executeBatchAsync(
3637 return result
3738}
3839
39- function replaceWithNativeNull ( value : SQLiteQueryParamItem ) : SQLiteValue {
40- if ( value === undefined || value === null ) {
41- return NITRO_SQLITE_NULL
42- }
43- return value
44- }
45-
4640function toNativeBatchQueryCommands (
4741 commands : BatchQueryCommand [ ]
4842) : NativeBatchQueryCommand [ ] {
4943 return commands . map ( ( command ) => {
5044 const transformedParams = command . params ?. map ( ( param ) => {
5145 if ( Array . isArray ( param ) ) {
52- return param . map ( ( p ) => replaceWithNativeNull ( p ) )
46+ return param . map ( ( p ) => replaceWithNativeNullValue ( p ) )
5347 }
54- return replaceWithNativeNull ( param )
48+ return replaceWithNativeNullValue ( param )
5549 } ) as NativeSQLiteQueryParams | NativeSQLiteQueryParams [ ]
5650
5751 return {
You can’t perform that action at this time.
0 commit comments