squire_sqlite3_sys/lib.rs
1//! # squire-sqlite3-sys
2//!
3//! [Squire][] is a crate for embedding [SQLite][] in Rust. This crate links
4//! SQLite into the application, exposing the [C API][] of SQLite to Rust.
5//!
6//! Users of Squire don't need to interact with this crate directly, and can
7//! treat it as an implementation detail.
8//!
9//! [Squire]: https://lib.rs/squire
10//! [SQLite]: https://sqlite.org/
11//! [C API]: https://sqlite.org/cintro.html
12
13#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
14#![cfg_attr(docsrs, feature(doc_cfg), deny(rustdoc::broken_intra_doc_links))]
15
16/// Generated `unsafe extern "C"` bindings from [bindgen][].
17///
18/// [bindgen]: https://rust-lang.github.io/rust-bindgen/
19mod bindings {
20 include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
21}
22
23pub use bindings::*;
24
25/// Use `SQLITE_STATIC` as a SQLite [destructor](sqlite3_destructor_type)
26/// argument to signal to SQLite that the memory allocation will outlive the
27/// (e.g.) prepared statement.
28///
29/// SQLite will not clone the provided data, nor will it run a destructor. To
30/// instead have SQLite clone a borrowed buffer, use [`SQLITE_TRANSIENT`].
31///
32/// (See the [SQLite reference][] for details.)
33///
34/// [SQLite reference]: https://sqlite.org/c3ref/c_static.html
35pub const SQLITE_STATIC: sqlite3_destructor_type = sqlite3_destructor_type::from_sentinel(0);
36
37/// Use `SQLITE_TRANSIENT` as a SQLite [destructor](sqlite3_destructor_type)
38/// argument to instruct SQLite to clone the provided value before returning,
39/// and for SQLite to take responsibility to free the memory it allocated for
40/// the clone when it is no longer needed.
41///
42/// (See the [SQLite reference][] for details.)
43///
44/// [SQLite reference]: https://sqlite.org/c3ref/c_static.html
45pub const SQLITE_TRANSIENT: sqlite3_destructor_type = sqlite3_destructor_type::from_sentinel(-1);