File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- import { NITRO_SQLITE_NULL , simpleNullHandlingEnabled } from '..'
1+ import { NITRO_SQLITE_NULL , isSimpleNullHandlingEnabled } from '..'
22import { HybridNitroSQLite } from '../nitro'
33import type { NativeQueryResult } from '../specs/NativeQueryResult.nitro'
44import type {
@@ -27,7 +27,7 @@ export async function executeAsync<Row extends QueryResultRow = never>(
2727 query : string ,
2828 params ?: SQLiteQueryParams
2929) : Promise < QueryResult < Row > > {
30- const transformedParams = simpleNullHandlingEnabled ( )
30+ const transformedParams = isSimpleNullHandlingEnabled ( )
3131 ? toNativeQueryParams ( params )
3232 : ( params as NativeSQLiteQueryParams )
3333
@@ -58,12 +58,12 @@ function buildJsQueryResult<Row extends QueryResultRow = never>({
5858} : NativeQueryResult ) : QueryResult < Row > {
5959 let data : Row [ ] = results as Row [ ]
6060
61- if ( simpleNullHandlingEnabled ( ) ) {
61+ if ( isSimpleNullHandlingEnabled ( ) ) {
6262 data = results . map ( ( row ) =>
6363 Object . fromEntries (
6464 Object . entries ( row ) . map ( ( [ key , value ] ) => {
65- if ( value === NITRO_SQLITE_NULL ) {
66- return [ key , undefined ]
65+ if ( typeof value === 'object' && 'isNull' in value ) {
66+ return [ key , null ]
6767 }
6868 return [ key , value ]
6969 } )
You can’t perform that action at this time.
0 commit comments