1 7f78ef2c 2023-12-31 op The sqlite3 module provides Hare bindings to the sqlite3 library. By
2 7f78ef2c 2023-12-31 op design, the wrapper functions resembles the underlying sqlite3 APIs so
3 7f78ef2c 2023-12-31 op that it is possible to use this module while reading the sqlite3
4 7f78ef2c 2023-12-31 op official documentation. However, it is not a perfect 1:1 mapping, as
5 7f78ef2c 2023-12-31 op the exported functions should feel nice to use in Hare and not just
6 7f78ef2c 2023-12-31 op mirorr the C APIs.
13 7f78ef2c 2023-12-31 op let db = sqlite3::open("./db.sqlite3")?;
14 7f78ef2c 2023-12-31 op defer sqlite3::close(db)?;
16 7f78ef2c 2023-12-31 op let stmt = sqlite3::prepare("select $foo")?;
17 7f78ef2c 2023-12-31 op defer sqlite3::finalize(stmt)?;
19 7f78ef2c 2023-12-31 op sqlite3::bind(stmt, "$foo", 42);
21 7f78ef2c 2023-12-31 op for (sqlite3::step(stmt)!) {
22 7f78ef2c 2023-12-31 op fmt::printfln("The answer is {}",
23 7f78ef2c 2023-12-31 op sqlite3::column_text(stmt, 0));