Function odataSource

  • Adapter factory for an OData v4 entity set.

    Query.where compiles to OData $filter, Query.outFields becomes $select, Query.orderBy becomes $orderby, and Query.pagination becomes $top/$skip. Geospatial filters translate to OData's geo.intersects / geo.distance family.

    Type Parameters

    • T

    Parameters

    Returns CapabilityAwareSource<T>

    const dataset = createDataset({
    id: "incidents",
    client,
    sources: [{
    id: "incidents",
    protocol: "odata",
    locator: { url: "https://your-honua-server.example/odata", entitySet: "Incidents" },
    capabilities: PROTOCOL_DEFAULT_CAPABILITIES.odata,
    }],
    });
    const result = await dataset.source("incidents")!.queryAll({
    where: "Severity ge 3",
    orderBy: [{ field: "ReportedAt", direction: "desc" }],
    pagination: { limit: 100 },
    });