Standard library
HTTP, databases, data formats, and more
The standard library covers HTTP clients and servers, WebSockets, SQLite, PostgreSQL, MySQL, Redis, message brokers, crypto and JWT, JSON, YAML, TOML, XML, templating, datetime, math, and more.
Database connections wrap a production connection pool and support parameterized statements. This complete SQLite example needs no separate server; the same API connects to PostgreSQL and MySQL.
import io;
import db;
let conn = db.Connection("sqlite", ":memory:");
defer conn.close();
conn.exec("create table users (id integer, name text)");
conn.exec(
"insert into users (id, name) values (:id, :name)",
{"id": 1, "name": "Mara"}
);
let rows = conn.query(
"select name from users where id = :id",
{"id": 1}
);
defer rows.close();
io.println(rows.first()["name"]);
For full web applications, Gebweb is the recommended framework. It builds on these primitives with controllers, typed request binding, validation, dependency injection, OpenAPI, auth, caching, and server-rendered views.