Einkaufslisten anzeigen, Datenbankeinbindung
This commit is contained in:
1
express-server/node_modules/postgresql/.npmignore
generated
vendored
Normal file
1
express-server/node_modules/postgresql/.npmignore
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
node_modules
|
22
express-server/node_modules/postgresql/LICENSE
generated
vendored
Normal file
22
express-server/node_modules/postgresql/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2014 Tyler Kellen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
4
express-server/node_modules/postgresql/README.md
generated
vendored
Normal file
4
express-server/node_modules/postgresql/README.md
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# postgresql
|
||||
> An NPM wrapper for PostgreSQL.
|
||||
|
||||
WIP.
|
44
express-server/node_modules/postgresql/index.js
generated
vendored
Normal file
44
express-server/node_modules/postgresql/index.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
const path = require('path');
|
||||
const mkdirp = require('mkdirp');
|
||||
const emptyDir = require('empty-dir');
|
||||
const spawn = require('child_process').spawn;
|
||||
|
||||
exports.initdb = function (dbPath, callback) {
|
||||
var opts = {};
|
||||
if (arguments.length === 3) {
|
||||
opts = arguments[1];
|
||||
callback = arguments[2];
|
||||
}
|
||||
if (!dbPath) {
|
||||
throw new Error('You must specify a directory to initialize.');
|
||||
}
|
||||
var dir = path.resolve(dbPath);
|
||||
mkdirp.sync(dir);
|
||||
if (!emptyDir.sync(dir)) {
|
||||
throw new Error('Refusing to init in non-empty directory.');
|
||||
}
|
||||
var init = spawn('./pgsql/bin/initdb', ['-D', dir]);
|
||||
if (opts.verbose === true) {
|
||||
init.stdout.on('data', function (data) {
|
||||
process.stdout.write(data);
|
||||
});
|
||||
init.stderr.on('data', function (data) {
|
||||
process.stderr.write(data.toString());
|
||||
});
|
||||
}
|
||||
init.on('close', function (code) {
|
||||
callback(code);
|
||||
});
|
||||
};
|
||||
|
||||
exports.start = function (dbPath, opts) {
|
||||
opts = opts || {};
|
||||
var dir = path.resolve(dbPath);
|
||||
var start = spawn('./pgsql/bin/postgres', ['-D', dir]);
|
||||
start.stdout.on('data', function (data) {
|
||||
process.stdout.write(data);
|
||||
});
|
||||
start.stderr.on('data', function (data) {
|
||||
process.stderr.write(data.toString());
|
||||
});
|
||||
};
|
1
express-server/node_modules/postgresql/install.js
generated
vendored
Normal file
1
express-server/node_modules/postgresql/install.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
console.log('Binary installer not implemented.')
|
71
express-server/node_modules/postgresql/package.json
generated
vendored
Normal file
71
express-server/node_modules/postgresql/package.json
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"_from": "postgresql",
|
||||
"_id": "postgresql@0.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-8HwXnZN+DFTuc1oV6y5GKxlnq3A=",
|
||||
"_location": "/postgresql",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "postgresql",
|
||||
"name": "postgresql",
|
||||
"escapedName": "postgresql",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postgresql/-/postgresql-0.0.1.tgz",
|
||||
"_shasum": "f07c179d937e0c54ee735a15eb2e462b1967ab70",
|
||||
"_spec": "postgresql",
|
||||
"_where": "D:\\5CHITM\\Diplomarbeit\\smart-shopper\\SmartShopper\\express-server",
|
||||
"author": {
|
||||
"name": "Tyler Kellen",
|
||||
"url": "http://goingslowly.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/tkellen/node-postgresql/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"empty-dir": "^0.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "An NPM wrapper for PostgreSQL.",
|
||||
"devDependencies": {
|
||||
"chai": "^1.9.1",
|
||||
"mkdirp": "^0.5.0",
|
||||
"mocha": "^1.18.2",
|
||||
"rimraf": "^2.2.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"homepage": "https://github.com/tkellen/node-postgresql",
|
||||
"keywords": [
|
||||
"postgresql",
|
||||
"postgres",
|
||||
"pgsql"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/tkellen/node-postgresql/blob/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"main": "index.js",
|
||||
"name": "postgresql",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/tkellen/node-postgresql.git"
|
||||
},
|
||||
"scripts": {
|
||||
"install": "node install.js",
|
||||
"test": "mocha -R spec test/"
|
||||
},
|
||||
"version": "0.0.1"
|
||||
}
|
20
express-server/node_modules/postgresql/test/index.js
generated
vendored
Normal file
20
express-server/node_modules/postgresql/test/index.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
const postgresql = require('../');
|
||||
const expect = require('chai').expect;
|
||||
const rimraf = require('rimraf');
|
||||
|
||||
rimraf.sync('./tmp');
|
||||
|
||||
describe('init', function () {
|
||||
this.timeout(5000);
|
||||
it('should refuse to init a directory that is not empty', function () {
|
||||
expect(function() {
|
||||
postgresql.initdb('./');
|
||||
}).to.throw;
|
||||
});
|
||||
|
||||
it('should init a database directory', function (done) {
|
||||
postgresql.initdb('./tmp', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user