LottaDB.Tiki
Tiki.Net integration for LottaDB β auto-extract rich metadata from blobs on upload.
Install
| Product | Versions |
|---|---|
| .NET |
README
![]()
LottaDB.Tiki
Rich blob metadata extraction for LottaDB, powered by Tiki.Net.
When you upload a blob, Tiki.Net automatically parses it and stores strongly-typed metadata (EXIF from photos, ID3 from music, page counts from PDFs, etc.) as queryable entities in LottaDB.
Installation
dotnet add package LottaDB.Tiki
Quick Start
using Lotta;
using Lotta.Tiki;
var catalog = new LottaCatalog("myapp", connectionString);
var db = await catalog.GetDatabaseAsync("media", config =>
{
config.UseTikiExtraction(); // one line to enable
});
// Upload a photo β metadata is extracted automatically
await using var stream = File.OpenRead("vacation.jpg");
var photo = (BlobPhoto) await db.UploadBlobAsync("photos/vacation.jpg", stream);
// Rich metadata is available immediately
Console.WriteLine($"Camera: {photo.CameraModel}");
Console.WriteLine($"ISO: {photo.IsoSpeed}");
Console.WriteLine($"Size: {photo.Width}x{photo.Height}");
How It Works
UseTikiExtraction() registers an OnUpload handler that:
- Receives the blob content as a concurrent stream (zero-copy via TeeStream)
- Parses it with Tiki.Net's auto-detecting parser
- Maps the result to the correct
BlobFilesubtype - Saves the metadata entity β queryable and full-text searchable
The blob upload and parsing happen concurrently β no buffering the entire file in memory.
Querying Metadata
All metadata properties are queryable via LINQ and Lucene:
// Find high-ISO photos
var nightPhotos = db.Search<BlobPhoto>(p => p.IsoSpeed > 3200).ToList();
// Find large PDFs
var bigDocs = db.Search<BlobDocument>(p => p.PageCount > 50).ToList();
// Find music by artist
var songs = db.Search<BlobMusic>(m => m.Artist == "Pink Floyd").ToList();
// Full-text search across extracted document content
var results = db.Search<BlobFile>("quarterly revenue").ToList();
// Polymorphic β returns all file types
var allFiles = db.Search<BlobFile>().ToList();
Supported File Types
| File Type | BlobFile Subtype | Extracted Metadata |
|---|---|---|
| JPEG, PNG, TIFF, etc. | BlobPhoto |
Camera, ISO, aperture, focal length, GPS, dimensions |
| PDF, DOCX, DOC, RTF | BlobDocument |
Page count, word count, author, company, text content |
| XLSX, XLS | BlobSpreadsheet |
Sheet count, sheet names |
| PPTX, PPT | BlobPresentation |
Slide count |
| MP3, FLAC, WAV, OGG | BlobMusic |
Artist, album, track, year, genre, duration |
| MP4, AVI, MKV, MOV | BlobVideo |
Resolution, frame rate, codec, duration |
| EML | BlobMessage |
From, to, subject, date sent |
| HTML | BlobWebPage |
Language, charset, links |
Text content is automatically extracted and indexed for full-text search.
Configuration
// Default β uses auto-configured TikiEngine
config.UseTikiExtraction();
// Custom engine with specific parsers
var engine = new TikiEngine(TikiConfig.CreateBuilder()
.AddParser(new PdfParser())
.AddParser(new ImageParser())
.Build());
config.UseTikiExtraction(engine);
BlobFile Convenience Methods
var file = await db.GetAsync<BlobPhoto>("photos/vacation.jpg");
// Download the blob content
Stream? stream = await file.DownloadAsync();
// Delete blob + metadata in one call
await file.DeleteAsync();
Without Tiki (Default Handler)
LottaDB includes a built-in default handler that doesn't require Tiki.Net:
config.OnUpload(); // uses file extension for type detection
This gives you:
- File extension to MIME type mapping
- Correct
BlobFilesubtype (BlobPhoto for .jpg, BlobDocument for .pdf, etc.) - Text content extraction for known text formats (.txt, .md, .json, .cs, .py, etc.)
- Basic metadata (path, name, folder, media type, content length)
The Tiki handler adds deep content parsing (EXIF, ID3 tags, page counts, etc.) on top.
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.