Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
NodeJS Knex database fallback for MySQL database

I am using the knex library (https://www.npmjs.com/package/knex) for NodeJS and MySQL and I would like to implement a fallback database connection in case that the current database is not reachable anymore.

I ve read that via the knex config it is possible to use for example the config options "ping" (https://github.com/knex/knex/issues/1198#issuecomment-185310131) and "afterCreate" (https://github.com/knex/documentation/pull/17/files) to detect if it is not possible anymore to connect to the database.

But in case it is not possible how exactly can i overwrite the existing connection settings, establish a new database connection and make it available to all upcoming queries within these config options?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda