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/$%7Bsuccess?q=database&page=341&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 4029 results for "database"(889ms)

CyberMetaxmain.tsx2 matches

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

mandomain.tsx8 matches

@api•Updated 1 month 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 1 month 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 1 month 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

@jsy•Updated 1 month 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> {

project_updates_webhookeventsManager.ts3 matches

@shouser•Updated 1 month ago
1import ValTown from "npm:@valtown/sdk";
2import { getProjectState, getWebhooks, updateProjectState } from "./database/queries.ts";
3import { sendWebhookNotification } from "./webhookService.ts";
4const vt = new ValTown();
38 const currentFiles = await getProjectFiles(projectId);
39
40 // Get previous project state from our database
41 const previousState = await getProjectState(projectId);
42
88 }
89
90 // Update project state in database
91 await updateProjectState(projectId, currentFiles);
92 } catch (error) {

hello_worldfileDeleted.ts1 match

@shouser•Updated 1 month ago
21
22 // You could also do additional processing here based on the event
23 // For example, trigger other systems, update a database, etc.
24 return Response.json({
25 ok: true,

hello_worldfileCreated.ts1 match

@shouser•Updated 1 month ago
23
24 // You could also do additional processing here based on the event
25 // For example, trigger other systems, update a database, etc.
26 return Response.json({
27 ok: true,

project_updates_webhookqueries.ts2 matches

@shouser•Updated 1 month ago
3import { createTables, projectStatesTableName, subscriptionsTableName } from "./migrations.ts";
4
5// This will create the database table if it doesn't exist.
6// This will run every time the app starts up. You can
7// comment out this line for a modest (30ms) perforamnce improvement
8// on cold starts. It's left in to ensure the database tables are
9// automatically set up correctly for users who fork this app.
10await createTables();

todaysGrindmain.tsx3 matches

@kamalnrf•Updated 1 month ago
1const NOTION_API_KEY = Deno.env.get("NOTION_API_KEY");
2const COFFEE_TABLE_DB_ID = Deno.env.get("NOTION_COFFEE_DATABASE_ID");
3const NOTION_DATABSE_API = "https://api.notion.com/v1/databases";
4const NOTION_PAGES_API = "https://api.notion.com/v1/pages";
5
9
10if (!COFFEE_TABLE_DB_ID) {
11 throw new Error("Missing NOTION_COFFEE_DATABASE_ID");
12}
13

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago