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