reifydb_core/interface/catalog/
vtable.rs1use serde::{Deserialize, Serialize};
5
6use crate::interface::catalog::{column::ColumnDef, id::NamespaceId};
7
8#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
10pub struct VTableId(pub u64);
11
12impl From<u64> for VTableId {
13 fn from(id: u64) -> Self {
14 VTableId(id)
15 }
16}
17
18impl From<VTableId> for u64 {
19 fn from(id: VTableId) -> u64 {
20 id.0
21 }
22}
23
24impl VTableId {
25 #[inline]
27 pub fn to_u64(self) -> u64 {
28 self.0
29 }
30}
31
32#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
34pub struct VTableDef {
35 pub id: VTableId,
37 pub namespace: NamespaceId,
39 pub name: String,
41 pub columns: Vec<ColumnDef>,
43}