mysql-rowquery
Advanced tools
+4
-4
| import mysql, { Pool } from 'mysql2/promise'; | ||
| export declare const format: typeof mysql.format; | ||
| export interface sqlInsertUpdate { | ||
| export interface SqlInsertUpdateResult { | ||
| affectedRows: number; | ||
@@ -20,4 +20,4 @@ changedRows: number; | ||
| export type SqlInsertUpdate = SQLType.insert | SQLType.update | SQLType.delete; | ||
| export type ResqultQuery<E> = E extends SqlInsertUpdate ? sqlInsertUpdate : Array<E>; | ||
| export type queryFunctionType = <E>(query: string, ...params: any[]) => Promise<ResqultQuery<E>>; | ||
| export type ResqultQuery<E> = E extends SqlInsertUpdate ? SqlInsertUpdateResult : Array<E>; | ||
| export type QueryFunctionType = <E>(query: string, ...params: any[]) => Promise<ResqultQuery<E>>; | ||
| export type SqlResultParser = (k: string, v: any) => any; | ||
@@ -36,3 +36,3 @@ export type ErrorLog = (query: string, params: any[]) => void; | ||
| */ | ||
| declare const getConnection: <T>(pool: Pool, connectionPool: (queryFunction: queryFunctionType) => Promise<T>, isTransaction?: boolean) => Promise<T>; | ||
| declare const getConnection: <T>(pool: Pool, connectionPool: (queryFunction: QueryFunctionType) => Promise<T>, isTransaction?: boolean) => Promise<T>; | ||
| export default getConnection; | ||
@@ -39,0 +39,0 @@ export declare const query: <E>(pool: Pool, query: string, ...params: any[]) => Promise<ResqultQuery<E>>; |
+1
-1
| { | ||
| "name": "mysql-rowquery", | ||
| "version": "1.0.6", | ||
| "version": "1.0.7", | ||
| "description": "mysql row query", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
24291
0.05%