File tree Expand file tree Collapse file tree 2 files changed +37
-19
lines changed
Expand file tree Collapse file tree 2 files changed +37
-19
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { transaction } from './operations/transaction'
22import { HybridNitroSQLite } from './nitro'
33import { open } from './operations/session'
44import { execute , executeAsync } from './operations/execute'
5- import { SQLiteNullValue } from './types'
65import { init } from './OnLoad'
76export type * from './types'
87export { typeORMDriver } from './typeORM'
@@ -22,21 +21,9 @@ export const NitroSQLite = {
2221}
2322
2423export { open } from './operations/session'
25-
26- let ENABLE_SIMPLE_NULL_HANDLING = false
27- export function enableSimpleNullHandling (
28- shouldEnableSimpleNullHandling = true
29- ) {
30- ENABLE_SIMPLE_NULL_HANDLING = shouldEnableSimpleNullHandling
31- }
32- export function isSimpleNullHandlingEnabled ( ) {
33- return ENABLE_SIMPLE_NULL_HANDLING
34- }
35-
36- export const NITRO_SQLITE_NULL : SQLiteNullValue = { isNitroSQLiteNull : true }
37- export function isNitroSQLiteNull ( value : any ) : value is SQLiteNullValue {
38- if ( typeof value === 'object' && 'isNitroSQLiteNull' in value ) {
39- return true
40- }
41- return false
42- }
24+ export {
25+ isNitroSQLiteNull ,
26+ NITRO_SQLITE_NULL ,
27+ isSimpleNullHandlingEnabled ,
28+ enableSimpleNullHandling ,
29+ } from './nullHandling'
Original file line number Diff line number Diff line change 1+ import { SQLiteNullValue , SQLiteValue } from './types'
2+ import { SQLiteQueryParamItem } from './types'
3+
4+ let ENABLE_SIMPLE_NULL_HANDLING = false
5+
6+ export function enableSimpleNullHandling (
7+ shouldEnableSimpleNullHandling = true
8+ ) {
9+ ENABLE_SIMPLE_NULL_HANDLING = shouldEnableSimpleNullHandling
10+ }
11+
12+ export function isSimpleNullHandlingEnabled ( ) {
13+ return ENABLE_SIMPLE_NULL_HANDLING
14+ }
15+
16+ export const NITRO_SQLITE_NULL : SQLiteNullValue = { isNitroSQLiteNull : true }
17+ export function isNitroSQLiteNull ( value : any ) : value is SQLiteNullValue {
18+ if ( typeof value === 'object' && 'isNitroSQLiteNull' in value ) {
19+ return true
20+ }
21+ return false
22+ }
23+
24+ export function replaceWithNativeNullValue (
25+ value : SQLiteQueryParamItem
26+ ) : SQLiteValue {
27+ if ( value === undefined || value === null ) {
28+ return NITRO_SQLITE_NULL
29+ }
30+ return value
31+ }
You can’t perform that action at this time.
0 commit comments