import * as core from '@prismamedia/graphql-platform'; import * as utils from '@prismamedia/graphql-platform-utils'; import type { UUID } from 'node:crypto'; import type { MariaDBBroker } from '../../broker.js'; import type { PoolConnection } from '../../index.js'; import type { Table } from '../../schema.js'; import * as schema from '../../schema.js'; import { Event } from '../../schema/event.js'; import { StatementKind } from '../../statement.js'; import type { SelectExpression } from '../../statement/manipulation/clause/select-expression.js'; import type { TableFactor } from '../../statement/manipulation/clause/table-reference.js'; import { type WhereCondition } from '../../statement/manipulation/clause/where-condition.js'; import { AbstractTable, type Column } from '../abstract-table.js'; interface Reference { source: Column; target: schema.Column; } export interface MariaDBBrokerSubscriptionsStateTableOptions { /** * Enables subscriptions' state tracking for optimized cache invalidation. * * When enabled, store the last revalidation timestamp (revalidatedAt) and hash (etag) of every subscriptions' documents. * These informations are then used to reduce the number of changes sent to the clients that are not needed. * * @default false */ enabled?: utils.OptionalFlag; /** * Optional, the name of the column * * @default _gp_{tableName}_subscriptions_state */ name?: string; /** * Optional, the name of the event that will be used to clean up the subscriptions' state * * @default _gp_{tableName}_subscriptions_state_janitor */ janitor?: string; } export declare class MariaDBBrokerSubscriptionsStateTable extends AbstractTable { readonly targetTable: Table; readonly options?: MariaDBBrokerSubscriptionsStateTableOptions | undefined; readonly references: ReadonlyArray; constructor(broker: MariaDBBroker, targetTable: Table, options?: MariaDBBrokerSubscriptionsStateTableOptions | undefined); get janitor(): Event; setup(connection: PoolConnection): Promise; select(tableReference: TableFactor, { id }: core.ChangesSubscriptionCacheControlInputValue): SelectExpression; filter(tableReference: TableFactor, { id, ifModifiedSince, maxAge, }: core.ChangesSubscriptionCacheControlInputValue): WhereCondition; having(tableReference: TableFactor, selectionKey: string, { ifNoneMatch }: core.ChangesSubscriptionCacheControlInputValue): WhereCondition | undefined; wrap(sql: string, selectionKey: string, _cacheControl: core.ChangesSubscriptionCacheControlInputValue): string; revalidate(rows: ReadonlyArray, { id }: core.ChangesSubscriptionCacheControlInputValue, connection?: PoolConnection): Promise; unsubscribe(subscriptionId: UUID): Promise; heartbeat(subscriptionIds: Iterable): Promise; } export {}; //# sourceMappingURL=subscriptions-state.d.ts.map