3 changed files with 89 additions and 1 deletions
@ -0,0 +1,42 @@ |
|||||||
|
{ |
||||||
|
"version": "0.1.0", |
||||||
|
// List of configurations. Add new configurations or edit existing ones. |
||||||
|
// ONLY "node" and "mono" are supported, change "type" to switch. |
||||||
|
"configurations": [ |
||||||
|
{ |
||||||
|
// Name of configuration; appears in the launch configuration drop down menu. |
||||||
|
"name": "Launch storage.js", |
||||||
|
// Type of configuration. Possible values: "node", "mono". |
||||||
|
"type": "node", |
||||||
|
// Workspace relative or absolute path to the program. |
||||||
|
"program": "bin/storage.js", |
||||||
|
// Automatically stop program after launch. |
||||||
|
"stopOnEntry": false, |
||||||
|
// Command line arguments passed to the program. |
||||||
|
"args": [], |
||||||
|
// Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace. |
||||||
|
"cwd": ".", |
||||||
|
// Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH. |
||||||
|
"runtimeExecutable": null, |
||||||
|
// Optional arguments passed to the runtime executable. |
||||||
|
"runtimeArgs": ["--nolazy"], |
||||||
|
// Environment variables passed to the program. |
||||||
|
"env": { |
||||||
|
"NODE_ENV": "development" |
||||||
|
}, |
||||||
|
// Use JavaScript source maps (if they exist). |
||||||
|
"sourceMaps": false, |
||||||
|
// If JavaScript source maps are enabled, the generated code is expected in this directory. |
||||||
|
"outDir": null |
||||||
|
}, |
||||||
|
{ |
||||||
|
"name": "Attach", |
||||||
|
"type": "node", |
||||||
|
// TCP/IP address. Default is "localhost". |
||||||
|
"address": "localhost", |
||||||
|
// Port to attach to. |
||||||
|
"port": 5858, |
||||||
|
"sourceMaps": false |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
@ -0,0 +1,44 @@ |
|||||||
|
var redis = require("redis"), |
||||||
|
client = redis.createClient({ |
||||||
|
return_buffers: true, |
||||||
|
detect_buffers: false |
||||||
|
}); |
||||||
|
|
||||||
|
var zlib = require('zlib'); |
||||||
|
|
||||||
|
var Sequelize = require('sequelize'); |
||||||
|
var sequelize = new Sequelize('database', null, null, { |
||||||
|
dialect: 'sqlite', |
||||||
|
pool: { |
||||||
|
max: 5, |
||||||
|
min: 0, |
||||||
|
idle: 10000 |
||||||
|
}, |
||||||
|
storage: 'database.sqlite' |
||||||
|
}); |
||||||
|
|
||||||
|
client.hget("note", "2015/7/12/hom", function (err, B) { |
||||||
|
debugger |
||||||
|
console.log("to unpack:", B.toString("base64")); |
||||||
|
var R = zlib.gunzipSync(B); |
||||||
|
console.log(R); |
||||||
|
}); |
||||||
|
|
||||||
|
/* |
||||||
|
var User = sequelize.define('User', { |
||||||
|
username: Sequelize.STRING, |
||||||
|
birthday: Sequelize.DATE |
||||||
|
}); |
||||||
|
|
||||||
|
sequelize.sync().then(function() { |
||||||
|
return User.create({ |
||||||
|
username: 'janedoe', |
||||||
|
birthday: new Date(1980, 6, 20) |
||||||
|
}); |
||||||
|
}).then(function(jane) { |
||||||
|
console.log(jane.get({ |
||||||
|
plain: true |
||||||
|
})) |
||||||
|
}); |
||||||
|
|
||||||
|
*/ |
||||||
Loading…
Reference in new issue