1#[cfg(feature = "jemalloc")]
82#[global_allocator]
83static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
84
85pub mod block_storage;
86#[deprecated(
87 since = "0.2.0",
88 note = "Use jemalloc feature instead. See buddy_allocator module docs for migration."
89)]
90#[allow(deprecated)]
91pub mod buddy_allocator;
92pub mod catalog;
93pub mod columnar; pub mod concurrency; pub mod epoch_gc;
96pub mod error;
97pub mod format_migration;
98pub mod key;
99pub mod learned_index;
100pub mod lockfree_interner; pub mod memory_schema; pub mod path_trie;
103pub mod predefined_views;
104pub mod reclamation;
105pub mod schema_bridge;
106pub mod schema_evolution;
107pub mod sharded_block_store;
108pub mod string_interner; pub mod tbp; pub mod knowledge_object; pub mod soch;
112pub mod soch_codec;
113pub mod sochfs_metadata;
114pub mod transaction_typestate; pub mod txn;
116pub mod version_chain; pub mod vfs;
118pub mod zero_copy; #[cfg(feature = "analytics")]
122pub mod analytics;
123
124pub use block_storage::{
126 BlockCompression, BlockRef, BlockStore, BlockStoreStats, FileBlockManager,
127};
128pub use catalog::{Catalog, CatalogEntry, CatalogEntryType, McpToolDescriptor, OperationImpl};
129pub use columnar::{
130 ColumnChunk, ColumnStats, ColumnType as ColumnarColumnType, ColumnValue as ColumnarColumnValue,
131 ColumnarStore, ColumnarTable, MemoryComparison, TypedColumn, ValidityBitmap,
132};
133pub use error::{Result, SochDBError};
134pub use key::{CausalKey, TemporalKey};
135pub use learned_index::LearnedSparseIndex;
136pub use lockfree_interner::{InternerStats, LockFreeInterner, Symbol};
137pub use memory_schema::{
138 Entity, EntityFacts, EntityKind, EntitySearchResult, Episode, EpisodeSearchResult, EpisodeType,
139 Event, EventMetrics, EventRole, MemoryStore, TableRole, TableSemanticMetadata,
140};
141pub use path_trie::{ColumnGroupAffinity, ColumnType as PathTrieColumnType, PathTrie, TrieNode};
142pub use predefined_views::{
143 ViewDefinition, build_view_map, get_predefined_views, get_view, naming,
144};
145pub use knowledge_object::{
146 BitemporalCoord, CompressionMode, Edge, EdgeKind, EmbeddingSpace, KnowledgeObject,
147 KnowledgeObjectBuilder, KnowledgeObjectError, ObjectId, ObjectIdError,
148 ObjectKind, Provenance,
149};
150pub use soch::{SochField, SochIndex, SochRow, SochSchema, SochTable, SochType, SochValue};
151pub use soch_codec::{
152 SochDbBinaryCodec, SochDocument, SochParseError, SochTextEncoder, SochTextParser,
153 SochTokenCounter,
154};
155pub use sochfs_metadata::{DirEntryRow, FsMetadataStore, FsWalOp, InodeRow, SochFS};
156pub use txn::{
157 AriesCheckpointData, AriesDirtyPageEntry, AriesTransactionEntry, IsolationLevel, Lsn, PageId,
158 Transaction, TransactionManager, TxnId, TxnState, TxnStats, TxnWalEntry, TxnWrite,
159 WalRecordType,
160};
161pub use transaction_typestate::{
162 Transaction as TypestateTransaction, Active, Committed, Aborted,
163 ReadOnly, ReadWrite, WriteOnly, TransactionStorage, TransactionMode,
164};
165pub use version_chain::{
166 BinarySearchChain, ChainEntry,
167 ConcurrencyPolicy, ExternalLock, InternalRwLock, LockFreeAtomic,
168 MvccGcStats, MvccStore, MvccStoreError,
169 MvccVersionChain, MvccVersionChainMut, VersionMeta, VisibilityContext, WriteConflictDetection,
170};
171pub use vfs::{
172 BlockId, DirEntry, Directory, FileStat, FileType, Inode, InodeId, Permissions, Superblock,
173 VfsOp,
174};
175
176pub const SOCHDB_VERSION: &str = env!("CARGO_PKG_VERSION");
178
179pub const SOCHDB_MAGIC: [u8; 4] = *b"TOON";
181
182pub const SCHEMA_VERSION: u32 = 1;
184
185#[cfg(test)]
186mod tests {
187 use super::*;
188
189 #[test]
190 fn test_soch_roundtrip() {
191 let schema = SochSchema::new("test")
192 .field("id", SochType::UInt)
193 .field("value", SochType::Text);
194
195 let mut table = SochTable::new(schema);
196 table.push(SochRow::new(vec![
197 SochValue::UInt(1),
198 SochValue::Text("hello".into()),
199 ]));
200
201 let formatted = table.format();
202 let parsed = SochTable::parse(&formatted).unwrap();
203
204 assert_eq!(parsed.schema.name, "test");
205 assert_eq!(parsed.rows.len(), 1);
206 }
207}