Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion forward_engineering/ddlProvider/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
createDatabase:
'CREATE DATABASE ${name}${template}${encoding}${locale}${collate}${characterClassification}${tablespace};\n',

createSchema: 'CREATE SCHEMA${ifNotExist} ${name};\nSET search_path TO ${name};\n\n${comment}\n',
createSchema: 'CREATE SCHEMA${ifNotExist} ${name};\nSET search_path TO ${name}, public;\n\n${comment}\n',

comment: 'COMMENT ON ${object} ${objectName} IS ${comment};\n',

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@
"lodash": "4.17.21",
"pg": "8.12.0"
}
}
}
3 changes: 1 addition & 2 deletions polyglot/convertAdapter.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"type": "vector"
},
"to": {
"to": "vector",
"subtype": ""
"subtype": "vector<real>"
}
}
]
Expand Down
27 changes: 13 additions & 14 deletions reverse_engineering/helpers/connectionHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,25 +135,24 @@ const retryOnSslError = (config, logger, error) => {
throw error;
};

const createConnectionPool = (config, logger) => {
const createConnectionPool = async (config, logger) => {
const pool = new pg.Pool(config);

return pool
.connect()
.then(client => {
client.release();
try {
const client = await pool.connect();

return pool;
})
.catch(async error => {
await pool.end();
client.release();

if (config.isRetry) {
throw error;
}
return pool;
} catch (error) {
await pool.end();

return retryOnSslError(config, logger, error);
});
if (config.isRetry) {
throw error;
}

return retryOnSslError(config, logger, error);
}
};

module.exports = {
Expand Down
Loading