Files
jerapah-flow/packages/server/db.js
nsrb 5574d6f723 feat: implement database setup, logging, and workflow management
- Added database configuration and migration setup using Knex.
- Implemented a logging system with Pino, including log persistence and flushing.
- Created a server runner with Fastify, integrating authentication and various API routes.
- Introduced a script sandbox for executing user-defined scripts with restricted access.
- Established initial workflows and scripts for manual and cron triggers.
- Included documentation for API endpoints and workflows.
2026-08-14 14:22:27 +07:00

12 lines
237 B
JavaScript

import knex from "knex";
import config from "./knexfile.js";
export const db = knex(config);
/**
* Apply pending migrations. Call once before registering workflows.
*/
export async function migrate() {
await db.migrate.latest();
}