UNPKG

forge-sql-orm

Version:

Drizzle ORM integration for Atlassian @forge/sql. Provides a custom driver, schema migration, two levels of caching (local and global via @forge/kvs), optimistic locking, and query analysis.

30 lines 1.32 kB
import { TriggerResponse } from "./index"; /** * ⚠️ DEVELOPMENT ONLY WEB TRIGGER ⚠️ * * This web trigger retrieves the current database schema from Atlassian Forge SQL. * It generates SQL statements that can be used to recreate the database structure. * * @warning This trigger should ONLY be used in development environments. It: * - Exposes your database structure * - Disables foreign key checks temporarily * - Generates SQL that could potentially be used maliciously * - May expose sensitive table names and structures * * @note This function is automatically disabled in production environments and will return a 500 error if called. * * @returns {Promise<TriggerResponse<string>>} A response containing SQL statements to recreate the database schema * - On success: Returns 200 status with SQL statements * - On failure: Returns 500 status with error message (including when called in production) * * @example * ```typescript * // The response will contain SQL statements like: * // SET foreign_key_checks = 0; * // CREATE TABLE IF NOT EXISTS users (...); * // CREATE TABLE IF NOT EXISTS orders (...); * // SET foreign_key_checks = 1; * ``` */ export declare function fetchSchemaWebTrigger(): Promise<TriggerResponse<string>>; //# sourceMappingURL=fetchSchemaWebTrigger.d.ts.map