Ensure all datastore keys encode correctly
This commit is contained in:
parent
56f5f10046
commit
45c81ad02b
20 changed files with 80 additions and 20 deletions
|
@ -56,7 +56,10 @@ impl Database {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Database, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -60,7 +60,10 @@ impl Db {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Db, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -64,7 +64,10 @@ impl Dl {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Dl, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -64,7 +64,10 @@ impl Dt {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Dt, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -68,7 +68,10 @@ impl Ev {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Ev, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -68,7 +68,10 @@ impl Fd {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Fd, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -68,7 +68,10 @@ impl Ft {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Ft, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -64,7 +64,10 @@ impl Guide {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Guide, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -68,7 +68,10 @@ impl Ix {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Ix, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -42,7 +42,10 @@ impl Kv {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Kv, Error> {
|
||||
Ok(deserialize::<Kv>(v)?)
|
||||
|
|
|
@ -68,7 +68,10 @@ impl Lv {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Lv, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -52,7 +52,10 @@ impl Namespace {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Namespace, Error> {
|
||||
Ok(deserialize::<Namespace>(v)?)
|
||||
|
|
|
@ -60,7 +60,10 @@ impl Nl {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Nl, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -56,7 +56,10 @@ impl Ns {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Ns, Error> {
|
||||
Ok(deserialize::<Ns>(v)?)
|
||||
|
|
|
@ -60,7 +60,10 @@ impl Nt {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Nt, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -64,7 +64,10 @@ impl Sc {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Sc, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -72,7 +72,10 @@ impl St {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<St, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -60,7 +60,10 @@ impl Table {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Table, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -64,7 +64,10 @@ impl Tb {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Tb, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
|
@ -65,7 +65,10 @@ impl Thing {
|
|||
}
|
||||
}
|
||||
pub fn encode(&self) -> Result<Vec<u8>, Error> {
|
||||
Ok(serialize(self)?)
|
||||
crate::sql::serde::beg_internal_serialization();
|
||||
let v = serialize(self);
|
||||
crate::sql::serde::end_internal_serialization();
|
||||
Ok(v?)
|
||||
}
|
||||
pub fn decode(v: &[u8]) -> Result<Thing, Error> {
|
||||
Ok(deserialize(v)?)
|
||||
|
|
Loading…
Reference in a new issue