ts-redis-orm
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "ts-redis-orm", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A full functional Redis Orm library written in Typescript.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -14,3 +14,11 @@ import {entityExporter} from "./entityExporter"; | ||
// this will init connection | ||
return await metaInstance.getRedis(this); | ||
const redis = await metaInstance.getRedis(this); | ||
// validate the schema | ||
const schemaErrors = await metaInstance.compareSchemas(this); | ||
if (schemaErrors.length) { | ||
throw new RedisOrmSchemaError("Invalid Schemas", schemaErrors); | ||
} | ||
return redis; | ||
} | ||
@@ -17,0 +25,0 @@ |
@@ -79,3 +79,11 @@ import { assert, expect } from "chai"; | ||
// connect will check schemas | ||
try { | ||
await TestingSchema2.connect(); | ||
assert.isTrue(false); | ||
} catch (err) { | ||
assert.isTrue(err instanceof RedisOrmSchemaError); | ||
} | ||
try { | ||
const entity2 = new TestingSchema2(); | ||
@@ -82,0 +90,0 @@ entity2.id = -1; |
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
279996
5410