/**
* Returns a query builder for a RelationalDb instance.
* @param query The RelationalDb instance to convert.
* @returns The IRelationalQueryBuilder instance.
*/
function relationalDbToQueryBuilder(query) {
	return {
		selectFrom: query.selectFrom.bind(query),
		selectNoFrom: query.selectNoFrom.bind(query),
		with: query.with.bind(query),
		withRecursive: query.withRecursive.bind(query),
		withSchema: (schema) => relationalDbToQueryBuilder(query.withSchema(schema))
	};
}
const IS_RELATIONAL_DB_PROCESSOR = Symbol.for("ph.IS_RELATIONAL_DB_PROCESSOR");
/**
* Base class for relational db processors that require a relational database storage.
* This class abstracts database initialization, migration management, and resource cleanup,
* allowing derived classes to focus on business logic.
*/
var RelationalDbProcessor = class {
	constructor(_namespace, _filter, relationalDb) {
		this._namespace = _namespace;
		this._filter = _filter;
		this.relationalDb = relationalDb;
	}
	static [IS_RELATIONAL_DB_PROCESSOR] = true;
	/**
	* Returns the namespace for a given drive id.
	* This method can be overridden by derived classes to provide a custom namespace.
	*/
	static getNamespace(driveId) {
		return `${this.name}_${driveId.replaceAll("-", "_")}`;
	}
	static query(driveId, db) {
		return db.queryNamespace(this.getNamespace(driveId));
	}
	/**
	* Returns the filter for the processor.
	* This method can be overridden by derived classes to provide a custom filter.
	*/
	get filter() {
		return this._filter;
	}
	/**
	* Returns the namespace used by the processor.
	*/
	get namespace() {
		return this._namespace;
	}
	get query() {
		return relationalDbToQueryBuilder(this.relationalDb);
	}
};
//#endregion
export { RelationalDbProcessor as t };

//# sourceMappingURL=processors-BVthHO9C.js.map