mirror of
https://github.com/isar/rusqlite.git
synced 2025-01-19 22:20:51 +08:00
Merge pull request #1309 from gwenn/item_name
Use ParseCallbacks::item_name to fix sqlite3_index_info_* types
This commit is contained in:
commit
57a7b29b68
@ -1879,10 +1879,10 @@ pub struct sqlite3_module {
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct sqlite3_index_info {
|
||||
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 aOrderBy: *mut sqlite3_index_info_sqlite3_index_orderby,
|
||||
pub aConstraintUsage: *mut sqlite3_index_info_sqlite3_index_constraint_usage,
|
||||
pub aOrderBy: *mut sqlite3_index_orderby,
|
||||
pub aConstraintUsage: *mut sqlite3_index_constraint_usage,
|
||||
pub idxNum: ::std::os::raw::c_int,
|
||||
pub idxStr: *mut ::std::os::raw::c_char,
|
||||
pub needToFreeIdxStr: ::std::os::raw::c_int,
|
||||
@ -1894,7 +1894,7 @@ pub struct sqlite3_index_info {
|
||||
}
|
||||
#[repr(C)]
|
||||
#[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 op: ::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)]
|
||||
#[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 desc: ::std::os::raw::c_uchar,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[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 omit: ::std::os::raw::c_uchar,
|
||||
}
|
||||
|
@ -497,6 +497,11 @@ mod bindings {
|
||||
None
|
||||
}
|
||||
}
|
||||
fn item_name(&self, original_item_name: &str) -> Option<String> {
|
||||
original_item_name
|
||||
.strip_prefix("sqlite3_index_info_")
|
||||
.map(|s| s.to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
// Are we generating the bundled bindings? Used to avoid emitting things
|
||||
|
@ -2189,10 +2189,10 @@ pub struct sqlite3_module {
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct sqlite3_index_info {
|
||||
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 aOrderBy: *mut sqlite3_index_info_sqlite3_index_orderby,
|
||||
pub aConstraintUsage: *mut sqlite3_index_info_sqlite3_index_constraint_usage,
|
||||
pub aOrderBy: *mut sqlite3_index_orderby,
|
||||
pub aConstraintUsage: *mut sqlite3_index_constraint_usage,
|
||||
pub idxNum: ::std::os::raw::c_int,
|
||||
pub idxStr: *mut ::std::os::raw::c_char,
|
||||
pub needToFreeIdxStr: ::std::os::raw::c_int,
|
||||
@ -2204,7 +2204,7 @@ pub struct sqlite3_index_info {
|
||||
}
|
||||
#[repr(C)]
|
||||
#[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 op: ::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)]
|
||||
#[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 desc: ::std::os::raw::c_uchar,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[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 omit: ::std::os::raw::c_uchar,
|
||||
}
|
||||
|
@ -2162,10 +2162,10 @@ pub struct sqlite3_module {
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct sqlite3_index_info {
|
||||
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 aOrderBy: *mut sqlite3_index_info_sqlite3_index_orderby,
|
||||
pub aConstraintUsage: *mut sqlite3_index_info_sqlite3_index_constraint_usage,
|
||||
pub aOrderBy: *mut sqlite3_index_orderby,
|
||||
pub aConstraintUsage: *mut sqlite3_index_constraint_usage,
|
||||
pub idxNum: ::std::os::raw::c_int,
|
||||
pub idxStr: *mut ::std::os::raw::c_char,
|
||||
pub needToFreeIdxStr: ::std::os::raw::c_int,
|
||||
@ -2177,7 +2177,7 @@ pub struct sqlite3_index_info {
|
||||
}
|
||||
#[repr(C)]
|
||||
#[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 op: ::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)]
|
||||
#[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 desc: ::std::os::raw::c_uchar,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[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 omit: ::std::os::raw::c_uchar,
|
||||
}
|
||||
|
@ -31,9 +31,6 @@ mod 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 {
|
||||
fn default() -> Self {
|
||||
unsafe { mem::zeroed() }
|
||||
|
@ -619,7 +619,7 @@ impl IndexConstraintUsage<'_> {
|
||||
|
||||
/// `feature = "vtab"`
|
||||
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> {
|
||||
@ -637,7 +637,7 @@ impl<'a> Iterator for OrderByIter<'a> {
|
||||
}
|
||||
|
||||
/// 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<'_> {
|
||||
/// Column number
|
||||
|
Loading…
x
Reference in New Issue
Block a user