use std::sync::{Arc, OnceLock};
use reifydb_core::interface::catalog::{
column::{Column, ColumnIndex},
id::NamespaceId,
vtable::VTable,
};
use reifydb_type::value::{constraint::TypeConstraint, r#type::Type};
use super::ids::{columns::shapes::*, vtable::SHAPES};
pub fn shapes() -> Arc<VTable> {
static INSTANCE: OnceLock<Arc<VTable>> = OnceLock::new();
INSTANCE.get_or_init(|| {
Arc::new(VTable {
id: SHAPES,
namespace: NamespaceId::SYSTEM,
name: "shapes".to_string(),
columns: vec![
Column {
id: FINGERPRINT,
name: "fingerprint".to_string(),
constraint: TypeConstraint::unconstrained(Type::Uint8),
properties: vec![],
index: ColumnIndex(0),
auto_increment: false,
dictionary_id: None,
},
Column {
id: FIELD_COUNT,
name: "field_count".to_string(),
constraint: TypeConstraint::unconstrained(Type::Uint2),
properties: vec![],
index: ColumnIndex(1),
auto_increment: false,
dictionary_id: None,
},
],
})
})
.clone()
}