ueberdb2 4.1.2 → 4.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,24 @@ const Database = class RedisDB extends AbstractDatabase_1.default {
30
30
  }
31
31
  get isAsync() { return true; }
32
32
  async init() {
33
- this._client = (0, redis_1.createClient)({ url: this.settings.url });
33
+ if (this.settings.url) {
34
+ this._client = (0, redis_1.createClient)({ url: this.settings.url });
35
+ }
36
+ else if (this.settings.host) {
37
+ const options = {
38
+ socket: {
39
+ host: this.settings.host,
40
+ port: Number(this.settings.port),
41
+ }
42
+ };
43
+ if (this.settings.password) {
44
+ options.password = this.settings.password;
45
+ }
46
+ if (this.settings.user) {
47
+ options.username = this.settings.user;
48
+ }
49
+ this._client = (0, redis_1.createClient)(options);
50
+ }
34
51
  if (this._client) {
35
52
  await this._client.connect();
36
53
  await this._client.ping();
@@ -42,7 +42,9 @@ exports.databases = {
42
42
  setMax: 6,
43
43
  },
44
44
  },
45
- redis: {},
45
+ redis: {
46
+ url: 'redis://localhost/'
47
+ },
46
48
  mongodb: {
47
49
  url: 'mongodb://127.0.0.1:27017',
48
50
  database: 'mydb_test',
package/dist/test/test.js CHANGED
@@ -77,7 +77,7 @@ describe(__filename, () => {
77
77
  after(async () => {
78
78
  console.log(speedTable.toString());
79
79
  });
80
- Object.keys(databases).filter((v) => v === "sqlite")
80
+ Object.keys(databases)
81
81
  .forEach((database) => {
82
82
  // @ts-ignore
83
83
  const dbSettings = databases[database];
package/package.json CHANGED
@@ -63,7 +63,7 @@
63
63
  "url": "https://github.com/ether/ueberDB.git"
64
64
  },
65
65
  "main": "./dist/index",
66
- "version": "4.1.2",
66
+ "version": "4.1.4",
67
67
  "bugs": {
68
68
  "url": "https://github.com/ether/ueberDB/issues"
69
69
  },
@@ -77,8 +77,7 @@
77
77
  "test": "tsc && mocha ./dist/test/test*.js",
78
78
  "test:watch": "mocha ./dist/test/test*.js --watch",
79
79
  "test-debug": "tsc && mocha --inspect-brk ./dist/test/test*.js",
80
- "build": "tsc",
81
- "publish": "npm run build && npm publish"
80
+ "build": "tsc"
82
81
  },
83
82
  "_npmUser": {
84
83
  "name": "johnyma22",