Advanced Usage
Using the CLI is great for maintenance, quick tests, and one-off tasks, but brightstack really shines when you integrate it with your applications. You can do that by using:- HTTP API: integrate directly with the Data API.
- SDK: use our JavaScript client library for a more convenient experience.
Making API Calls
The Data API is simple to use! This is what a request might look like:Authorization and Content-Type headers
as described above unless mentioned otherwise.
Sessions
By default, running SQL queries is a stateless process. Sessions provide a stateful mechanism to make queries. Sessions can only execute one query at a time, so you must create a pool of them if you want to make multiple stateful queries in parallel. Using sessions has several benefits. On top of queries being a bit faster, you don’t have to typeUSE <database> in every query!
You can create a Session like this:
Raw API SQL Queries
Our Data Engine is powered by a DuckDB core, so most of DuckDB’s SQL dialect will work out of the box. Please remember thatsession is optional!
null).
You can use the type information from the matching column in order to parse
this correctly using your preferred programming language’s mechanisms.
We are working on native SDKs to make this process more fun.