Skip to content
Oxford Harrison edited this page Nov 15, 2024 · 3 revisions

DOCSAPISavepoint API


Get the Savepoint's database schema snapshot.

Syntax

savepoint.schema(): DatabaseSchema;
Interface Description
DatabaseSchema The schema snapshot of the database.

Usage

Given the following operation:

const databaseSchema = {
    name: 'database_1',
    tables: [{
        name: 'table_1',
        columns: []
    }]
};
const savepoint = await client.createDatabase(databaseSchema, { desc: 'Create description', returning: 'savepoint' });

Get the database schema snapshot:

console.log(savepoint.schema()); // An object corresponding to databaseSchema
const savepoint = await client.database('database_1').savepoint();
await savepoint.schema(); // An object corresponding to databaseSchema
Clone this wiki locally