ts-redis-orm
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "ts-redis-orm", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A full functional Redis Orm library written in Typescript.", | ||
@@ -21,18 +21,15 @@ "main": "build/index.js", | ||
}, | ||
"bin": { | ||
"ts-redis-orm": "./build/cli.js" | ||
}, | ||
"dependencies": { | ||
"ioredis": "^4.14.0", | ||
"reflect-metadata":"^0.1.13" | ||
"ioredis": "^4.14.1", | ||
"reflect-metadata": "^0.1.13" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.2.0", | ||
"@types/chai": "^4.2.3", | ||
"@types/ioredis": "^4.0.18", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^12.7.1", | ||
"@types/ioredis": "^4.0.15", | ||
"@types/node": "^12.7.8", | ||
"chai": "^4.2.0", | ||
"mocha": "^6.2.0", | ||
"ts-node": "^8.3.0", | ||
"typescript": "^3.5.3" | ||
"ts-node": "^8.4.1", | ||
"typescript": "^3.6.3" | ||
}, | ||
@@ -44,4 +41,11 @@ "repository": { | ||
"author": "Terence", | ||
"keywords": ["redis", "redis orm", "sorted set", "ioredis", "relational db", "typescript"], | ||
"keywords": [ | ||
"redis", | ||
"redis orm", | ||
"sorted set", | ||
"ioredis", | ||
"relational db", | ||
"typescript" | ||
], | ||
"license": "MIT License" | ||
} |
@@ -12,3 +12,3 @@ # Redis ORM (Typescript) | ||
This package is mainly built on top of [ioredis](https://github.com/luin/ioredis). | ||
This package is mainly built on top of [ioredis](https://github.com/luin/ioredis) and tested with Redis 3, 4 and 5. | ||
@@ -15,0 +15,0 @@ # Features |
@@ -433,2 +433,3 @@ import {entityExporter} from "./entityExporter"; | ||
const params = [ | ||
metaInstance.getSchemasJson(this.constructor), | ||
entityId, | ||
@@ -435,0 +436,0 @@ !forceDelete, |
@@ -319,2 +319,47 @@ import {assert, expect } from "chai"; | ||
it("save an deleted entity", async () => { | ||
const id = 21; | ||
const entity = TestingGeneral.create({id, uniqueNumber: id, number: id}); | ||
await entity.save(); | ||
const newEntity = await TestingGeneral.find(id); | ||
assert.isDefined(newEntity); | ||
// delete entity | ||
if (newEntity) { | ||
await newEntity.delete(); | ||
assert.isTrue(newEntity.isDeleted); | ||
} | ||
// save an deleted entity | ||
try { | ||
entity.string2 = "happy"; | ||
await entity.save(); | ||
assert.isTrue(false); | ||
} catch (err) { | ||
assert.equal(err.message, `Entity not exist or deleted. Entity Id: ${entity.getEntityId()}`); | ||
} | ||
// delete an deleted entity | ||
try { | ||
await entity.delete(); | ||
assert.isTrue(false); | ||
} catch (err) { | ||
assert.equal(err.message, `Entity already deleted. Entity Id: ${entity.getEntityId()}`); | ||
} | ||
// force delete the entity | ||
if (newEntity) { | ||
await newEntity.forceDelete(); | ||
} | ||
// delete an force deleted entity | ||
try { | ||
await entity.delete(); | ||
assert.isTrue(false); | ||
} catch (err) { | ||
assert.equal(err.message, `Entity not exist. Entity Id: ${entity.getEntityId()}`); | ||
} | ||
}); | ||
it("create entity: massive create", async () => { | ||
@@ -321,0 +366,0 @@ const totalEntity = 100; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
277478
5359
Updatedioredis@^4.14.1