#[cfg(feature = "jemalloc")]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
pub mod block_storage;
#[deprecated(
since = "0.2.0",
note = "Use jemalloc feature instead. See buddy_allocator module docs for migration."
)]
#[allow(deprecated)]
pub mod buddy_allocator;
pub mod catalog;
pub mod columnar; pub mod concurrency; pub mod edge_encoding; pub mod epoch_gc;
pub mod error;
pub mod format_migration;
pub mod key;
pub mod knowledge_object; pub mod learned_index;
pub mod lockfree_interner; pub mod memory_schema; pub mod path_trie;
pub mod predefined_views;
pub mod reclamation;
pub mod record_id; pub mod schema_bridge;
pub mod schema_evolution;
pub mod sharded_block_store;
pub mod soch;
pub mod soch_codec;
pub mod sochfs_metadata;
pub mod string_interner; pub mod tbp; pub mod transaction_typestate; pub mod txn;
pub mod version_chain; pub mod vfs;
pub mod zero_copy;
#[cfg(feature = "analytics")]
pub mod analytics;
pub use block_storage::{
BlockCompression, BlockRef, BlockStore, BlockStoreStats, FileBlockManager,
};
pub use catalog::{Catalog, CatalogEntry, CatalogEntryType, McpToolDescriptor, OperationImpl};
pub use columnar::{
ColumnChunk, ColumnStats, ColumnType as ColumnarColumnType, ColumnValue as ColumnarColumnValue,
ColumnarStore, ColumnarTable, MemoryComparison, TypedColumn, ValidityBitmap,
};
pub use error::{Result, SochDBError};
pub use key::{CausalKey, TemporalKey};
pub use knowledge_object::{
BitemporalCoord, CompressionMode, Edge, EdgeKind, EmbeddingSpace, KnowledgeObject,
KnowledgeObjectBuilder, KnowledgeObjectError, ObjectId, ObjectIdError, ObjectKind, Provenance,
};
pub use learned_index::LearnedSparseIndex;
pub use lockfree_interner::{InternerStats, LockFreeInterner, Symbol};
pub use memory_schema::{
Entity, EntityFacts, EntityKind, EntitySearchResult, Episode, EpisodeSearchResult, EpisodeType,
Event, EventMetrics, EventRole, MemoryStore, TableRole, TableSemanticMetadata,
};
pub use path_trie::{ColumnGroupAffinity, ColumnType as PathTrieColumnType, PathTrie, TrieNode};
pub use predefined_views::{
ViewDefinition, build_view_map, get_predefined_views, get_view, naming,
};
pub use record_id::{IdValue, RecordId};
pub use soch::{SochField, SochIndex, SochRow, SochSchema, SochTable, SochType, SochValue};
pub use soch_codec::{
SochDbBinaryCodec, SochDocument, SochParseError, SochTextEncoder, SochTextParser,
SochTokenCounter,
};
pub use sochfs_metadata::{DirEntryRow, FsMetadataStore, FsWalOp, InodeRow, SochFS};
pub use transaction_typestate::{
Aborted, Active, Committed, ReadOnly, ReadWrite, Transaction as TypestateTransaction,
TransactionMode, TransactionStorage, WriteOnly,
};
pub use txn::{
AriesCheckpointData, AriesDirtyPageEntry, AriesTransactionEntry, IsolationLevel, Lsn, PageId,
Transaction, TransactionManager, TxnId, TxnState, TxnStats, TxnWalEntry, TxnWrite,
WalRecordType,
};
pub use version_chain::{
BinarySearchChain, ChainEntry, ConcurrencyPolicy, ExternalLock, InternalRwLock, LockFreeAtomic,
MvccGcStats, MvccStore, MvccStoreError, MvccVersionChain, MvccVersionChainMut, VersionMeta,
VisibilityContext, WriteConflictDetection,
};
pub use vfs::{
BlockId, DirEntry, Directory, FileStat, FileType, Inode, InodeId, Permissions, Superblock,
VfsOp,
};
pub const SOCHDB_VERSION: &str = env!("CARGO_PKG_VERSION");
pub const SOCHDB_MAGIC: [u8; 4] = *b"TOON";
pub const SCHEMA_VERSION: u32 = 1;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_soch_roundtrip() {
let schema = SochSchema::new("test")
.field("id", SochType::UInt)
.field("value", SochType::Text);
let mut table = SochTable::new(schema);
table.push(SochRow::new(vec![
SochValue::UInt(1),
SochValue::Text("hello".into()),
]));
let formatted = table.format();
let parsed = SochTable::parse(&formatted).unwrap();
assert_eq!(parsed.schema.name, "test");
assert_eq!(parsed.rows.len(), 1);
}
}