OINO TS
    Preparing search index...

    Class OINONoSqlAzureTable

    Azure Table Storage implementation of OINONoSql.

    Authenticates using either an Azure Storage connection string or a table service endpoint URL combined with a managed identity client id. Connection parameters map as:

    • credentials.url → table service endpoint, e.g. https://<account>.table.core.windows.net
    • credentials.connectionStr → Azure Storage connection string (e.g. DefaultEndpointsProtocol=https;AccountName=...)
    • credentials.clientId → (optional) managed identity client id used with credentials.url
    • params.table → table name

    Register and use via the factory with a connection string:

    import { OINONoSqlFactory } from "@oino-ts/nosql"
    import { OINONoSqlAzureTable } from "@oino-ts/nosql-azure"

    OINONoSqlFactory.registerNoSql("OINONoSqlAzureTable", OINONoSqlAzureTable)

    const nosql = await OINONoSqlFactory.createNoSql({
    type: "OINONoSqlAzureTable",
    table: "myTable",
    credentials: { connectionStr: process.env.AZURE_STORAGE_CONNECTION_STRING }
    })
    const api = await OINONoSqlFactory.createApi(nosql, {
    apiName: "entities",
    tableName: "myTable"
    })

    Or with a service endpoint URL and a managed identity client id:

    const nosql = await OINONoSqlFactory.createNoSql({
    type: "OINONoSqlAzureTable",
    table: "myTable",
    credentials: {
    url: "https://myaccount.table.core.windows.net",
    clientId: process.env.AZURE_MANAGED_IDENTITY_CLIENT_ID
    }
    })

    Set staticPartitionKey in the params to scope all operations to a fixed partition key. This lets multiple logical tables share one physical Azure Table Storage table:

    const nosql = await OINONoSqlFactory.createNoSql({
    type: "OINONoSqlAzureTable",
    url: "https://myaccount.table.core.windows.net",
    table: "sharedTable",
    connectionStr: process.env.AZURE_STORAGE_CONNECTION_STRING,
    staticPartitionKey: "myLogicalTable"
    })

    Filters on partitionKey, rowKey, and timestamp are translated to native Azure Table Storage OData query filter expressions and evaluated server-side. Filters on etag are evaluated in-memory after the listing.

    OData operators supported: eq, ne, lt, le, gt, ge, and, or, not. The like operator is not supported by OData and is evaluated in-memory.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    isConnected: boolean = false
    isValidated: boolean = false
    name: string

    Table name

    supportsAutoKey: boolean = false

    Whether this backend can auto-generate primary key values when none are supplied in a POST request. Defaults to false; override in subclasses that support server-side key generation (e.g. UUID on insert).

    Methods

    • Coerce a single data value into a form that can safely be passed to the datasource as a bind parameter (as opposed to printCellAsValue, which formats it as an inline SQL literal).

      The default implementation returns the value unchanged. SQL datasources override this to apply driver-specific coercions (e.g. converting Date/boolean for drivers that only accept primitive bind types). Non-SQL datasources (blob, nosql) can ignore it.

      Parameters

      • cellValue: OINODataCell

        data value to bind

      • nativeType: string

        native type name for the table column

      Returns OINODataCell

    • Print a single data value from serialization using the context of the native data type with the correct SQL escaping.

      Parameters

      • cellValue: OINODataCell

        data from sql results

      • nativeType: string

        native type name for table column

      Returns string

    • Batch-upsert using Azure Table Storage transactions. Each transaction is limited to 100 entities that share the same partition key, and Azure additionally requires every entity in a transaction to have a distinct row key ("An entity can appear only once in a batch request"). Entries are therefore grouped by partition key and deduplicated by row key — later entries replace earlier ones (last-write-wins, matching the upsert-Replace semantics) — before being chunked to satisfy the limit.

      Parameters

      Returns Promise<void>

    • Attempt to translate an OINOQueryFilter tree to an Azure Table Storage OData v3 filter expression string.

      Returns undefined for sub-trees that contain untranslatable predicates (e.g. filter on etag, or a like comparison). The caller falls back to in-memory evaluation for those cases.

      Parameters

      Returns string