Skip to content

Commit

Permalink
feat: expo sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Sep 30, 2023
1 parent 6de575f commit be5b722
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/@config/database/index.ts
Original file line number Diff line number Diff line change
@@ -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',
};

Expand Down

0 comments on commit be5b722

Please sign in to comment.