dbmod

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package dbmod is the native module "db": SQL databases through Go's database/sql. The first database is SQLite (modernc.org/sqlite, pure Go, so no C library is needed).

use db;
local conn = db::open("sqlite:shop.db");
conn->exec("CREATE TABLE IF NOT EXISTS items (name TEXT, price REAL)");
conn->exec("INSERT INTO items VALUES (?, ?)", "pen", 1.5);
for (local row in conn->query("SELECT * FROM items WHERE price < ?", 10))
    println(row["name"], row["price"]);
conn->close();

Values always travel as parameters (?), never glued into the SQL text.

Index

Constants

View Source
const DBError = "DBError"

DBError is the kind of the exceptions the database reports: an SQL error, a broken constraint, a database file that cannot be opened.

Variables

View Source
var (
	Conn   = &native.Class{Name: "Conn"}
	Cursor = &native.Class{Name: "Cursor"}
)

Conn and Cursor are the classes db::Conn and db::Cursor.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL