Your first lake
A lake is a folder: on your disk, or a prefix in an S3, R2, GCS or Azure bucket. Pondra keeps
your tables there as Parquet files, plus a log of the newest rows. There is no database server to
install: one pondra process on the lake answers SQL, Python and JavaScript.
Start a node
Section titled “Start a node”pondra serve lake --addr 127.0.0.1:8080Or let your code start one for you, in the background, and stop it when you’re done:
import pondradb = pondra.local("lake") # starts a node on ./lakeimport { local } from "pondra";const db = await local("lake");The examples below talk to a node at localhost:8080. Open http://localhost:8080 in a browser and
you get the console: the lake’s tables, and cells for SQL and Python.
Make a table and write rows
Section titled “Make a table and write rows”CREATE TABLE orders (id BIGINT, item VARCHAR, qty INT, amount DOUBLE);INSERT INTO orders VALUES (1, 'tea', 2, 7.0), (2, 'cake', 1, 4.5), (3, 'tea', 1, 3.5);import pondradb = pondra.connect("http://localhost:8080")db.sql("CREATE TABLE IF NOT EXISTS orders (id BIGINT, item VARCHAR, qty INT, amount DOUBLE)")db.append("orders", [{"id": 4, "item": "coffee", "qty": 1, "amount": 3.0}])import { connect } from "pondra";const db = connect("http://localhost:8080");await db.sql("CREATE TABLE IF NOT EXISTS orders (id BIGINT, item VARCHAR, qty INT, amount DOUBLE)");await db.append("orders", [{ id: 5, item: "juice", qty: 2, amount: 5.0 }]);Query it
Section titled “Query it”SELECT item, sum(qty) AS items, sum(amount) AS total FROM orders GROUP BY item ORDER BY total DESC;print(db.sql("SELECT item, sum(qty) AS items FROM orders GROUP BY item ORDER BY item").rows())import { connect } from "pondra";const db = connect("http://localhost:8080");console.log(await db.sql("SELECT count(*) AS n FROM orders"));