extract primary key detection

This commit is contained in:
pedrocarlo
2025-05-10 18:20:16 -03:00
parent b93156ee9d
commit ea15b1f617

View File

@@ -829,7 +829,8 @@ impl Index {
// I wanted to just chain the iterator above but Rust type system get's messy with Iterators.
// It would not allow me chain them even by using a core::iter::empty()
// To circumvent this, I'm having to allocate a second Vec, and extend the other from it.
if table.get_rowid_alias_column().is_none() && !table.primary_key_columns.is_empty() {
let has_primary_key_index = table.get_rowid_alias_column().is_none() && !table.primary_key_columns.is_empty();
if has_primary_key_index {
let (index_name, root_page) = auto_indices.next().expect(
"number of auto_indices in schema should be same number of indices calculated",
);