libsqlite3_sys_le/
lib.rs

1#![allow(non_snake_case, non_camel_case_types)]
2
3pub use self::error::*;
4
5use std::default::Default;
6use std::mem;
7
8mod error;
9
10pub fn SQLITE_STATIC() -> sqlite3_destructor_type {
11    None
12}
13
14pub fn SQLITE_TRANSIENT() -> sqlite3_destructor_type {
15    Some(unsafe { mem::transmute(-1isize) })
16}
17
18/// Run-Time Limit Categories
19#[repr(i32)]
20#[non_exhaustive]
21pub enum Limit {
22    /// The maximum size of any string or BLOB or table row, in bytes.
23    SQLITE_LIMIT_LENGTH = SQLITE_LIMIT_LENGTH,
24    /// The maximum length of an SQL statement, in bytes.
25    SQLITE_LIMIT_SQL_LENGTH = SQLITE_LIMIT_SQL_LENGTH,
26    /// The maximum number of columns in a table definition or in the result set
27    /// of a SELECT or the maximum number of columns in an index or in an
28    /// ORDER BY or GROUP BY clause.
29    SQLITE_LIMIT_COLUMN = SQLITE_LIMIT_COLUMN,
30    /// The maximum depth of the parse tree on any expression.
31    SQLITE_LIMIT_EXPR_DEPTH = SQLITE_LIMIT_EXPR_DEPTH,
32    /// The maximum number of terms in a compound SELECT statement.
33    SQLITE_LIMIT_COMPOUND_SELECT = SQLITE_LIMIT_COMPOUND_SELECT,
34    /// The maximum number of instructions in a virtual machine program used to
35    /// implement an SQL statement.
36    SQLITE_LIMIT_VDBE_OP = SQLITE_LIMIT_VDBE_OP,
37    /// The maximum number of arguments on a function.
38    SQLITE_LIMIT_FUNCTION_ARG = SQLITE_LIMIT_FUNCTION_ARG,
39    /// The maximum number of attached databases.
40    SQLITE_LIMIT_ATTACHED = SQLITE_LIMIT_ATTACHED,
41    /// The maximum length of the pattern argument to the LIKE or GLOB
42    /// operators.
43    SQLITE_LIMIT_LIKE_PATTERN_LENGTH = SQLITE_LIMIT_LIKE_PATTERN_LENGTH,
44    /// The maximum index number of any parameter in an SQL statement.
45    SQLITE_LIMIT_VARIABLE_NUMBER = SQLITE_LIMIT_VARIABLE_NUMBER,
46    /// The maximum depth of recursion for triggers.
47    SQLITE_LIMIT_TRIGGER_DEPTH = 10,
48    /// The maximum number of auxiliary worker threads that a single prepared
49    /// statement may start.
50    SQLITE_LIMIT_WORKER_THREADS = 11,
51}
52
53#[cfg(feature = "loadable_extension_embedded")]
54// bindings were built with loadable_extension_embedded:
55// define sqlite3_api as an extern since this code will be embedded
56// within a loadable extension that defines and exports this itself
57extern "C" {
58    #[no_mangle]
59    pub static mut sqlite3_api: *mut sqlite3_api_routines;
60}
61
62#[cfg(all(
63    feature = "loadable_extension",
64    not(feature = "loadable_extension_embedded")
65))]
66// bindings were built with (non-embedded) loadable_extension:
67// we define our own (i.e. not extern) sqlite_api static
68// variable and export it publicly so that it is included in
69// our FFI (C) interface.
70#[no_mangle]
71pub static mut sqlite3_api: *mut sqlite3_api_routines = 0 as *mut sqlite3_api_routines;
72
73#[allow(clippy::all)]
74mod bindings {
75    include!(concat!(env!("OUT_DIR"), "/bindgen.rs"));
76}
77pub use bindings::*;
78
79pub type sqlite3_index_constraint = sqlite3_index_info_sqlite3_index_constraint;
80pub type sqlite3_index_constraint_usage = sqlite3_index_info_sqlite3_index_constraint_usage;
81
82impl Default for sqlite3_vtab {
83    fn default() -> Self {
84        unsafe { mem::zeroed() }
85    }
86}
87
88impl Default for sqlite3_vtab_cursor {
89    fn default() -> Self {
90        unsafe { mem::zeroed() }
91    }
92}