66want to create their own custom codecs.
77
88Built-in Codecs:
9- - ``<blob>``: Serialize Python objects (internal) or external with dedup
10- - ``<hash>``: Hash-addressed storage with SHA256 deduplication
11- - ``<object>``: Schema-addressed storage for files/folders (Zarr, HDF5)
12- - ``<attach>``: File attachment (internal) or external with dedup
13- - ``<filepath@store>``: Reference to existing file in store
9+ - ``<blob>``: Serialize Python objects (in-table storage)
10+ - ``<blob@>``: Serialize Python objects (external with hash-addressed dedup)
11+ - ``<attach>``: File attachment (in-table storage)
12+ - ``<attach@>``: File attachment (external with hash-addressed dedup)
13+ - ``<hash@>``: Hash-addressed storage with MD5 deduplication (external only)
14+ - ``<object@>``: Schema-addressed storage for files/folders (external only)
1415 - ``<npy@>``: Store numpy arrays as portable .npy files (external only)
16+ - ``<filepath@store>``: Reference to existing file in store (external only)
1517
1618Example - Creating a Custom Codec:
1719 Here's how to define your own codec, modeled after the built-in codecs::
@@ -75,9 +77,9 @@ class BlobCodec(Codec):
7577 The ``<blob>`` codec handles serialization of arbitrary Python objects
7678 including NumPy arrays, dictionaries, lists, datetime objects, and UUIDs.
7779
78- Supports both internal and external storage:
80+ Supports both in-table and in-store storage:
7981 - ``<blob>``: Stored in database (bytes → LONGBLOB)
80- - ``<blob@>``: Stored externally via ``<hash@>`` with deduplication
82+ - ``<blob@>``: Stored in object store via ``<hash@>`` with deduplication
8183 - ``<blob@store>``: Stored in specific named store
8284
8385 Format Features:
@@ -92,9 +94,9 @@ class ProcessedData(dj.Manual):
9294 definition = '''
9395 data_id : int
9496 ---
95- small_result : <blob> # internal (in database)
96- large_result : <blob@> # external (default store)
97- archive : <blob@cold> # external (specific store)
97+ small_result : <blob> # in-table (in database)
98+ large_result : <blob@> # in-store (default store)
99+ archive : <blob@cold> # in-store (specific store)
98100 '''
99101
100102 # Insert any serializable object
@@ -104,7 +106,7 @@ class ProcessedData(dj.Manual):
104106 name = "blob"
105107
106108 def get_dtype (self , is_store : bool ) -> str :
107- """Return bytes for internal , <hash> for external storage."""
109+ """Return bytes for in-table , <hash> for in-store storage."""
108110 return "<hash>" if is_store else "bytes"
109111
110112 def encode (self , value : Any , * , key : dict | None = None , store_name : str | None = None ) -> bytes :
@@ -165,9 +167,9 @@ class RawContent(dj.Manual):
165167 name = "hash"
166168
167169 def get_dtype (self , is_store : bool ) -> str :
168- """Hash storage is external only."""
170+ """Hash storage is in-store only."""
169171 if not is_store :
170- raise DataJointError ("<hash> requires @ (external storage only)" )
172+ raise DataJointError ("<hash> requires @ (in-store storage only)" )
171173 return "json"
172174
173175 def encode (self , value : bytes , * , key : dict | None = None , store_name : str | None = None ) -> dict :
@@ -608,9 +610,9 @@ class AttachCodec(Codec):
608610 """
609611 File attachment with filename preserved.
610612
611- Supports both internal and external storage:
613+ Supports both in-table and in-store storage:
612614 - ``<attach>``: Stored in database (bytes → LONGBLOB)
613- - ``<attach@>``: Stored externally via ``<hash@>`` with deduplication
615+ - ``<attach@>``: Stored in object store via ``<hash@>`` with deduplication
614616 - ``<attach@store>``: Stored in specific named store
615617
616618 The filename is preserved and the file is extracted to the configured
@@ -623,9 +625,9 @@ class Documents(dj.Manual):
623625 definition = '''
624626 doc_id : int
625627 ---
626- config : <attach> # internal (small file in DB)
627- dataset : <attach@> # external (default store)
628- archive : <attach@cold> # external (specific store)
628+ config : <attach> # in-table (small file in DB)
629+ dataset : <attach@> # in-store (default store)
630+ archive : <attach@cold> # in-store (specific store)
629631 '''
630632
631633 # Insert a file
@@ -642,7 +644,7 @@ class Documents(dj.Manual):
642644 name = "attach"
643645
644646 def get_dtype (self , is_store : bool ) -> str :
645- """Return bytes for internal , <hash> for external storage."""
647+ """Return bytes for in-table , <hash> for in-store storage."""
646648 return "<hash>" if is_store else "bytes"
647649
648650 def encode (self , value : Any , * , key : dict | None = None , store_name : str | None = None ) -> bytes :
0 commit comments