READMEcommits | blame
errors.hacommits | blame
sqlite3.hacommits | blame


The sqlite3 module provides Hare bindings to the sqlite3 library.  By
design, the wrapper functions resembles the underlying sqlite3 APIs so
that it is possible to use this module while reading the sqlite3
official documentation.  However, it is not a perfect 1:1 mapping, as
the exported functions should feel nice to use in Hare and not just
mirror the C APIs.

Sample code:

	use fmt;
	use sqlite3;

	let db = sqlite3::open("./db.sqlite3")?;
	defer sqlite3::close(db)?;

	let stmt = sqlite3::prepare("select $foo")?;
	defer sqlite3::finalize(stmt)?;

	sqlite3::bind(stmt, "$foo", 42)?;

	for (sqlite3::step(stmt)?) {
		fmt::printfln("The answer is {}",
			sqlite3::column_text(stmt, 0))?;