FILE Columns & Uploads
@kalamdb/client supports file upload and retrieval patterns for KalamDB FILE columns.
Upload files with SQL
Use queryWithFiles(sql, files, params?, onProgress?):
Insert + read FileRefs (end-to-end)
Progress callback
In browser environments (XMLHttpRequest available), pass onProgress:
Auth behavior
From source:
- SDK builds auth header via
buildAuthHeader(auth) - sends multipart request to
POST /v1/api/sql - falls back to
fetchwhen XHR progress is unavailable
FileRef model
file_ref.ts exposes FileRef and helpers:
Parse and use file metadata
When rows come from queryOne/queryAll, FILE values are KalamCellValue:
Build download URL
Type helpers
Storage-path internals documented by source
FileRef includes:
id,sub,name,size,mime,sha256, optionalshard- filename sanitization and extension normalization
- shared-table shard-aware
relativePath()generation
This is useful for building file galleries, attachment viewers, and audit tooling.
Last updated on