import from postgres dump

This commit is contained in:
Jan Prochazka
2024-09-27 08:08:13 +02:00
parent ae599ac6f6
commit 5287a86397
13 changed files with 25 additions and 17 deletions

View File

@@ -52,7 +52,7 @@ const drivers = driverBases.map(driverBase => ({
const dbhan = {
client,
database,
}
};
if (isReadOnly) {
await this.query(dbhan, 'SET SESSION TRANSACTION READ ONLY');
}
@@ -69,7 +69,11 @@ const drivers = driverBases.map(driverBase => ({
};
}
if (options?.importSqlDump && sql.trim().startsWith('/*!') && sql.includes('character_set_client')) {
if (
options?.importSqlDump &&
(sql.trim().startsWith('/*!') || sql.trim().startsWith('/*M!')) &&
(sql.includes('character_set_client') || sql.includes('NOTE_VERBOSITY'))
) {
// skip this in SQL dumps
return {
rows: [],