node-dbmonNode.js 數(shù)據(jù)庫實時監(jiān)控庫
node-dbmon 是一個 Node.js 數(shù)據(jù)庫實時監(jiān)控庫,如果你希望在數(shù)據(jù)庫表數(shù)據(jù)更改后,或者是文件修改后能更新 GUI,那么這個庫正好適合你。
示例代碼:
var pg=require('pg'), cli=new pg.Client('tcp://postgres@localhost/template1'), dbmon=require('dbmon');
cli.connect();
//uncomment if you want node to create the temporary table for you
//cli.query('drop table if exists testtable; create table testtable(id integer primary key, val varchar(10));');
var channel=dbmon.channel({
driver:'postgresql',
driverOpts:{
postgresql:{
cli:cli
}
},
table:'testtable',
monitor:'all',
keyfld:{
name:'id',type:'integer'
}
});
評論
圖片
表情
