Launch Week Day 4: Introducing Data Exports.Learn More
Socket
Book a DemoSign in
Socket

mysql2

Package Overview
Dependencies
Maintainers
1
Versions
283
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql2 - npm Package Compare versions

Comparing version
3.18.1
to
3.18.2-canary.2ad5f0b2
+1
-1
package.json
{
"name": "mysql2",
"version": "3.18.1",
"version": "3.18.2-canary.2ad5f0b2",
"description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",

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

@@ -8,2 +8,3 @@ // This file was modified by Oracle on November 04, 2021.

import { Readable } from 'stream';
import { Timezone } from 'sql-escaper';
import { Query, QueryError } from './protocol/sequences/Query.js';

@@ -154,3 +155,3 @@ import { Prepare, PrepareStatementInfo } from './protocol/sequences/Prepare.js';

*/
timezone?: string | 'local';
timezone?: Timezone;

@@ -157,0 +158,0 @@ /**

@@ -6,2 +6,3 @@ import { FieldPacket, QueryResult } from '../packets/index.js';

QueryOptions,
ExecuteValues,
QueryableConstructor,

@@ -22,3 +23,3 @@ } from './Query.js';

sql: string,
values: any,
values: ExecuteValues,
callback?:

@@ -31,3 +32,3 @@ | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)

callback?:
| ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any)
| ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
| undefined

@@ -37,3 +38,3 @@ ): Query;

options: QueryOptions,
values: any,
values: ExecuteValues,
callback?:

@@ -40,0 +41,0 @@ | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)

import { FieldPacket, QueryResult } from '../../packets/index.js';
import { QueryOptions, QueryableConstructor, QueryValues } from '../Query.js';
import { QueryOptions, QueryableConstructor, ExecuteValues } from '../Query.js';

@@ -8,15 +8,11 @@ export declare function ExecutableBase<T extends QueryableConstructor>(

new (...args: any[]): {
execute<T extends QueryResult>(sql: string): Promise<[T, FieldPacket[]]>;
execute<T extends QueryResult>(
sql: string,
values?: QueryValues
values?: ExecuteValues
): Promise<[T, FieldPacket[]]>;
execute<T extends QueryResult>(
options: QueryOptions
): Promise<[T, FieldPacket[]]>;
execute<T extends QueryResult>(
options: QueryOptions,
values?: QueryValues
values?: ExecuteValues
): Promise<[T, FieldPacket[]]>;
};
} & T;
import { FieldPacket, QueryResult } from '../../packets/index.js';
import { QueryOptions, QueryableConstructor } from '../Query.js';
import { QueryOptions, QueryValues, QueryableConstructor } from '../Query.js';

@@ -8,15 +8,12 @@ export declare function QueryableBase<T extends QueryableConstructor>(

new (...args: any[]): {
query<T extends QueryResult>(sql: string): Promise<[T, FieldPacket[]]>;
query<T extends QueryResult>(
sql: string,
values?: any
values?: QueryValues
): Promise<[T, FieldPacket[]]>;
query<T extends QueryResult>(
options: QueryOptions
): Promise<[T, FieldPacket[]]>;
query<T extends QueryResult>(
options: QueryOptions,
values?: any
values?: QueryValues
): Promise<[T, FieldPacket[]]>;
};
} & T;
import { Sequence } from './Sequence.js';
import { OkPacket, RowDataPacket, FieldPacket } from '../packets/index.js';
import { Readable } from 'stream';
import { Timezone } from 'sql-escaper';
import { TypeCast } from '../../parsers/typeCast.js';
export type ExecuteValues =
| string
| number
| bigint
| boolean
| Date
| null
| Blob
| Buffer
| ({} | null)[]
| { [key: string]: ExecuteValues };
export type QueryValues =

@@ -15,3 +28,3 @@ | string

| Buffer
| ({} | null)[]
| ({} | null | undefined)[]
| { [key: string]: QueryValues };

@@ -99,2 +112,31 @@

infileStreamFactory?: (path: string) => Readable;
/**
* When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option
* (Default: false)
*/
supportBigNumbers?: boolean;
/**
* Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be
* always returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving
* bigNumberStrings disabled will return big numbers as String objects only when they cannot be accurately
* represented with JavaScript Number objects (which happens when they exceed the [-2^53, +2^53] range),
* otherwise they will be returned as Number objects.
* This option is ignored if supportBigNumbers is disabled.
*/
bigNumberStrings?: boolean;
/**
* Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date
* objects. Can be true/false or an array of type names to keep as strings.
*
* (Default: false)
*/
dateStrings?: boolean | Array<'TIMESTAMP' | 'DATETIME' | 'DATE'>;
/**
* The timezone used to store local dates. (Default: 'local')
*/
timezone?: Timezone;
}

@@ -101,0 +143,0 @@

@@ -6,2 +6,3 @@ import { FieldPacket, QueryResult } from '../packets/index.js';

QueryOptions,
QueryValues,
QueryableConstructor,

@@ -22,3 +23,3 @@ } from './Query.js';

sql: string,
values: any,
values: QueryValues,
callback?:

@@ -31,3 +32,3 @@ | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)

callback?:
| ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any)
| ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
| undefined

@@ -37,3 +38,3 @@ ): Query;

options: QueryOptions,
values: any,
values: QueryValues,
callback?:

@@ -40,0 +41,0 @@ | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)