Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

djorm

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

djorm - npm Package Compare versions

Comparing version 0.1.15-alpha.0 to 0.1.16-alpha.0

8

db/__tests__/Database.js

@@ -7,3 +7,6 @@ const { Database } = require('../Database')

disconnectDb = jest.fn()
queryDb = jest.fn()
queryDb = jest.fn().mockImplementation(async function (query) {
return await this.runDatabaseOperation(() => {})
})
execDb = jest.fn()

@@ -25,3 +28,2 @@ }

)
db.queryDb.mockResolvedValue()
const promise = db.query('SELECT FUN FROM TESTS')

@@ -38,3 +40,2 @@ expect(db.connectDb).toHaveBeenCalled()

)
db.queryDb.mockResolvedValue()
const connectPromise = db.connect()

@@ -52,3 +53,2 @@ db.query('SELECT FUN FROM TESTS')

})
db.queryDb.mockResolvedValue()
const connectPromise = db.connect()

@@ -55,0 +55,0 @@ const queryPromise = db.query('SELECT FUN FROM TESTS')

@@ -90,3 +90,6 @@ const { DatabaseMapper } = require('./DatabaseMapper')

try {
return await op()
await this.waitForConnection()
const result = await op()
this.planDisconnect()
return result
} catch (e) {

@@ -110,2 +113,3 @@ const ErrorType = this.resolveErrorType(e)

async waitForConnection () {
this.cancelDisconnectPlan()
if (!this.connected) {

@@ -123,15 +127,9 @@ if (this.connecting) {

async query (str) {
await this.waitForConnection()
debug(str)
const res = await this.queryDb(str)
this.planDisconnect()
return res
return await this.queryDb(str)
}
async exec (str) {
await this.waitForConnection()
debug(str)
const res = await this.execDb(str)
this.planDisconnect()
return res
return await this.execDb(str)
}

@@ -138,0 +136,0 @@

@@ -9,3 +9,5 @@ const { Database } = require('./Database')

if (db instanceof Database) {
this.databases[dbName] = db
if (!this.databases[dbName]) {
this.databases[dbName] = db
}
} else {

@@ -12,0 +14,0 @@ throw new DatabaseError(

{
"name": "djorm",
"version": "0.1.15-alpha.0",
"version": "0.1.16-alpha.0",
"description": "Django like ORM framework",

@@ -39,3 +39,3 @@ "author": "Pavel Žák <pavel@zak.global>",

},
"gitHead": "37b93ad465b7b9b4f1fc092fbd586271b510e79b"
"gitHead": "9f2773dff72ecec64ee091b66e69f439c0a3da7a"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc