ol.trixnity.repo

Built-in repository helpers for the sqlite4clj-backed repository setup.

Most callers do not need to interact with the raw repository handle or the Kotlin bridge types directly. Use sqlite4clj-config with ol.trixnity.client/open.

Advanced callers can still build a MatrixClient with some other repository implementation and pass that client to ol.trixnity.client/open via ::mx/client.

sqlite4clj-config

(sqlite4clj-config options)

Returns config entries for the built-in sqlite4clj repository and okio media store.

Prefer the namespaced keys from ol.trixnity.schemas. Plain keywords are still accepted here as a convenience when normalizing app config.

Options:

| key | description |-----|------------- | ::mx/database-path | SQLite file path used by ol.trixnity.repo | ::mx/media-path | Directory used by the okio-backed media store

Example:

(m/? (client/open
      (merge
       {::mx/homeserver-url "https://matrix.example.org"
        ::mx/username "bot"
        ::mx/password "secret"}
       (repo/sqlite4clj-config
        {::mx/database-path "./var/trixnity.sqlite"
         ::mx/media-path "./var/media"}))))

open-handle!

(open-handle! path json)

Opens a low-level sqlite4clj repository handle for path.

Most callers should prefer sqlite4clj-config with ol.trixnity.client/open. This is the lower-level escape hatch used by the built-in repository assembly.


create-repositories

(create-repositories handle mappings)

Builds the repository map expected by the Kotlin bridge from handle.

This is primarily a low-level integration seam for custom client assembly. Most callers should use sqlite4clj-config instead of constructing this map directly.