美文网首页
【pouchdb-可视化工具 】

【pouchdb-可视化工具 】

作者: wn777 | 来源:发表于2024-05-13 00:55 被阅读0次

最近使用pouchdb,想找个其对应的可视化工具,可以对数据库进行操作。

找了好久才找到,网上有说先同步到couchdb,再用couchdb的可视化工具查看,其实没有那么麻烦,pouchdb的可视化工具其实藏在另外的pouchdb-server项目中。
最开始走了弯路了,这里记录也和大家分享下 。

pouchdb

先插入一条数据

import PouchDB from 'pouchdb';
import process from 'process';

let prefix = ${Your_DB_Path};
let db = new PouchDB(`${prefix}/account`, {adapter: 'leveldb'});

db.post({
    name: "John Doe",
}).then(function (response) {
    // handle response
    console.log(response);
}).catch(function (err) {
    console.log(err);
});

可视化查看

安装 pouchdb-server

npm install -g pouchdb-server

启动

npx pouchdb-server --dir ${Your_DB_Path}

访问:http://127.0.0.1:5984/_utils/#/_all_dbs
可以看到刚刚创建的数据库 ,

数据库

点进去还可以找到刚刚插入的数据


数据

点进去,可以进行数据修改。

数据详情

标签:#gui , #可视化工具, #pouchdb, #pouchdb-server

相关文章

网友评论

      本文标题:【pouchdb-可视化工具 】

      本文链接:https://www.haomeiwen.com/subject/ixxpfjtx.html