Summary#
A provider is normally Osy#: a class in a package that implements a seam. When what it needs cannot be reached from
Osy# — a vendor driver with no HTTP API, a proprietary library — it can be written in C# instead, against the same seam.
osy seam generate writes that seam as C#: the interface and every class it carries, with the platform's documentation,
stamped with the seam's hash.
Signature#
osy seam generate <interface> [-o <file>] [--json]Description#
What it writes#
The seam as this platform declares it in Osy#, read from the platform itself — no repository, no account. A method
that answers nothing returns Task, one that answers a value Task<T>, and one that streams IAsyncEnumerable<T>;
every method takes a trailing CancellationToken. The classes a seam carries — a query plan, a batch of changes — are
plain classes of text, numbers, bools, dates, ids, byte[], enums, lists and string-keyed dictionaries.
Without -o the C# is printed; with it, written to the file. --json prints the seam, its hash and the file.
The file is self-contained. It declares the [SeamHash] attribute beside the seam, so the provider's project references
nothing of the platform's: compile it into the project that implements the seam.
The seam hash#
The interface carries [SeamHash("…")]: a hash of every member's name, type and default in the Osy# declaration, and
of nothing a comment says. A provider built against one hash is refused by a platform whose seam has another, naming
the package, the seam and both hashes — before it serves anything. So regenerate after upgrading the toolchain, and
rebuild the provider.
Where a native provider may run#
Native code runs on dedicated and self-hosted platforms, where the only tenant it can affect is the one who chose it. A
package ships the assembly with its manifest's native role and declares the class as a native class.
A deploy to shared hosting refuses a native package, naming the tiers that run it.
Examples#
osy seam generate IEntitySource -o src/Seams/EntitySource.g.csosy seam generate IBlobStore --jsonSee also#
- data held somewhere else (app.DataSources) — the seam a data source implements
- data sent somewhere else, as it changes (app.Exports) — the seam an export sink implements
- The local loop (running your app on your own machine) — the other commands of the local toolchain