Encode Date as BigInt when useBigIntAsLong is true

Description

Inserting {id: uuid(), v: BigInt(123), date: new Date()} into this simple table:

with encoding.useBigIntAsLong: true results in this error:

The reason is that _encodeBigIntFromBigInt is more restrictive than _encodeBigIntFromLong - it doesn't allow plain JS numbers, see https://github.com/datastax/nodejs-driver/blob/v4.3.1/lib/encoder.js#L511-L549 .

Environment

None

Pull Requests

None

Activity

Show:
Jorge Bay Gondra
December 30, 2019, 4:37 PM

Merged PR and included test.

Artem Salpagarov
December 30, 2019, 2:54 PM

PR:

Fixed

Assignee

Unassigned

Reporter

Artem Salpagarov

Reviewer

None

Fix versions

Labels

None

Components

None

PM Priority

None

Reproduced in

4.3.1

Pull Request

None

Affects versions

Priority

Major