Esposter
    Preparing search index...

    Module @esposter/db - v2.25.0

    @esposter/db

    Apache-2.0 licensed

    Database connection utilities for Esposter — server environment only. Provides composables for Drizzle ORM (PostgreSQL), Azure Table Storage, Azure Blob Storage, Azure AI Search, and Azure WebPubSub.


    We highly recommend you take a look at the documentation to level up.

    Composable / Service Description
    Drizzle (PostgreSQL) drizzle-orm client wired to the DATABASE_URL connection string
    Azure Table Storage useTableClient — creates a typed TableClient for a given table name
    Azure Blob Storage useBlobServiceClient — creates a BlobServiceClient
    Azure AI Search useSearchIndexClient — creates a typed SearchIndexClient
    Azure WebPubSub useWebPubSubServiceClient — creates a WebPubSubServiceClient
    Link preview getLinkPreview — fetches Open Graph metadata from a URL
    • Server-only: this package must not be imported in browser code.
    • Depends on @esposter/db-schema for Drizzle relation and schema definitions.
    • Azure clients currently use the credential form required by each caller. Some app-facing paths still use connection strings or keys because the main app is hosted outside Azure and does not have managed identity.

    Run from packages/db/:

    pnpm build        # compile to dist/
    pnpm test # vitest watch mode
    pnpm coverage # vitest run --coverage
    pnpm lint:fix # auto-fix lint
    pnpm typecheck # type check

    This project is licensed under the Apache-2.0 license.

    Type Aliases

    MentionConditionBuilder

    Variables

    AZURE_DEFAULT_PARTITION_KEY
    CLAUSE_REGEX
    ContentTypes
    dayjs
    KeysToCapitalize
    KeysToUncapitalize
    MentionNotificationConditionBuilders
    RangeOperators

    Functions

    addMessageMetadata
    cloneBlobUrls
    cloneDirectory
    cloneFiles
    createEntity
    createMessage
    deleteDirectory
    deleteEntity
    deleteFiles
    deserializeClause
    deserializeEntity
    deserializeKey
    deserializeValue
    filtersToClauses
    generateDownloadFileSasUrls
    generateUploadFileSasEntities
    getBlobName
    getBroadcastMentionConditions
    getBroadcastNotificationCondition
    getContainerClient
    getEntity
    getIsSerializable
    getLinkPreviewResponse
    getMentionNotificationConditions
    getPushSubscriptionsForMessage
    getPushSubscriptionsForUser
    getRoleMemberIds
    getRoleMentionCondition
    getSearchNonNullClause
    getSearchNullClause
    getTableClient
    getTableNullClause
    getTopNEntities
    getTopNEntitiesByType
    getUserMentionCondition
    getVersionPath
    getWebPubSubServiceClient
    serializeClause
    serializeClauses
    serializeEntity
    serializeKey
    syncProperties
    updateEntity
    upsertEntity