import TauriDatabase from '@tauri-apps/plugin-sql'
import { Kysely, CamelCasePlugin } from 'kysely'
import { TauriDialect } from './kysely'
import { Database } from '@/model'

export const DB = new Kysely<Database>({
  dialect: new TauriDialect({
    database: await TauriDatabase.load('sqlite:store.db'),
  }),
  plugins: [new CamelCasePlugin()],
})
