zerohelper-redis-adapter 11.0.0
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.
- package/README.md +54 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +125 -0
- package/dist/index.js.map +1 -0
- package/package.json +16 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# zerohelper-redis-adapter
|
|
2
|
+
|
|
3
|
+
Redis database adapter and cache wrapper for ZeroHelper.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install zerohelper-redis-adapter
|
|
9
|
+
npm install redis
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { createDatabase } from '@onurege3467/zerohelper';
|
|
16
|
+
|
|
17
|
+
// As primary database
|
|
18
|
+
const db = createDatabase({
|
|
19
|
+
adapter: 'redis',
|
|
20
|
+
config: { url: 'redis://localhost:6379' }
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
await db.set('user:1', { name: 'John' });
|
|
24
|
+
const user = await db.get('user:1');
|
|
25
|
+
|
|
26
|
+
// With cache wrapper
|
|
27
|
+
const cachedDb = createDatabase({
|
|
28
|
+
adapter: 'postgres',
|
|
29
|
+
config: { /* postgres config */ },
|
|
30
|
+
cache: {
|
|
31
|
+
type: 'redis',
|
|
32
|
+
url: 'redis://localhost:6379',
|
|
33
|
+
ttl: 3600
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
- Full Redis command support
|
|
41
|
+
- Cache wrapper for any database
|
|
42
|
+
- TTL (Time To Live) support
|
|
43
|
+
- Pub/Sub ready
|
|
44
|
+
- Connection pooling
|
|
45
|
+
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
| Option | Type | Required | Description |
|
|
49
|
+
|--------|------|----------|-------------|
|
|
50
|
+
| `url` | string | Yes | Redis connection URL |
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
ISC
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IDatabase, RedisConfig } from '@onurege3467/zerohelper-core';
|
|
2
|
+
export declare class RedisDatabase extends IDatabase {
|
|
3
|
+
private config;
|
|
4
|
+
private client;
|
|
5
|
+
private keyPrefix;
|
|
6
|
+
private _isReady;
|
|
7
|
+
private _connectionPromise;
|
|
8
|
+
constructor(config: RedisConfig);
|
|
9
|
+
private _ensureConnection;
|
|
10
|
+
private _getKey;
|
|
11
|
+
private _getTableKey;
|
|
12
|
+
select<T = any>(table: string, where?: Record<string, any>): Promise<T[]>;
|
|
13
|
+
selectOne<T = any>(table: string, where?: Record<string, any>): Promise<T | null>;
|
|
14
|
+
insert(table: string, data: Record<string, any>): Promise<any>;
|
|
15
|
+
update(table: string, data: Record<string, any>, where: Record<string, any>): Promise<number>;
|
|
16
|
+
delete(table: string, where: Record<string, any>): Promise<number>;
|
|
17
|
+
set(table: string, data: Record<string, any>, where: Record<string, any>): Promise<any>;
|
|
18
|
+
bulkInsert(table: string, dataArray: Record<string, any>[]): Promise<number>;
|
|
19
|
+
increment(table: string, incs: Record<string, number>, where?: Record<string, any>): Promise<number>;
|
|
20
|
+
decrement(table: string, decs: Record<string, number>, where?: Record<string, any>): Promise<number>;
|
|
21
|
+
close(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export declare function createDatabase(config: RedisConfig): RedisDatabase;
|
|
24
|
+
export default RedisDatabase;
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,8BA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EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAK5E,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYxG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMxG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO7B;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,CAEjE;AACD,eAAe,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisDatabase = void 0;
|
|
4
|
+
exports.createDatabase = createDatabase;
|
|
5
|
+
const zerohelper_core_1 = require("@onurege3467/zerohelper-core");
|
|
6
|
+
const redis_1 = require("redis");
|
|
7
|
+
class RedisDatabase extends zerohelper_core_1.IDatabase {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
super();
|
|
10
|
+
this.config = config;
|
|
11
|
+
this.client = null;
|
|
12
|
+
this._isReady = false;
|
|
13
|
+
this._connectionPromise = null;
|
|
14
|
+
this.keyPrefix = config.keyPrefix || 'app:';
|
|
15
|
+
this._ensureConnection();
|
|
16
|
+
}
|
|
17
|
+
async _ensureConnection() {
|
|
18
|
+
if (this._connectionPromise)
|
|
19
|
+
return this._connectionPromise;
|
|
20
|
+
this._connectionPromise = (async () => {
|
|
21
|
+
try {
|
|
22
|
+
this.client = (0, redis_1.createClient)({
|
|
23
|
+
url: this.config.url,
|
|
24
|
+
socket: {
|
|
25
|
+
host: this.config.host || '127.0.0.1',
|
|
26
|
+
port: this.config.port || 6379,
|
|
27
|
+
connectTimeout: 5000
|
|
28
|
+
},
|
|
29
|
+
password: this.config.password,
|
|
30
|
+
});
|
|
31
|
+
await this.client.connect();
|
|
32
|
+
this._isReady = true;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this._isReady = false;
|
|
36
|
+
}
|
|
37
|
+
})();
|
|
38
|
+
return this._connectionPromise;
|
|
39
|
+
}
|
|
40
|
+
_getKey(table, id) { return `${this.keyPrefix}${table}:${id}`; }
|
|
41
|
+
_getTableKey(table) { return `${this.keyPrefix}${table}:*`; }
|
|
42
|
+
async select(table, where = {}) {
|
|
43
|
+
await this._ensureConnection();
|
|
44
|
+
const keys = await this.client.keys(this._getTableKey(table));
|
|
45
|
+
if (!keys.length)
|
|
46
|
+
return [];
|
|
47
|
+
const vals = await this.client.mGet(keys);
|
|
48
|
+
return vals.map(v => v ? JSON.parse(v) : null).filter(Boolean)
|
|
49
|
+
.filter(item => Object.entries(where).every(([k, v]) => String(item[k]) === String(v)));
|
|
50
|
+
}
|
|
51
|
+
async selectOne(table, where = {}) {
|
|
52
|
+
const res = await this.select(table, where);
|
|
53
|
+
return res[0] || null;
|
|
54
|
+
}
|
|
55
|
+
async insert(table, data) {
|
|
56
|
+
await this._ensureConnection();
|
|
57
|
+
await this.runHooks('beforeInsert', table, data);
|
|
58
|
+
const d = { ...data };
|
|
59
|
+
if (!d._id && !d.id)
|
|
60
|
+
d._id = Date.now().toString() + Math.random().toString(36).slice(2, 9);
|
|
61
|
+
const id = String(d._id || d.id);
|
|
62
|
+
await this.client.set(this._getKey(table, id), JSON.stringify(d));
|
|
63
|
+
await this.runHooks('afterInsert', table, d);
|
|
64
|
+
return d._id || d.id;
|
|
65
|
+
}
|
|
66
|
+
async update(table, data, where) {
|
|
67
|
+
await this._ensureConnection();
|
|
68
|
+
await this.runHooks('beforeUpdate', table, { data, where });
|
|
69
|
+
const existing = await this.select(table, where);
|
|
70
|
+
for (const item of existing) {
|
|
71
|
+
const merged = { ...item, ...data };
|
|
72
|
+
await this.client.set(this._getKey(table, String(item._id || item.id)), JSON.stringify(merged));
|
|
73
|
+
}
|
|
74
|
+
return existing.length;
|
|
75
|
+
}
|
|
76
|
+
async delete(table, where) {
|
|
77
|
+
await this._ensureConnection();
|
|
78
|
+
await this.runHooks('beforeDelete', table, where);
|
|
79
|
+
const existing = await this.select(table, where);
|
|
80
|
+
if (existing.length) {
|
|
81
|
+
const keys = existing.map(i => this._getKey(table, String(i._id || i.id)));
|
|
82
|
+
await this.client.del(keys);
|
|
83
|
+
}
|
|
84
|
+
return existing.length;
|
|
85
|
+
}
|
|
86
|
+
async set(table, data, where) {
|
|
87
|
+
const ex = await this.selectOne(table, where);
|
|
88
|
+
return ex ? this.update(table, data, where) : this.insert(table, { ...data, ...where });
|
|
89
|
+
}
|
|
90
|
+
async bulkInsert(table, dataArray) {
|
|
91
|
+
for (const d of dataArray)
|
|
92
|
+
await this.insert(table, d);
|
|
93
|
+
return dataArray.length;
|
|
94
|
+
}
|
|
95
|
+
async increment(table, incs, where = {}) {
|
|
96
|
+
await this._ensureConnection();
|
|
97
|
+
const recs = await this.select(table, where);
|
|
98
|
+
for (const r of recs) {
|
|
99
|
+
const id = String(r._id || r.id);
|
|
100
|
+
const key = this._getKey(table, id);
|
|
101
|
+
const lua = `local val = redis.call('get', KEYS[1]) if not val then return 0 end local data = cjson.decode(val) local incs = cjson.decode(ARGV[1]) for k, v in pairs(incs) do data[k] = (tonumber(data[k]) or 0) + v end redis.call('set', KEYS[1], cjson.encode(data)) return 1`;
|
|
102
|
+
await this.client.eval(lua, { keys: [key], arguments: [JSON.stringify(incs)] });
|
|
103
|
+
}
|
|
104
|
+
return recs.length;
|
|
105
|
+
}
|
|
106
|
+
async decrement(table, decs, where = {}) {
|
|
107
|
+
const incs = {};
|
|
108
|
+
for (const k in decs)
|
|
109
|
+
incs[k] = -decs[k];
|
|
110
|
+
return this.increment(table, incs, where);
|
|
111
|
+
}
|
|
112
|
+
async close() {
|
|
113
|
+
if (this.client) {
|
|
114
|
+
await this.client.quit();
|
|
115
|
+
this.client = null;
|
|
116
|
+
this._isReady = false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.RedisDatabase = RedisDatabase;
|
|
121
|
+
function createDatabase(config) {
|
|
122
|
+
return new RedisDatabase(config);
|
|
123
|
+
}
|
|
124
|
+
exports.default = RedisDatabase;
|
|
125
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AA4HA,wCAEC;AA9HD,kEAAsE;AACtE,iCAAsD;AAEtD,MAAa,aAAc,SAAQ,2BAAS;IAM1C,YAAoB,MAAmB;QACrC,KAAK,EAAE,CAAC;QADU,WAAM,GAAN,MAAM,CAAa;QAL/B,WAAM,GAA2B,IAAI,CAAC;QAEtC,aAAQ,GAAY,KAAK,CAAC;QAC1B,uBAAkB,GAAyB,IAAI,CAAC;QAItD,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC;QAC5C,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAEO,KAAK,CAAC,iBAAiB;QAC7B,IAAI,IAAI,CAAC,kBAAkB;YAAE,OAAO,IAAI,CAAC,kBAAkB,CAAC;QAC5D,IAAI,CAAC,kBAAkB,GAAG,CAAC,KAAK,IAAI,EAAE;YACpC,IAAI,CAAC;gBACH,IAAI,CAAC,MAAM,GAAG,IAAA,oBAAY,EAAC;oBACzB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG;oBACpB,MAAM,EAAE;wBACN,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,WAAW;wBACrC,IAAI,EAAE,IAAI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,CAAC,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,KAAa,EAAE,IAA4B,EAAE,QAA6B,EAAE;QAC1F,MAAM,IAAI,GAAQ,EAAE,CAAC;QACrB,KAAK,MAAM,CAAC,IAAI,IAAI;YAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACxB,CAAC;IACH,CAAC;CACF;AAvHD,sCAuHC;AAED,SAAgB,cAAc,CAAC,MAAmB;IAChD,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AACD,kBAAe,aAAa,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zerohelper-redis-adapter",
|
|
3
|
+
"version": "11.0.0",
|
|
4
|
+
"description": "Redis adapter for ZeroHelper",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": { "build": "tsc", "clean": "rm -rf dist" },
|
|
8
|
+
"keywords": ["zerohelper", "database", "redis", "adapter"],
|
|
9
|
+
"author": "Onure9e",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"dependencies": { "redis": "^4.7.0" },
|
|
12
|
+
"peerDependencies": { "@onurege3467/zerohelper-core": "^11.0.0" },
|
|
13
|
+
"devDependencies": { "@types/node": "^22.10.2", "typescript": "^5.7.2" },
|
|
14
|
+
"files": ["dist", "README.md"],
|
|
15
|
+
"publishConfig": { "access": "public" }
|
|
16
|
+
}
|