Joel Galenson | 610a751 | 2020-07-28 13:41:38 -0700 | [diff] [blame] | 1 | #![allow(non_snake_case, non_camel_case_types)] |
| 2 | |
| 3 | pub use self::error::*; |
| 4 | |
| 5 | use std::default::Default; |
| 6 | use std::mem; |
| 7 | |
| 8 | mod error; |
| 9 | |
| 10 | pub fn SQLITE_STATIC() -> sqlite3_destructor_type { |
| 11 | None |
| 12 | } |
| 13 | |
| 14 | pub 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] |
| 21 | pub 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 | #[allow(clippy::all)] |
| 54 | mod bindings { |
| 55 | include!(concat!(env!("OUT_DIR"), "/bindgen.rs")); |
| 56 | } |
| 57 | pub use bindings::*; |
| 58 | |
| 59 | pub type sqlite3_index_constraint = sqlite3_index_info_sqlite3_index_constraint; |
| 60 | pub type sqlite3_index_constraint_usage = sqlite3_index_info_sqlite3_index_constraint_usage; |
| 61 | |
| 62 | impl Default for sqlite3_vtab { |
| 63 | fn default() -> Self { |
| 64 | unsafe { mem::zeroed() } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | impl Default for sqlite3_vtab_cursor { |
| 69 | fn default() -> Self { |
| 70 | unsafe { mem::zeroed() } |
| 71 | } |
| 72 | } |