/** * Shared Database Utilities * * Functions shared between SQLite and PostgreSQL adapters. * Extracted to eliminate duplication. */ import type { CollectionConfig, DocumentStatus } from '@momentumcms/core'; /** * Validates that a collection slug is safe for use in SQL. * Prevents potential SQL injection via table names. */ export declare function validateCollectionSlug(slug: string): void; /** * Validates that a column name is safe for use in SQL. * Prevents SQL injection via column name interpolation. */ export declare function validateColumnName(name: string): void; /** * Resolves the actual database table name for a collection. * Uses dbName if specified, falls back to slug. */ export declare function getTableName(collection: CollectionConfig): string; /** * Type guard to check if a value is a valid DocumentStatus. */ export declare function isDocumentStatus(value: unknown): value is DocumentStatus; /** * Safely extract status from a database row. */ export declare function getStatusFromRow(row: Record): DocumentStatus; /** * Safely parse JSON to Record. */ export declare function parseJsonToRecord(jsonString: string): Record; /** * Type guard to check if a value is a record object. */ export declare function isRecord(value: unknown): value is Record;