Change default minimal SQLite API version

From 3.6.8 to 3.14.0.
Use `old_sqlite` feature to keep 3.6.8 (or 3.7.16) as the minimal version.
Use `modern_sqlite` for SQLite API > 3.14.0.
Also remove old 3.6.23 and 3.7.7 bindings.
This commit is contained in:
gwenn
2022-08-21 11:20:04 +02:00
committed by Thom Chiovoloni
parent 5ea4c3b7d6
commit 6e740d0611
16 changed files with 71 additions and 4107 deletions

View File

@@ -187,7 +187,7 @@ pub fn eponymous_only_module<'vtab, T: VTab<'vtab>>() -> &'static Module<'vtab,
/// Virtual table configuration options
#[repr(i32)]
#[non_exhaustive]
#[cfg(feature = "modern_sqlite")] // 3.7.7
#[cfg(not(feature = "old_sqlite"))] // 3.7.7
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum VTabConfig {
/// Equivalent to SQLITE_VTAB_CONSTRAINT_SUPPORT
@@ -203,8 +203,8 @@ pub struct VTabConnection(*mut ffi::sqlite3);
impl VTabConnection {
/// Configure various facets of the virtual table interface
#[cfg(feature = "modern_sqlite")] // 3.7.7
#[cfg_attr(docsrs, doc(cfg(feature = "modern_sqlite")))]
#[cfg(not(feature = "old_sqlite"))] // 3.7.7
#[cfg_attr(docsrs, doc(cfg(not(feature = "old_sqlite"))))]
pub fn config(&mut self, config: VTabConfig) -> Result<()> {
crate::error::check(unsafe { ffi::sqlite3_vtab_config(self.0, config as c_int) })
}
@@ -369,7 +369,7 @@ impl From<u8> for IndexConstraintOp {
}
}
#[cfg(feature = "modern_sqlite")] // 3.9.0
#[cfg(not(feature = "old_sqlite"))] // 3.9.0
bitflags::bitflags! {
/// Virtual table scan flags
/// See [Function Flags](https://sqlite.org/c3ref/c_index_scan_unique.html) for details.
@@ -474,8 +474,8 @@ impl IndexInfo {
}
/// Estimated number of rows returned.
#[cfg(feature = "modern_sqlite")] // SQLite >= 3.8.2
#[cfg_attr(docsrs, doc(cfg(feature = "modern_sqlite")))]
#[cfg(not(feature = "old_sqlite"))] // SQLite >= 3.8.2
#[cfg_attr(docsrs, doc(cfg(not(feature = "old_sqlite"))))]
#[inline]
pub fn set_estimated_rows(&mut self, estimated_rows: i64) {
unsafe {
@@ -484,16 +484,16 @@ impl IndexInfo {
}
/// Mask of SQLITE_INDEX_SCAN_* flags.
#[cfg(feature = "modern_sqlite")] // SQLite >= 3.9.0
#[cfg_attr(docsrs, doc(cfg(feature = "modern_sqlite")))]
#[cfg(not(feature = "old_sqlite"))] // SQLite >= 3.9.0
#[cfg_attr(docsrs, doc(cfg(not(feature = "old_sqlite"))))]
#[inline]
pub fn set_idx_flags(&mut self, flags: IndexFlags) {
unsafe { (*self.0).idxFlags = flags.bits() };
}
/// Mask of columns used by statement
#[cfg(feature = "modern_sqlite")] // SQLite >= 3.10.0
#[cfg_attr(docsrs, doc(cfg(feature = "modern_sqlite")))]
#[cfg(not(feature = "old_sqlite"))] // SQLite >= 3.10.0
#[cfg_attr(docsrs, doc(cfg(not(feature = "old_sqlite"))))]
#[inline]
pub fn col_used(&self) -> u64 {
unsafe { (*self.0).colUsed }