Table Information
Skapi tracks all tables in your database. Use getTables() to retrieve table names, record counts, and table sizes.
You can fetch the full table list like this:
skapi.getTables().then(response => {
console.log(response); // List of all tables in the database
});Querying tables
To retrieve information for a specific table, pass an existing table name:
skapi.getTables({
table: 'my_collection',
}).then(response => {
console.log(response.list);
// [{
// table: 'my_collection';
// number_of_records: string;
// size: number;
// }]
})You can also query table names using condition.
skapi.getTables({
table: 'C',
condition: '>'
}).then(response => {
console.log(response); // Table names starting from 'C'
})In this example, condition is set to > and table is set to C. This returns table names that come after C in lexicographic order, such as Cc, D, E, and F.
To fetch table names that start with a prefix, set condition to >=:
skapi.getTables({
table: 'my_',
condition: '>='
}).then(response => {
console.log(response); // Table names starting from 'my_' (for example, 'my_collection')
})Condition-based table search is useful when you need to check whether a table already exists before uploading data.
For more detailed information on all the parameters and options available with the getTables() method, please refer to the API Reference below:
