fix breaking change on rusqlite changing RowIndex's signature

RowIndex must have just been an alias over i32, but now it's a trait
implemented on str and usize, so we need to change mentat's internal
type alias for it to a usize.
This commit is contained in:
Conrad Dean 2019-07-22 08:33:34 -04:00
parent 95780c0ab5
commit ff48f6369a
5 changed files with 7 additions and 7 deletions

View file

@ -343,7 +343,7 @@ impl QueryResults {
}
}
type Index = i32; // See rusqlite::RowIndex.
type Index = usize; // See rusqlite::RowIndex.
enum TypedIndex {
Known(Index, ValueTypeTag),
Unknown(Index, Index),

View file

@ -192,7 +192,7 @@ pub(crate) fn project_elements<'a, I: IntoIterator<Item = &'a Element>>(
// We'll expand them later.
let mut outer_projection: Vec<Either<Name, ProjectedColumn>> = Vec::with_capacity(count + 2);
let mut i: i32 = 0;
let mut i: usize = 0;
let mut min_max_count: usize = 0;
let mut templates = vec![];
let mut pulls: Vec<PullTemplate> = vec![];

View file

@ -124,7 +124,7 @@ impl TupleTwoStagePullProjector {
// There will be at least as many SQL columns as Datalog columns.
// gte 'cos we might be querying extra columns for ordering.
// The templates will take care of ignoring columns.
assert!(row.column_count() >= self.len as i32);
assert!(row.column_count() >= self.len);
self.templates
.iter()
.map(|ti| ti.lookup(&row))
@ -208,7 +208,7 @@ impl RelTwoStagePullProjector {
// There will be at least as many SQL columns as Datalog columns.
// gte 'cos we might be querying extra columns for ordering.
// The templates will take care of ignoring columns.
assert!(row.column_count() >= self.len as i32);
assert!(row.column_count() >= self.len);
let mut count = 0;
for binding in self.templates
.iter()

View file

@ -97,7 +97,7 @@ impl TupleProjector {
// There will be at least as many SQL columns as Datalog columns.
// gte 'cos we might be querying extra columns for ordering.
// The templates will take care of ignoring columns.
assert!(row.column_count() >= self.len as i32);
assert!(row.column_count() >= self.len);
self.templates
.iter()
.map(|ti| ti.lookup(&row))
@ -155,7 +155,7 @@ impl RelProjector {
// There will be at least as many SQL columns as Datalog columns.
// gte 'cos we might be querying extra columns for ordering.
// The templates will take care of ignoring columns.
assert!(row.column_count() >= self.len as i32);
assert!(row.column_count() >= self.len);
let mut count = 0;
for binding in self.templates
.iter()

View file

@ -94,7 +94,7 @@ impl<'schema> PullConsumer<'schema> {
}
pub(crate) fn collect_entity<'a>(&mut self, row: &rusqlite::Row<'a>) -> Entid {
let entity = row.get(self.indices.sql_index);
let entity = row.get(self.indices.sql_index).unwrap();
self.entities.insert(entity);
entity
}