sqlite added

This commit is contained in:
crusader
2018-09-05 17:18:33 +09:00
parent 4c04ca5132
commit f01ecf72fe
4 changed files with 39 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import { app, Menu, ipcMain, BrowserWindow, shell } from 'electron';
import * as Fs from 'fs';
import * as fse from 'fs-extra';
import * as path from 'path';
import { shellNeedsPatching, updateEnvironmentForProcess } from '@overflow/core/shell';
import { parseAppURL } from '@overflow/core/parse-app-url';
@@ -20,6 +21,8 @@ import { MenuEvent } from '../commons/type';
import { findMenuItemByID } from './menu/find-menu-item';
import { IMenuItemState } from '../commons/model/menu-update';
import * as sqlite3 from 'sqlite3';
enableSourceMaps();
let mainWindow: AppWindow | null = null;
@@ -178,6 +181,15 @@ app.on('ready', () => {
return;
}
const dbPath = path.join(__dirname, '..', '..', '_database.sqlite');
const db = new sqlite3.Database(dbPath, sqlite3.OPEN_READONLY, (err: Error) => {
if (err) {
console.error(err.message);
}
console.log('Connected to the database.');
});
readyTime = now() - launchTime;
// setAsDefaultProtocolClient('x-github-client');