charlieMultiappindex.ts5 matches
2import { MainLayout } from '../../layouts/MainLayout';
3import { AppConfig, AppContext } from '../registry';
4import { initAppDatabase } from '../../utils/db';
5import { sqlite } from "https://esm.town/v/std/sqlite";
680`;
8182// Setup database schema
83const SCHEMA = `
84CREATE TABLE IF NOT EXISTS questie_quests (
92`;
9394// Initialize the database
95initAppDatabase('questie', SCHEMA);
9697// Questie app handler
115const status = formData.get('status') || 'pending';
116
117// Save the new quest to database
118await sqlite.execute(
119`INSERT INTO questie_quests (email, title, description, status) VALUES (?, ?, ?, ?)`,
charlieMultiappDetail.ts1 match
89export async function QuestieDetail({ email, questId }: QuestieDetailProps) {
10// Fetch quest details from the database
11let quest = null;
12
charlieMultiappList.ts1 match
78export async function QuestieList({ email }: QuestieListProps) {
9// Fetch quests from the database
10let quests = [];
11try {
charlieMultiappdb.ts4 matches
1import { sqlite } from "https://esm.town/v/std/sqlite";
23// Helper function to initialize an app's database
4export async function initAppDatabase(appName: string, schema: string) {
5try {
6await sqlite.execute(schema);
7console.log(`Initialized database schema for ${appName}`);
8return true;
9} catch (error) {
10console.error(`Error initializing database for ${appName}:`, error);
11return false;
12}
cerebras_coderindex2 matches
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
45async function servePublicFile(path: string): Promise<Response> {
invitationTrackerDbmain.tsx1 match
4const SCHEMA_VERSION = 1;
56// Initialize the database
7async function initDB() {
8await sqlite.execute(`
CyberMetaxmain.tsx2 matches
91},
92{
93name: "database_schema.sql",
94type: "database_schema",
95content: `
96CREATE TABLE users (
345346try {
347// Initialize database with enhanced error handling and add cache table
348await sqlite.execute(`
349CREATE TABLE IF NOT EXISTS ${KEY}_tools_${SCHEMA_VERSION} (
382`);
383384serverLog("INFO", "Database initialized successfully", {
385key: KEY,
386schemaVersion: SCHEMA_VERSION,
387});
388} catch (dbInitError) {
389serverLog("ERROR", "Database initialization failed", {
390error: dbInitError instanceof Error ? dbInitError.message : String(dbInitError),
391key: KEY,
393return new Response(
394JSON.stringify({
395error: "Database initialization failed",
396details: String(dbInitError),
397}),
730const finalTool = oracleResponse.tool || maverickResponse.tool;
731732// Store the tool in the database
733const toolId = finalTool.id || crypto.randomUUID();
734await sqlite.execute(
793const toolResponse: ToolResponse = JSON.parse(agentBContent);
794795// Store the tool request and response in the database
796const requestId = crypto.randomUUID();
797await sqlite.execute(
926const toolResponse: ToolResponse = JSON.parse(completionContent);
927928// Store the tool request and response in the database
929const requestId = toolRequest.id || crypto.randomUUID();
930await sqlite.execute(
1297}
12981299// If creating a tool, store it in the database
1300if (agentResponse.actionType === "create_tool" && agentResponse.tool) {
1301const toolId = agentResponse.tool.id || crypto.randomUUID();
cerebras_coderindex2 matches
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
45async function servePublicFile(path: string): Promise<Response> {
cerebras_coderindex2 matches
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
45async function servePublicFile(path: string): Promise<Response> {