import * as core from '@prismamedia/graphql-platform'; import * as utils from '@prismamedia/graphql-platform-utils'; import type { SetOptional } from 'type-fest'; import { MariaDBBrokerSubscriptionsStateTable, type MariaDBBrokerSubscriptionsStateTableOptions } from '../broker/table/subscriptions-state.js'; import type { MariaDBConnector, PoolConnection } from '../index.js'; import type { Schema } from '../schema.js'; import { StatementKind, type CreateTableStatementConfig, type DeleteStatementConfig, type InsertStatementConfig, type NormalizeStatementConfig, type UpdateStatementConfig } from '../statement.js'; import { LeafColumn, ReferenceColumnTree, type Column } from './table/column.js'; import { ForeignKey } from './table/foreign-key.js'; import { FullTextIndex, PlainIndex, PrimaryKey, UniqueIndex, type Index, type PlainIndexConfig } from './table/index.js'; export * from './table/column.js'; export * from './table/data-type.js'; export * from './table/diagnosis.js'; export * from './table/foreign-key.js'; export * from './table/index.js'; export interface TableConfig { /** * Optional, the table's name * * @default `node's name plural in snake_cased` */ name?: utils.Nillable; /** * Optional, the table's default charset * * @default `the schema's default charset` */ defaultCharset?: utils.Nillable; /** * Optional, the table's default collation * * @default `the schema's default collation` */ defaultCollation?: utils.Nillable; /** * Optional, some additional plain indexes */ indexes?: (PlainIndexConfig | ReadonlyArray)[]; /** * Optional, the subscriptions' state table configuration */ subscriptionsState?: MariaDBBrokerSubscriptionsStateTableOptions['enabled'] | MariaDBBrokerSubscriptionsStateTableOptions; } export declare class Table { readonly schema: Schema; readonly node: core.Node; readonly config?: TableConfig; readonly configPath: utils.Path; readonly name: string; /** * @see https://mariadb.com/kb/en/identifier-qualifiers/ */ readonly qualifiedName: string; readonly engine: string; readonly comment?: string; readonly defaultCharset: string; readonly defaultCollation: string; readonly columnsByLeaf: ReadonlyMap; readonly primaryKey: PrimaryKey; readonly uniqueIndexesByUniqueConstraint: ReadonlyMap; readonly uniqueIndexes: ReadonlyArray; readonly fullTextIndexes: ReadonlyArray; readonly plainIndexes: ReadonlyArray; readonly indexes: ReadonlyArray; readonly foreignKeysByEdge: ReadonlyMap; readonly foreignKeys: ReadonlyArray; constructor(schema: Schema, node: core.Node); toString(): string; get subscriptionsStateTable(): MariaDBBrokerSubscriptionsStateTable | undefined; getColumnByLeaf(leafOrName: core.Leaf | core.Leaf['name']): LeafColumn; get columnTreesByEdge(): ReadonlyMap; getColumnTreeByEdge(edge: core.Edge): ReferenceColumnTree; getColumnsByComponents(...components: ReadonlyArray): Array; get columns(): ReadonlyArray; getColumnByName(name: Column['name']): Column; getUniqueIndexByUniqueConstraint(uniqueConstraint: core.UniqueConstraint): UniqueIndex; getForeignKeyByEdge(edgeOrName: core.Edge | core.Edge['name']): ForeignKey; protected parseRow(row: utils.PlainObject, path?: utils.Path): TValue; parseJsonDocument(jsonDocument: utils.PlainObject, selection: core.NodeSelection, path?: utils.Path): TValue; create(config?: CreateTableStatementConfig, connection?: PoolConnection): Promise; dropForeignKeys(foreignKeys?: ReadonlyArray, connection?: PoolConnection): Promise; addForeignKeys(foreignKeys?: ReadonlyArray, connection?: PoolConnection): Promise; normalize(config?: NormalizeStatementConfig, connection?: PoolConnection): Promise; count(context: core.OperationContext, statement: SetOptional, connection?: PoolConnection, path?: utils.Path): Promise; find(context: core.OperationContext, statement: SetOptional, 'node'>, connection?: PoolConnection, path?: utils.Path): Promise; insert(context: core.MutationContext, statement: SetOptional, connection: PoolConnection, config?: InsertStatementConfig, path?: utils.Path): Promise; update(context: core.MutationContext, statement: SetOptional, connection: PoolConnection, config?: UpdateStatementConfig, path?: utils.Path): Promise; delete(context: core.MutationContext, statement: SetOptional, connection: PoolConnection, config?: DeleteStatementConfig, path?: utils.Path): Promise; } //# sourceMappingURL=table.d.ts.map