import { ipcMain } from 'electron';
import { runQuery, getQuery, allQuery } from '../database';

ipcMain.handle('db:run', async (_, query: string, params: any[]) => {
	await runQuery(query, params);
});

ipcMain.handle('db:get', async (_, query: string, params: any[]) => {
	return await getQuery(query, params);
});

ipcMain.handle('db:all', async (_, query: string, params: any[]) => {
	return await allQuery(query, params);
});