|
1 | 1 | import { Sequence } from './Sequence.js'; |
2 | 2 | import { OkPacket, RowDataPacket, FieldPacket } from '../packets/index.js'; |
3 | 3 | import { Readable } from 'stream'; |
| 4 | +import { Timezone } from 'sql-escaper'; |
4 | 5 | import { TypeCast } from '../../parsers/typeCast.js'; |
5 | 6 |
|
6 | 7 | export type QueryValues = |
@@ -95,6 +96,35 @@ export interface QueryOptions { |
95 | 96 | * By specifying a function that returns a readable stream, an arbitrary stream can be sent when sending a local fs file. |
96 | 97 | */ |
97 | 98 | infileStreamFactory?: (path: string) => Readable; |
| 99 | + |
| 100 | + /** |
| 101 | + * When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option |
| 102 | + * (Default: false) |
| 103 | + */ |
| 104 | + supportBigNumbers?: boolean; |
| 105 | + |
| 106 | + /** |
| 107 | + * Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be |
| 108 | + * always returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving |
| 109 | + * bigNumberStrings disabled will return big numbers as String objects only when they cannot be accurately |
| 110 | + * represented with JavaScript Number objects (which happens when they exceed the [-2^53, +2^53] range), |
| 111 | + * otherwise they will be returned as Number objects. |
| 112 | + * This option is ignored if supportBigNumbers is disabled. |
| 113 | + */ |
| 114 | + bigNumberStrings?: boolean; |
| 115 | + |
| 116 | + /** |
| 117 | + * Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date |
| 118 | + * objects. Can be true/false or an array of type names to keep as strings. |
| 119 | + * |
| 120 | + * (Default: false) |
| 121 | + */ |
| 122 | + dateStrings?: boolean | Array<'TIMESTAMP' | 'DATETIME' | 'DATE'>; |
| 123 | + |
| 124 | + /** |
| 125 | + * The timezone used to store local dates. (Default: 'local') |
| 126 | + */ |
| 127 | + timezone?: Timezone; |
98 | 128 | } |
99 | 129 |
|
100 | 130 | export interface StreamOptions { |
|
0 commit comments