mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
363 stars 93 forks source link

Add missing BIGINT Type enum #284

Closed GekasD closed 1 week ago

GekasD commented 2 months ago

I was trying to cast any BIGINT numbers to strings so that I can serialize my results to JSON, But it seems like BIGINT was missing as a enum in the Types enum, this commit fixes the issue

    typeCast: (field, next): => {

        // Property 'BIGINT' does not exist on type 'typeof Types'.ts(2339)
        if (field.type === Types.BIGINT) {
            return field.string()
        }

        return next()

    }
rusher commented 1 week ago

Thanks.

problem is that javascript describe BIGINT while typescript describe longlong enums here and here

correction is based on this PR, merged in develop branch. (will be in 3.4.0 version)

created merged in develop branch. Will be in 3.4.0 version