Quickstart Guide for RestBI
Install, Configure the Models, and execute Queries
Deploy RestBI with Docker
To get started quickly with RestBI, you can deploy the RestBI server using Docker. The Docker image is available on DockerHub, making deployment simple and fast.
Pull the Docker image from DockerHub:
Run the RestBI server with the following command:
Install the SDK
Next, we need to install the SDK from npm. Open your terminal and run the following command in your project directory:
Define Your Data Model
Create a data model file. This file will define the connection, tables, columns, joins, and formulas specific to your database. This keeps connection details secure and allows the RestBI server to generate accurate SQL queries based on your model.
Example: dataModel.ts
Joins: Understand how to link your tables with joins.
Formulas: Create complex calculations and logic using formulas.
Model files are typically stored on the back-end of your application. Use environmental variables to set sensitive information.
Create a Query
Create a query to fetch data from your database. The query will specify the columns you want to retrieve, any filters, sorting options, and a limit on the number of rows.
Example: query.ts
This query selects the Total Due and Order Date columns from the database, applies a filter to only include records where the Order Date is on or after January 1, 2024, and limits the results to 100 rows. It's equivalent to a SQL SELECT
statement with a WHERE
clause and a LIMIT
.
Get the Dataset
Use the SDK to send the query to the server. The SDK will handle communication with the server and return the results.
Example: index.ts
This will return a SQL Result object containing the dataset.
Whats Next - Demo App
The Demo App is a great way for you to see the art of the possible in RestBI.
Drill Anywhere - See how easy it is to add filtering, drilling and more to common charting libraries like AgGrid and ChartJS.
Report Builder - A dynamic interface for self service. See how to combine the Model and Query in a flexible interface.
Model Helper - Explore how models are built, the validate function, and even plugin GPT to generate models for you.
Last updated