-
-
Notifications
You must be signed in to change notification settings - Fork 2
savepoint.versionTag()
Oxford Harrison edited this page Nov 15, 2024
·
3 revisions
DOCS • API • Savepoint API
Get the Savepoint's version tag.
See related ➞
savepoint.versionTags()
savepoint.versionTag(): number;
A database's life starts at version 1:
// Version 1
const savepoint = await client.createDatabase(
{
name: 'database_1',
tables: [{
name: 'table_1',
columns: [],
}]
},
{ desc: 'Create description', returning: 'savepoint' }
);
console.log(savepoint.versionTag()); // 1
Subsequent alterations increment the version:
// Version 2
const savepoint = await client.database('database_1').createTable(
{
name: 'table_2',
columns: [],
},
{ desc: 'Create description', returning: 'savepoint' }
);
console.log(savepoint.versionTag()); // 2
// Version 2 currently
const savepoint = await client.database('database_1').savepoint();
console.log(savepoint.versionTag()); // 2