Recollect.Export (recollect v0.5.1)

Copy Markdown View Source

Export Recollect data to a portable format for migration or backup.

Supports exporting all Recollect tables to JSONL format, which can then be imported into any supported database backend (PostgreSQL or libSQL).

Usage

# Export all data
Recollect.Export.export_all("/path/to/backup.jsonl")

# Export specific tables
Recollect.Export.export_table(:recollect_entries, "/path/to/entries.jsonl")

Export Format

Data is exported as JSON Lines (JSONL), where each line is a JSON object representing one row with metadata about its table and schema version.

Example:

{"table": "recollect_entries", "version": "0.2.0", "data": {"id": "...", "content": "..."}}
{"table": "recollect_chunks", "version": "0.2.0", "data": {"id": "...", "content": "..."}}

Summary

Functions

Export all Recollect tables to a JSONL file.

Export a single table to a JSONL file.

Functions

export_all(path, opts \\ [])

Export all Recollect tables to a JSONL file.

Options

  • :batch_size — Number of rows to fetch per query (default: 1000)
  • :tables — List of tables to export (default: all)
  • :scope_id — Optional scope filter for multi-tenant exports
  • :owner_id — Optional owner filter for user-specific exports

Example

Recollect.Export.export_all("/tmp/recollect_backup.jsonl")
# {:ok, %{bytes: 1234567, tables: 8, rows: 15432}}

export_table(table, path, opts \\ [])

Export a single table to a JSONL file.

Example

Recollect.Export.export_table(:recollect_entries, "/tmp/entries.jsonl")