From be5b72268f017ac1ca21415ff79e3b5306e5a8e6 Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Sat, 30 Sep 2023 02:06:38 +0200 Subject: [PATCH] feat: expo sqlite --- src/@config/database/index.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/@config/database/index.ts b/src/@config/database/index.ts index ca90ade6..2cbf0098 100644 --- a/src/@config/database/index.ts +++ b/src/@config/database/index.ts @@ -1,23 +1,21 @@ import {DataStoreContactEntities, DataStoreIssuanceBrandingEntities, DataStoreMigrations} from '@sphereon/ssi-sdk.data-store'; import {Entities as VeramoDataStoreEntities, migrations as VeramoDataStoreMigrations} from '@veramo/data-store'; -// import * as driver from 'react-native-sqlite-storage'; +import * as driver from 'expo-sqlite'; import {ExpoConnectionOptions} from 'typeorm/driver/expo/ExpoConnectionOptions'; -import {ReactNativeConnectionOptions} from 'typeorm/driver/react-native/ReactNativeConnectionOptions'; const DB_CONNECTION_NAME = 'default'; const DB_ENCRYPTION_KEY = '29739248cad1bd1a0fc4d9b75cd4d2990de535baf5caadfdf8d8f86664aa830c'; -const sqliteConfig: ReactNativeConnectionOptions = { - type: 'react-native', - location: 'default', +const sqliteConfig: ExpoConnectionOptions = { + type: 'expo', database: 'sphereon-wallet.sqlite', - // driver, + driver, entities: [...VeramoDataStoreEntities, ...DataStoreContactEntities, ...DataStoreIssuanceBrandingEntities], migrations: [...VeramoDataStoreMigrations, ...DataStoreMigrations], migrationsRun: false, // We run migrations from code to ensure proper ordering with Redux synchronize: false, // We do not enable synchronize, as we use migrations from code migrationsTransactionMode: 'each', // protect every migration with a separate transaction - logging: ['error'], // 'all' means to enable all logging + logging: 'all', // 'all' means to enable all logging logger: 'advanced-console', };