rubbish-db 0.9.4

http://www.wikihouse.com/winebarrel/index.php?rubbish-db
更新系のメソッドに手を入れました。


#!/usr/bin/env rhino
importPackage(Packages.rubbish.db);

var dbh = new RubbishDatabase();
dbh.logging = true;

dbh.connect("jdbc:hsqldb:hsql://localhost", "sa", "", function(dbh) {
dbh.updateBy("PUBLISHER", "WHERE ID = ?", "01", function(row) {
row.name = "○○書房";
row.volumes=100;
});

dbh.query("SELECT * FROM PUBLISHER", function(row) {
print(row.id + ": " + row.name + "(" + row.volumes + ")");
});

dbh.rollback();

dbh.insertBy("PUBLISHER", function(row) {
row.id="07";
row.name="御来利意書房";
row.volumes=1;
row.update_date="2005-10-10";
row.create_date="2005-40-10";
});

dbh.query("SELECT * FROM PUBLISHER", function(row) {
print(row.id + ": " + row.name);
});

dbh.rollback();
});