- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2
savepoint.reverseSQL
        Oxford Harrison edited this page Nov 15, 2024 
        ·
        2 revisions
      
    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
Given the following rollback:
const savepoint = await savepoint.rollback();Get the recommit SQL preview:
console.log(savepoint.reverseSQL());Console
ALTER SCHEMA database_1 RENAME TO database_1_new