Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Burl%7D?q=database&page=656&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=database

Returns an array of strings in format "username" or "username/projectName"

Found 7182 results for "database"(746ms)

charlieMultiappindex.ts5 matches

@dcm31•Updated 2 months ago
2import { MainLayout } from '../../layouts/MainLayout';
3import { AppConfig, AppContext } from '../registry';
4import { initAppDatabase } from '../../utils/db';
5import { sqlite } from "https://esm.town/v/std/sqlite";
6
80`;
81
82// Setup database schema
83const SCHEMA = `
84CREATE TABLE IF NOT EXISTS questie_quests (
92`;
93
94// Initialize the database
95initAppDatabase('questie', SCHEMA);
96
97// Questie app handler
115 const status = formData.get('status') || 'pending';
116
117 // Save the new quest to database
118 await sqlite.execute(
119 `INSERT INTO questie_quests (email, title, description, status) VALUES (?, ?, ?, ?)`,

charlieMultiappDetail.ts1 match

@dcm31•Updated 2 months ago
8
9export async function QuestieDetail({ email, questId }: QuestieDetailProps) {
10 // Fetch quest details from the database
11 let quest = null;
12

charlieMultiappList.ts1 match

@dcm31•Updated 2 months ago
7
8export async function QuestieList({ email }: QuestieListProps) {
9 // Fetch quests from the database
10 let quests = [];
11 try {

charlieMultiappdb.ts4 matches

@dcm31•Updated 2 months ago
1import { sqlite } from "https://esm.town/v/std/sqlite";
2
3// Helper function to initialize an app's database
4export async function initAppDatabase(appName: string, schema: string) {
5 try {
6 await sqlite.execute(schema);
7 console.log(`Initialized database schema for ${appName}`);
8 return true;
9 } catch (error) {
10 console.error(`Error initializing database for ${appName}:`, error);
11 return false;
12 }

cerebras_coderindex2 matches

@Miraj•Updated 2 months ago
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
4
5async function servePublicFile(path: string): Promise<Response> {

invitationTrackerDbmain.tsx1 match

@prashamtrivedi•Updated 2 months ago
4const SCHEMA_VERSION = 1;
5
6// Initialize the database
7async function initDB() {
8 await sqlite.execute(`

CyberMetaxmain.tsx2 matches

@CyberK14•Updated 2 months ago
91 },
92 {
93 name: "database_schema.sql",
94 type: "database_schema",
95 content: `
96CREATE TABLE users (

mandomain.tsx8 matches

@api•Updated 2 months ago
345
346 try {
347 // Initialize database with enhanced error handling and add cache table
348 await sqlite.execute(`
349 CREATE TABLE IF NOT EXISTS ${KEY}_tools_${SCHEMA_VERSION} (
382 `);
383
384 serverLog("INFO", "Database initialized successfully", {
385 key: KEY,
386 schemaVersion: SCHEMA_VERSION,
387 });
388 } catch (dbInitError) {
389 serverLog("ERROR", "Database initialization failed", {
390 error: dbInitError instanceof Error ? dbInitError.message : String(dbInitError),
391 key: KEY,
393 return new Response(
394 JSON.stringify({
395 error: "Database initialization failed",
396 details: String(dbInitError),
397 }),
730 const finalTool = oracleResponse.tool || maverickResponse.tool;
731
732 // Store the tool in the database
733 const toolId = finalTool.id || crypto.randomUUID();
734 await sqlite.execute(
793 const toolResponse: ToolResponse = JSON.parse(agentBContent);
794
795 // Store the tool request and response in the database
796 const requestId = crypto.randomUUID();
797 await sqlite.execute(
926 const toolResponse: ToolResponse = JSON.parse(completionContent);
927
928 // Store the tool request and response in the database
929 const requestId = toolRequest.id || crypto.randomUUID();
930 await sqlite.execute(
1297 }
1298
1299 // If creating a tool, store it in the database
1300 if (agentResponse.actionType === "create_tool" && agentResponse.tool) {
1301 const toolId = agentResponse.tool.id || crypto.randomUUID();
cerebras_coder

cerebras_coderindex2 matches

@Proking2005•Updated 2 months ago
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
4
5async function servePublicFile(path: string): Promise<Response> {

cerebras_coderindex2 matches

@speedadd•Updated 2 months ago
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
4
5async function servePublicFile(path: string): Promise<Response> {

bookmarksDatabase

@s3thi•Updated 3 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 6 months ago