File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ export interface SQLCloudRowsetMetadata {
9797}
9898
9999/** Basic types that can be returned by SQLiteCloud APIs */
100- export type SQLiteCloudDataTypes = string | number | boolean | Record < string | number , unknown > | Buffer | null | undefined
100+ export type SQLiteCloudDataTypes = string | number | bigint | boolean | Record < string | number , unknown > | Buffer | null | undefined
101101
102102/** Custom error reported by SQLiteCloud drivers */
103103export class SQLiteCloudError extends Error {
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export function escapeSqlParameter(param: SQLiteCloudDataTypes): string {
8484 return `'${ param } '`
8585 }
8686
87- if ( typeof param === 'number' ) {
87+ if ( typeof param === 'number' || typeof param === 'bigint' ) {
8888 return param . toString ( )
8989 }
9090
Original file line number Diff line number Diff line change @@ -166,6 +166,32 @@ describe('connection-tls', () => {
166166 } )
167167
168168 describe ( 'send test commands' , ( ) => {
169+ test . only (
170+ 'should test long string' ,
171+ done => {
172+ const size = 10 * 1024 * 1204
173+ let value = 'LOOOONG'
174+ while ( value . length < size ) {
175+ value += 'a'
176+ }
177+
178+ const chinook = getConnection ( )
179+ chinook . sendCommands ( `SELECT '${ value } ' 'VALUE'` , ( error , results ) => {
180+ expect ( error ) . toBeNull ( )
181+ expect ( results . numberOfRows ) . toBe ( 1 )
182+ expect ( results . numberOfColumns ) . toBe ( 1 )
183+ expect ( results . columnsNames ) . toEqual ( [ 'VALUE' ] )
184+ expect ( results [ 0 ] . VALUE ) . toBe ( value )
185+
186+ done ( )
187+ chinook . close ( )
188+ } )
189+
190+ done ( )
191+ } ,
192+ LONG_TIMEOUT
193+ )
194+
169195 it (
170196 'should test integer' ,
171197 done => {
You can’t perform that action at this time.
0 commit comments