RestBI Documentation
  • Welcome to RestBI
  • Getting Started
    • Quickstart Guide for RestBI
    • Installation
      • Docker Compose
      • Kubernetes
  • Object Definitions
    • Data Model
      • Model
      • Connection
      • Table
      • Join
      • Column
      • Formula
      • ValidationResult
    • Query
      • Query
      • QueryFilter
      • SQLResult
  • SDK
    • Overview
    • Reference
      • RestBIClient
      • executeQuery
      • getMetadata
      • validateModel
  • API
    • Overview
    • Reference
      • POST /query
      • POST /validate
      • POST /metadata
      • GET /
  • Examples
    • RestBI Demo App
      • Installation
      • Report Builder
      • Drill Anywhere
      • Model Helper
Powered by GitBook
On this page
  1. SDK
  2. Reference

getMetadata

Understanding the getMetadata method

getMetadata(connection: Connection): Promise<Table[]>

Description: Fetches the metadata (tables and columns) from the database based on the provided connection details

  • Parameters:

    • connection (Connection): A Connection object containing database connection details.

  • Returns:

    • A Promise that resolves to an array of Table objects or rejects with an SQLError.

Example:

client.getMetadata({
  id: "1",
  name: "Chinook",
  host: "localhost",
  port: 5432,
  user: "postgres",
  password: "password",
  database: "chinook",
  type: DatabaseType.POSTGRES
}).then((tables) => {
  console.log(tables);
}).catch((error) => {
  console.error(error);
});
PreviousexecuteQueryNextvalidateModel

Last updated 9 months ago