当前位置:网站首页>Electron adding SQLite database
Electron adding SQLite database
2022-07-07 11:18:00 【InfoQ】
order
electronelectronSQLitemongodbpassSQLite
- https://xie.infoq.cn/article/6c7094a919d33144f50cdc6d9《vue Tomato clock &electron pack 》
- 《Node の MongoDB Driver》
- 《node の SQLite》
Development
sqliteDB.jstomato.dbtomatoTablerunSQL(`
create table tomatoTable
(
name text not null,
creatTime text not null,
duringTime int not null,
startFlag boolean not null,
bgSrc text not null,
taskEndCount int not null,
taskId text not null
);
`)ipcMainipcRenderersqlitedb.allpromise// Query tomato clock data
function getTomatoData() {
db = new sqlite3.Database(rootPath);
return new Promise((reslove)=>{
db.all('select * from tomatoTable', (err, data)=>{
reslove(data);
});
})
}
JSON.parse
// Insert new data into the tomato clock
function insertNewInfo(d) {
let insertInfo = db.prepare('insert into tomatoTable (name, creatTime, duringTime, startFlag, bgSrc, taskEndCount, taskId) values (?, ?, ?, ?, ?, ?, ?)')
insertInfo.run(d.name, d.creatTime, d.duringTime, d.startFlag, d.bgSrc, d.taskEndCount, d.taskId );
insertInfo.finalize();
}
// Delete data from tomato clock
function deleteNewInfo(taskId) {
let del = db.prepare("delete from tomatoTable where taskId = ? ");
del.run(taskId);
del.finalize();
}
// Modify tomato clock task completion times
function updateTaskEndCount(arg) {
let update = db.prepare('update tomatoTable set taskEndCount = ? where taskId = ?');
update.run(arg.taskEndCount, arg.taskId);
update.finalize();
}
-- SQLite
select * from tomatoTable

tomato.db边栏推荐
- 互联网协议
- RationalDMIS2022阵列工件测量
- Apprentissage comparatif non supervisé des caractéristiques visuelles par les assignations de groupes de contrôle
- 学习笔记|数据小白使用DataEase制作数据大屏
- [untitled]
- 【时间格式工具函数的封装】
- Verilog realizes nixie tube display driver [with source code]
- CentOS系统下Redis安装和自启动配置的步骤
- Unsupervised learning of visual features by contracting cluster assignments
- RationalDMIS2022 高级编程宏程序
猜你喜欢

Learning notes | data Xiaobai uses dataease to make a large data screen

RationalDMIS2022 高级编程宏程序
![[untitled]](/img/15/3db921703147afdf58dfffe532a19b.jpg)
[untitled]

Antd select selector drop-down box follows the scroll bar to scroll through the solution

Leetcode - interview question 17.24 maximum submatrix

The opacity value becomes 1%

对比学习之 Unsupervised Learning of Visual Features by Contrasting Cluster Assignments

高考作文,高频提及科技那些事儿……

IDEA快捷键大全

shardingsphere分库分表示例(逻辑表,真实表,绑定表,广播表,单表)
随机推荐
electron添加SQLite数据库
2021-05-21
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
對比學習之 Unsupervised Learning of Visual Features by Contrasting Cluster Assignments
How to use cherry pick?
Interprocess communication (IPC)
Verilog design responder [with source code]
Wallhaven壁纸桌面版
简单介绍一下闭包及它的一些应用场景
LeetCode - 面试题17.24 最大子矩阵
自动化测试框架
Multithreaded application (thread pool, singleton mode)
基于Retrofit框架的金山API翻译功能案例
From pornographic live broadcast to live broadcast E-commerce
RationalDMIS2022 高级编程宏程序
'module 'object is not callable error
Activity生命周期
基于STC8G1K08的0.96寸IIC液晶屏驱动程序
科普达人丨一文弄懂什么是云计算?
MIF file format record