@sap/cds-dk
Version:
Command line client and development toolkit for the SAP Cloud Application Programming Model
11 lines (10 loc) • 381 B
JavaScript
exports.deploy = async function deploy_to_sql(model, db = 'db', options) {
options.dialect = 'postgres'
try {
// Connect here to be able to later on disconnect in the finally
if (!db.run) db = await require('../../lib/cds').connect.to(db)
await require('./to-sql').deploy(model, db, options)
} finally {
await db?.disconnect?.()
}
}