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

no error messages with importFile() method #253

Closed sergey-ovsiannikov closed 7 months ago

sergey-ovsiannikov commented 10 months ago

I have code to migrate from old DB to new

const migrateTables = async () => {
// .... connection and other preparations
    const filenames = fs.readdirSync('migrations/tables');
    for (const filename of filenames) {
      try {
        console.log(`Migrating ${filename}`)
        await conn.importFile({file: `migrations/tables/${filename}`, database: targetDb})
      } catch (e) {
        console.error(`Migrate error in file ${filename}: ${e}`)
      }
    }
}

I get no error messages and no errors at all. I've found errors only when enabling debug mode. There are messages from the server with errors. Is there is possibility of getting errors without debug mode?

rusher commented 9 months ago

reproducted, errors in imported commands in last 16kb of imported file won't throw error. This will be corrected in 3.2.2