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