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

@mrnafisia/type-query

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mrnafisia/type-query - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

dist/pool.d.ts

@@ -1,5 +0,7 @@

import type { Pool } from './types/pool';
import type { AddHook, Pool, RemoveHook } from './types/pool';
declare const addHook: AddHook;
declare const removeHook: RemoveHook;
declare const createPool: (connectionString: string) => Pool;
export { Pool };
export { addHook, removeHook };
export default createPool;
//# sourceMappingURL=pool.d.ts.map

@@ -39,4 +39,30 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.removeHook = exports.addHook = void 0;
var pg_1 = require("pg");
var dictionary_1 = require("./dictionary");
var submit = pg_1.Query.prototype.submit;
pg_1.Query.prototype.submit = function () {
var _this = this;
onSendQueryHooks.forEach(function (hook) { return hook(_this.text, _this.values); });
submit.apply(this, arguments);
};
var onSendQueryHooks = [];
var addHook = function (_a) {
var event = _a.event, hook = _a.hook;
switch (event) {
case 'on-send-query':
onSendQueryHooks.push(hook);
break;
}
};
exports.addHook = addHook;
var removeHook = function (_a) {
var event = _a.event, hook = _a.hook;
switch (event) {
case 'on-send-query':
onSendQueryHooks.splice(onSendQueryHooks.indexOf(hook), 1);
break;
}
};
exports.removeHook = removeHook;
var createPool = function (connectionString) {

@@ -43,0 +69,0 @@ var pool = new pg_1.Pool({ connectionString: connectionString });

import type { Result } from 'never-catch';
import type { Pool as PgPool, PoolClient } from 'pg';
import { Param } from "./entity";
declare type TransactionIsolationLevel = 'read-uncommitted' | 'read-committed' | 'repeatable-read' | 'serializable';

@@ -8,3 +9,12 @@ declare type Pool = {

};
export type { TransactionIsolationLevel, Pool };
declare type OnSendQueryHook = (query: string, params: Param[]) => void;
declare type AddHook = (hookAndEvent: {
event: 'on-send-query';
hook: OnSendQueryHook;
}) => void;
declare type RemoveHook = (hookAndEvent: {
event: 'on-send-query';
hook: OnSendQueryHook;
}) => void;
export type { TransactionIsolationLevel, Pool, OnSendQueryHook, AddHook, RemoveHook };
//# sourceMappingURL=pool.d.ts.map
{
"name": "@mrnafisia/type-query",
"version": "1.0.0",
"version": "1.0.1",
"description": "mini-orm with full type support for postgres.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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