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

185
Vistas
postgrator return invalid pattern errror

I have tried to setup a data migration service using postgrator version 7.1.0. I have the following code

import Postgrator from "postgrator";
import pg from "pg";
import { dirname } from "path";
import { fileURLToPath } from "url";

const __dirname = dirname(fileURLToPath(import.meta.url));

async function doMigration() {
  // Create a client of your choice
  const client = new pg.Client({
    host: "0.0.0.1",
    port: 9075,
    database: "test",
    user: "test",
    password: "!testPwd",
  });

  

  try {
    // Establish a database connection
    await client.connect();

    // Create postgrator instance
    const postgrator = new Postgrator({
    migrationDirectory: __dirname + '/migration-scripts',
    driver: "pg",
    database: "test",
    schemaTable: "migration_version",
    execQuery: (query) => client.query(query),
    });

    
    
    await postgrator.migrate();
    console.log("schema migration completed successfully")
  } catch (error) {
    console.error(error); 
  }

  // Once done migrating, close your connection.
  await client.end();
}
doMigration();

But I got an error when running the above code

TypeError: invalid pattern
about 4 years ago · Santiago Trujillo
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