import { Pool } from "mariadb"; import { AbstractBatchEntityWriterStream, AbstractBatchEntityWriterStreamOptions } from "../../common/index"; import { BatchData } from "batchjs"; /** * @interface * Options for the MariadbBatchEntityWriter. * @extends AbstractBatchEntityWriterStreamOptions * @template T chunk entity * @template E row entity */ export interface MariadbBatchEntityWriterOptions extends AbstractBatchEntityWriterStreamOptions { pool: Pool; prepareStatement: string; entityToRow: (entity: T) => E; } /** * @class * Class that writes data in batches of a specified size in MariadbQL databases. * @extends AbstractBatchEntityWriterStream * @template T chunk entity * @template E row entity */ export declare class MariadbBatchEntityWriter extends AbstractBatchEntityWriterStream { private readonly pool; private readonly prepareStatement; private readonly entityToRow; /** * @constructor * @param {MariadbBatchEntityWriterOptions} options - The options for the MariadbBatchEntityWriter. * @param [options.pool] {Pool} - The MariadbQL connection pool. * @param [options.prepareStatement] {String} - Insert SQL prepared statement to be executed. * @param [options.entityToRow] {Function} - Function that converts an entity to a row. */ constructor(options: MariadbBatchEntityWriterOptions); /** * Writes a batch of data to the storage. * * @protected * @param {BatchData} chunk - The batch of data to write to the storage. * @returns {Promise} */ protected batchWrite(chunk: BatchData): Promise; }