libsql / libsql-node-sqlite3

node-sqlite3 compatible API for libSQL
MIT License
12 stars 1 forks source link

The stream has expired due to inactivity STREAM_EXPIRED error #11

Open Mortalife opened 2 months ago

Mortalife commented 2 months ago

As this is meant to be a drop in replacement for sqlite3 it would be great if it handled these stream errors without surfacing them to the application.

https://github.com/tursodatabase/libsql/issues/985

cause: [ResponseError: select count(`t0`.`id`) as `count` from `admin_users` as `t0` limit 1 - The stream has expired due to inactivity] {
    code: 'STREAM_EXPIRED',
    proto: {
      message: 'The stream has expired due to inactivity',
      code: 'STREAM_EXPIRED'
    },
    level: '\x1B[31merror\x1B[39m',
    timestamp: '2024-07-10 19:41:08.194',
    expose: false,
    statusCode: 500,
    status: 500,
    [Symbol(level)]: 'error'
  }
}

Since I'm trying to get this working in an open source project with little opportunity of changing how connections are made, I cannot implement any of the suggested options inside the linked issue.

Mortalife commented 2 months ago

I see this has also been surfaced in the knex repo (which funnily enough is what I'm passing this into)

https://github.com/libsql/knex-libsql/issues/3