Brightstack provides developers with the tools and cloud infrastructure to gather, store, and use data to power lightning-fast data products using Postgres-style SQL and their language of choice.
ID | Name | Status |
---|---|---|
eng_3Mc2WnRgKVw7D7Yb | dev | running |
1 (INTEGER) |
---|
1 |
Get your data pipeline up and running in minutes, not weeks.
Code data-intensive applications as easy as any web app. Deploy to production in minutes. Scale to whatever.
import { brightstack } from "@brightstack/client";
const dw = brightstack({
apiKey: "MY_API_KEY",
engine: "production",
database: "myapp",
});
export default dw;
import dw from "./dw";
// Create a new database
await dw.sql("CREATE DATABASE hits;");
// Use the database
await dw.sql("USE hits;");
// Simple query
const result = await dw.sql("SELECT * FROM users LIMIT 10;");
// Result: [{ id: 'usr_d78as6bg', name: 'Bob' }]
// Create a table and insert data
await dw.sql(`
CREATE TABLE products (
id INTEGER PRIMARY KEY,
name VARCHAR,
price DECIMAL(10,2)
);
`);
await dw.sql(`
INSERT INTO products VALUES
(1, 'Laptop', 999.99),
(2, 'Mouse', 29.99),
(3, 'Keyboard', 79.99);
`);
// Query the data
const products = await dw.sql(`
SELECT COUNT(*) as total FROM products;
`);
console.log(products);
// [{ total: '3' }]
Answers to the most frequently asked questions.