Disallow indexing of non-indexable columns

This commit is contained in:
Yuriy Dupyn 2024-01-28 17:20:50 +01:00
parent 7b5b2bf9f3
commit 377c19cf32
2 changed files with 22 additions and 3 deletions

View file

@ -30,6 +30,18 @@ pub enum IndexableValue {
// TODO: what about null?
}
impl DbType {
pub fn is_indexable(&self) -> bool {
match self {
Self::String => true,
Self::Int => true,
Self::Number => false,
Self::Uuid => true,
}
}
}
impl Value {
pub fn to_type(&self) -> DbType {
match self {