import type { ConnectionOptions } from 'typeorm' ; import { isDev , isTest } from '@/common/utils' ; import path from 'path' ; import { User } from '@/models' ; import { app } from 'electron' ; const entities = [ User ] ; const storagePath = app . getPath ( 'userData' ) ; const connectConfig = { type : 'sqlite' , entities , database : isTest ? ':memory:' : path . join ( storagePath , 'database' , `${ isDev ? 'umi-electron-template' : 'db' }.sqlite` ) , } ; export default connectConfig ;