sqlite added
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user