mirror of
https://github.com/isar/rusqlite.git
synced 2025-01-19 22:20:51 +08:00
Use ParseCallbacks::item_name to fix sqlite3_index_info_* types
This commit is contained in:
parent
fd753b14fc
commit
eb7fbc57d0
@ -1879,10 +1879,10 @@ pub struct sqlite3_module {
|
|||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info {
|
pub struct sqlite3_index_info {
|
||||||
pub nConstraint: ::std::os::raw::c_int,
|
pub nConstraint: ::std::os::raw::c_int,
|
||||||
pub aConstraint: *mut sqlite3_index_info_sqlite3_index_constraint,
|
pub aConstraint: *mut sqlite3_index_constraint,
|
||||||
pub nOrderBy: ::std::os::raw::c_int,
|
pub nOrderBy: ::std::os::raw::c_int,
|
||||||
pub aOrderBy: *mut sqlite3_index_info_sqlite3_index_orderby,
|
pub aOrderBy: *mut sqlite3_index_orderby,
|
||||||
pub aConstraintUsage: *mut sqlite3_index_info_sqlite3_index_constraint_usage,
|
pub aConstraintUsage: *mut sqlite3_index_constraint_usage,
|
||||||
pub idxNum: ::std::os::raw::c_int,
|
pub idxNum: ::std::os::raw::c_int,
|
||||||
pub idxStr: *mut ::std::os::raw::c_char,
|
pub idxStr: *mut ::std::os::raw::c_char,
|
||||||
pub needToFreeIdxStr: ::std::os::raw::c_int,
|
pub needToFreeIdxStr: ::std::os::raw::c_int,
|
||||||
@ -1894,7 +1894,7 @@ pub struct sqlite3_index_info {
|
|||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info_sqlite3_index_constraint {
|
pub struct sqlite3_index_constraint {
|
||||||
pub iColumn: ::std::os::raw::c_int,
|
pub iColumn: ::std::os::raw::c_int,
|
||||||
pub op: ::std::os::raw::c_uchar,
|
pub op: ::std::os::raw::c_uchar,
|
||||||
pub usable: ::std::os::raw::c_uchar,
|
pub usable: ::std::os::raw::c_uchar,
|
||||||
@ -1902,13 +1902,13 @@ pub struct sqlite3_index_info_sqlite3_index_constraint {
|
|||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info_sqlite3_index_orderby {
|
pub struct sqlite3_index_orderby {
|
||||||
pub iColumn: ::std::os::raw::c_int,
|
pub iColumn: ::std::os::raw::c_int,
|
||||||
pub desc: ::std::os::raw::c_uchar,
|
pub desc: ::std::os::raw::c_uchar,
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info_sqlite3_index_constraint_usage {
|
pub struct sqlite3_index_constraint_usage {
|
||||||
pub argvIndex: ::std::os::raw::c_int,
|
pub argvIndex: ::std::os::raw::c_int,
|
||||||
pub omit: ::std::os::raw::c_uchar,
|
pub omit: ::std::os::raw::c_uchar,
|
||||||
}
|
}
|
||||||
|
@ -497,6 +497,13 @@ mod bindings {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fn item_name(&self, original_item_name: &str) -> Option<String> {
|
||||||
|
if let Some(s) = original_item_name.strip_prefix("sqlite3_index_info_") {
|
||||||
|
Some(s.to_owned())
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Are we generating the bundled bindings? Used to avoid emitting things
|
// Are we generating the bundled bindings? Used to avoid emitting things
|
||||||
|
@ -2189,10 +2189,10 @@ pub struct sqlite3_module {
|
|||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info {
|
pub struct sqlite3_index_info {
|
||||||
pub nConstraint: ::std::os::raw::c_int,
|
pub nConstraint: ::std::os::raw::c_int,
|
||||||
pub aConstraint: *mut sqlite3_index_info_sqlite3_index_constraint,
|
pub aConstraint: *mut sqlite3_index_constraint,
|
||||||
pub nOrderBy: ::std::os::raw::c_int,
|
pub nOrderBy: ::std::os::raw::c_int,
|
||||||
pub aOrderBy: *mut sqlite3_index_info_sqlite3_index_orderby,
|
pub aOrderBy: *mut sqlite3_index_orderby,
|
||||||
pub aConstraintUsage: *mut sqlite3_index_info_sqlite3_index_constraint_usage,
|
pub aConstraintUsage: *mut sqlite3_index_constraint_usage,
|
||||||
pub idxNum: ::std::os::raw::c_int,
|
pub idxNum: ::std::os::raw::c_int,
|
||||||
pub idxStr: *mut ::std::os::raw::c_char,
|
pub idxStr: *mut ::std::os::raw::c_char,
|
||||||
pub needToFreeIdxStr: ::std::os::raw::c_int,
|
pub needToFreeIdxStr: ::std::os::raw::c_int,
|
||||||
@ -2204,7 +2204,7 @@ pub struct sqlite3_index_info {
|
|||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info_sqlite3_index_constraint {
|
pub struct sqlite3_index_constraint {
|
||||||
pub iColumn: ::std::os::raw::c_int,
|
pub iColumn: ::std::os::raw::c_int,
|
||||||
pub op: ::std::os::raw::c_uchar,
|
pub op: ::std::os::raw::c_uchar,
|
||||||
pub usable: ::std::os::raw::c_uchar,
|
pub usable: ::std::os::raw::c_uchar,
|
||||||
@ -2212,13 +2212,13 @@ pub struct sqlite3_index_info_sqlite3_index_constraint {
|
|||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info_sqlite3_index_orderby {
|
pub struct sqlite3_index_orderby {
|
||||||
pub iColumn: ::std::os::raw::c_int,
|
pub iColumn: ::std::os::raw::c_int,
|
||||||
pub desc: ::std::os::raw::c_uchar,
|
pub desc: ::std::os::raw::c_uchar,
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info_sqlite3_index_constraint_usage {
|
pub struct sqlite3_index_constraint_usage {
|
||||||
pub argvIndex: ::std::os::raw::c_int,
|
pub argvIndex: ::std::os::raw::c_int,
|
||||||
pub omit: ::std::os::raw::c_uchar,
|
pub omit: ::std::os::raw::c_uchar,
|
||||||
}
|
}
|
||||||
|
@ -2162,10 +2162,10 @@ pub struct sqlite3_module {
|
|||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info {
|
pub struct sqlite3_index_info {
|
||||||
pub nConstraint: ::std::os::raw::c_int,
|
pub nConstraint: ::std::os::raw::c_int,
|
||||||
pub aConstraint: *mut sqlite3_index_info_sqlite3_index_constraint,
|
pub aConstraint: *mut sqlite3_index_constraint,
|
||||||
pub nOrderBy: ::std::os::raw::c_int,
|
pub nOrderBy: ::std::os::raw::c_int,
|
||||||
pub aOrderBy: *mut sqlite3_index_info_sqlite3_index_orderby,
|
pub aOrderBy: *mut sqlite3_index_orderby,
|
||||||
pub aConstraintUsage: *mut sqlite3_index_info_sqlite3_index_constraint_usage,
|
pub aConstraintUsage: *mut sqlite3_index_constraint_usage,
|
||||||
pub idxNum: ::std::os::raw::c_int,
|
pub idxNum: ::std::os::raw::c_int,
|
||||||
pub idxStr: *mut ::std::os::raw::c_char,
|
pub idxStr: *mut ::std::os::raw::c_char,
|
||||||
pub needToFreeIdxStr: ::std::os::raw::c_int,
|
pub needToFreeIdxStr: ::std::os::raw::c_int,
|
||||||
@ -2177,7 +2177,7 @@ pub struct sqlite3_index_info {
|
|||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info_sqlite3_index_constraint {
|
pub struct sqlite3_index_constraint {
|
||||||
pub iColumn: ::std::os::raw::c_int,
|
pub iColumn: ::std::os::raw::c_int,
|
||||||
pub op: ::std::os::raw::c_uchar,
|
pub op: ::std::os::raw::c_uchar,
|
||||||
pub usable: ::std::os::raw::c_uchar,
|
pub usable: ::std::os::raw::c_uchar,
|
||||||
@ -2185,13 +2185,13 @@ pub struct sqlite3_index_info_sqlite3_index_constraint {
|
|||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info_sqlite3_index_orderby {
|
pub struct sqlite3_index_orderby {
|
||||||
pub iColumn: ::std::os::raw::c_int,
|
pub iColumn: ::std::os::raw::c_int,
|
||||||
pub desc: ::std::os::raw::c_uchar,
|
pub desc: ::std::os::raw::c_uchar,
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct sqlite3_index_info_sqlite3_index_constraint_usage {
|
pub struct sqlite3_index_constraint_usage {
|
||||||
pub argvIndex: ::std::os::raw::c_int,
|
pub argvIndex: ::std::os::raw::c_int,
|
||||||
pub omit: ::std::os::raw::c_uchar,
|
pub omit: ::std::os::raw::c_uchar,
|
||||||
}
|
}
|
||||||
|
@ -31,9 +31,6 @@ mod bindings {
|
|||||||
}
|
}
|
||||||
pub use bindings::*;
|
pub use bindings::*;
|
||||||
|
|
||||||
pub type sqlite3_index_constraint = sqlite3_index_info_sqlite3_index_constraint;
|
|
||||||
pub type sqlite3_index_constraint_usage = sqlite3_index_info_sqlite3_index_constraint_usage;
|
|
||||||
|
|
||||||
impl Default for sqlite3_vtab {
|
impl Default for sqlite3_vtab {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
unsafe { mem::zeroed() }
|
unsafe { mem::zeroed() }
|
||||||
|
@ -619,7 +619,7 @@ impl IndexConstraintUsage<'_> {
|
|||||||
|
|
||||||
/// `feature = "vtab"`
|
/// `feature = "vtab"`
|
||||||
pub struct OrderByIter<'a> {
|
pub struct OrderByIter<'a> {
|
||||||
iter: slice::Iter<'a, ffi::sqlite3_index_info_sqlite3_index_orderby>,
|
iter: slice::Iter<'a, ffi::sqlite3_index_orderby>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Iterator for OrderByIter<'a> {
|
impl<'a> Iterator for OrderByIter<'a> {
|
||||||
@ -637,7 +637,7 @@ impl<'a> Iterator for OrderByIter<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A column of the ORDER BY clause.
|
/// A column of the ORDER BY clause.
|
||||||
pub struct OrderBy<'a>(&'a ffi::sqlite3_index_info_sqlite3_index_orderby);
|
pub struct OrderBy<'a>(&'a ffi::sqlite3_index_orderby);
|
||||||
|
|
||||||
impl OrderBy<'_> {
|
impl OrderBy<'_> {
|
||||||
/// Column number
|
/// Column number
|
||||||
|
Loading…
x
Reference in New Issue
Block a user