Updated installer

This commit is contained in:
mdecimus
2023-12-21 18:09:37 +01:00
parent 31719963c9
commit bda7cda59d
33 changed files with 510 additions and 347 deletions

View File

@@ -42,7 +42,7 @@ impl SqliteStore {
"SELECT v FROM {} WHERE k = ?",
char::from(key.subspace())
))?;
let key = key.serialize(false);
let key = key.serialize(0);
result
.query_row([&key], |row| {
U::deserialize(row.get_ref(0)?.as_bytes()?)
@@ -58,10 +58,10 @@ impl SqliteStore {
&self,
mut key: BitmapKey<BitmapClass>,
) -> crate::Result<Option<RoaringBitmap>> {
let begin = key.serialize(false);
let begin = key.serialize(0);
key.block_num = u32::MAX;
let key_len = begin.len();
let end = key.serialize(false);
let end = key.serialize(0);
let conn = self.conn_pool.get()?;
self.spawn_worker(move || {
@@ -89,8 +89,8 @@ impl SqliteStore {
self.spawn_worker(move || {
let table = char::from(params.begin.subspace());
let begin = params.begin.serialize(false);
let end = params.end.serialize(false);
let begin = params.begin.serialize(0);
let end = params.end.serialize(0);
let keys = if params.values { "k, v" } else { "k" };
let mut query = conn.prepare_cached(&match (params.first, params.ascending) {
@@ -139,7 +139,7 @@ impl SqliteStore {
&self,
key: impl Into<ValueKey<ValueClass>> + Sync + Send,
) -> crate::Result<i64> {
let key = key.into().serialize(false);
let key = key.into().serialize(0);
let conn = self.conn_pool.get()?;
self.spawn_worker(move || {
match conn

View File

@@ -66,7 +66,7 @@ impl SqliteStore {
document_id,
class,
}
.serialize(false);
.serialize(0);
if *by >= 0 {
trx.prepare_cached(concat!(
@@ -87,7 +87,7 @@ impl SqliteStore {
class,
};
let table = char::from(key.subspace());
let key = key.serialize(false);
let key = key.serialize(0);
if let ValueOp::Set(value) = op {
trx.prepare_cached(&format!(
@@ -108,7 +108,7 @@ impl SqliteStore {
field: *field,
key,
}
.serialize(false);
.serialize(0);
if *set {
trx.prepare_cached("INSERT OR IGNORE INTO i (k) VALUES (?)")?
@@ -125,7 +125,7 @@ impl SqliteStore {
class,
block_num: document_id,
}
.serialize(false);
.serialize(0);
if *set {
trx.prepare_cached("INSERT OR IGNORE INTO b (k) VALUES (?)")?
@@ -145,7 +145,7 @@ impl SqliteStore {
collection: *collection,
change_id: *change_id,
}
.serialize(false);
.serialize(0);
trx.prepare_cached("INSERT OR REPLACE INTO l (k, v) VALUES (?, ?)")?
.execute([&key, set])?;
@@ -161,7 +161,7 @@ impl SqliteStore {
class,
};
let table = char::from(key.subspace());
let key = key.serialize(false);
let key = key.serialize(0);
let matches = trx
.prepare_cached(&format!("SELECT v FROM {} WHERE k = ?", table))?
@@ -193,7 +193,7 @@ impl SqliteStore {
"DELETE FROM {} WHERE k >= ? AND k < ?",
char::from(from.subspace()),
))?
.execute([from.serialize(false), to.serialize(false)])?;
.execute([from.serialize(0), to.serialize(0)])?;
Ok(())
})