mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 11:31:37 +08:00
Merge pull request #623 from gwenn/index-constraint-op
Add missing IndexConstraintOp entries
This commit is contained in:
commit
b2c63c8224
@ -244,16 +244,46 @@ pub trait CreateVTab: VTab {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bitflags::bitflags! {
|
///Index constraint operator.
|
||||||
#[doc = "Index constraint operator."]
|
#[derive(Debug, PartialEq)]
|
||||||
#[repr(C)]
|
#[allow(non_snake_case, non_camel_case_types)]
|
||||||
pub struct IndexConstraintOp: ::std::os::raw::c_uchar {
|
pub enum IndexConstraintOp {
|
||||||
const SQLITE_INDEX_CONSTRAINT_EQ = 2;
|
SQLITE_INDEX_CONSTRAINT_EQ,
|
||||||
const SQLITE_INDEX_CONSTRAINT_GT = 4;
|
SQLITE_INDEX_CONSTRAINT_GT,
|
||||||
const SQLITE_INDEX_CONSTRAINT_LE = 8;
|
SQLITE_INDEX_CONSTRAINT_LE,
|
||||||
const SQLITE_INDEX_CONSTRAINT_LT = 16;
|
SQLITE_INDEX_CONSTRAINT_LT,
|
||||||
const SQLITE_INDEX_CONSTRAINT_GE = 32;
|
SQLITE_INDEX_CONSTRAINT_GE,
|
||||||
const SQLITE_INDEX_CONSTRAINT_MATCH = 64;
|
SQLITE_INDEX_CONSTRAINT_MATCH,
|
||||||
|
SQLITE_INDEX_CONSTRAINT_LIKE, // 3.10.0
|
||||||
|
SQLITE_INDEX_CONSTRAINT_GLOB, // 3.10.0
|
||||||
|
SQLITE_INDEX_CONSTRAINT_REGEXP, // 3.10.0
|
||||||
|
SQLITE_INDEX_CONSTRAINT_NE, // 3.21.0
|
||||||
|
SQLITE_INDEX_CONSTRAINT_ISNOT, // 3.21.0
|
||||||
|
SQLITE_INDEX_CONSTRAINT_ISNOTNULL, // 3.21.0
|
||||||
|
SQLITE_INDEX_CONSTRAINT_ISNULL, // 3.21.0
|
||||||
|
SQLITE_INDEX_CONSTRAINT_IS, // 3.21.0
|
||||||
|
SQLITE_INDEX_CONSTRAINT_FUNCTION(u8), // 3.25.0
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<u8> for IndexConstraintOp {
|
||||||
|
fn from(code: u8) -> IndexConstraintOp {
|
||||||
|
match code {
|
||||||
|
2 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_EQ,
|
||||||
|
4 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_GT,
|
||||||
|
8 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_LE,
|
||||||
|
16 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_LT,
|
||||||
|
32 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_GE,
|
||||||
|
64 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_MATCH,
|
||||||
|
65 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_LIKE,
|
||||||
|
66 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_GLOB,
|
||||||
|
67 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_REGEXP,
|
||||||
|
68 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_NE,
|
||||||
|
69 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_ISNOT,
|
||||||
|
70 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_ISNOTNULL,
|
||||||
|
71 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_ISNULL,
|
||||||
|
72 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_IS,
|
||||||
|
v => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_FUNCTION(v),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +386,7 @@ impl IndexConstraint<'_> {
|
|||||||
|
|
||||||
/// Constraint operator
|
/// Constraint operator
|
||||||
pub fn operator(&self) -> IndexConstraintOp {
|
pub fn operator(&self) -> IndexConstraintOp {
|
||||||
IndexConstraintOp::from_bits_truncate(self.0.op)
|
IndexConstraintOp::from(self.0.op)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// True if this constraint is usable
|
/// True if this constraint is usable
|
||||||
|
Loading…
Reference in New Issue
Block a user