hgourvest / node-firebird

Pure javascript and asynchronous Firebird client for Node.js.
Mozilla Public License 2.0
256 stars 128 forks source link

db.query callback hangs #324

Closed pk-bt closed 7 months ago

pk-bt commented 7 months ago

I have a pool and I call a select with 2 fields and the query callback is not responding. Strangely, this works with Firebird version 3.0 but not with 1.5.

My code:

const dbOptions: Options = {
    host:  process.env.DB_SERVER',
    port: process.env.DB_PORT,
    database:  process.env.DB_FILE,
    user:  'SYSDBA',
    password: 'masterkey',
    lowercase_keys: false,
    pageSize: 4096,
    retryConnectionInterval: 1000,
    encoding: 'UTF8',
    blobAsText: true
}

const pool = Firebird.pool(10, dbOptions)

export function fbQuery<T>(qry: string, params?: any[]) {
    return new Promise<T>((resolve, reject) => {
        pool.get((err, db) => {
            if(err)
                return reject(err)

            db.query(qry, params ? params : [], (err, result) => {
                if(err)
                    return reject(err)

                resolve(result as T)
                db.detach()
            })
        })
    })
}

node-firebird version: 1.1.5 node version: 20.11.0 Firebird database version: 1.5

maratth commented 7 months ago

Hi,

node-firebird don't support firebird 1.5 officially.

pk-bt commented 7 months ago

Hi,

node-firebird don't support firebird 1.5 officially.

Just saw it in the documentation. Thank you anyway.