We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
DOCS • API • Savepoint API
Get the rollback or recommit SQL for preview.
savepoint.reverseSQL(): string;
Given the following operation:
// Name change const savepoint = await client.alterDatabase( 'database_1', (schema) => schema.name('database_1_new'), { returning: 'savepoint' } );
Get the rollback SQL preview:
console.log(savepoint.reverseSQL());
Console ALTER SCHEMA database_1_new RENAME TO database_1
ALTER SCHEMA database_1_new RENAME TO database_1
Given the following rollback:
const savepoint = await savepoint.rollback();
Get the recommit SQL preview:
Console ALTER SCHEMA database_1 RENAME TO database_1_new
ALTER SCHEMA database_1 RENAME TO database_1_new