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/?q=database&page=254&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 2800 results for "database"(377ms)

OpenTowniesystem_prompt.txt2 matches

@neverstewβ€’Updated 3 weeks ago
166```
167β”œβ”€β”€ backend/
168β”‚ β”œβ”€β”€ database/
169β”‚ β”‚ β”œβ”€β”€ migrations.ts # Schema definitions
170β”‚ β”‚ β”œβ”€β”€ queries.ts # DB query functions
228- Handle API calls properly with proper error catching
229
230### Database Patterns
231- Run migrations on startup or comment out for performance
232- Change table names when modifying schemas rather than altering

blogpostmortem-db-migration-april-2.md5 matches

@jxnblkβ€’Updated 3 weeks ago
1---
2title: "Post-mortem: A Backward Incompatible Database Migration"
3description: Val runs failed due to a database migration that was not backward compatible
4pubDate: 2025-04-02T00:00:00.000Z
5author: Sophie Houser
6---
7
8Today at 10:11am we experienced a 12-minute outage, which caused HTTP vals to return 503 errors and other types of vals to fail. In the end, the root cause was a deployment timing issue where database migrations were deployed successfully, but our application code deployment hung for several minutes. The new database migrations were incompatible with the old application code and crashed the process.
9
10We aim to make all database migrations maintain backward compatibility, but in this case, we only discovered through the delayed deployment feedback that the new migrations were not compatible with previous versions.
11
12## Timeline
27## Next Steps
28
29Reliability is important to us and we’ve taken steps to make sure this doesn’t happen again. We’ve added a test to ensure database migrations are backward compatible, which we’ll run before we deploy any new code that includes database migrations.

stevekrouse_dot_comhomepage.tsx1 match

@stevekrouseβ€’Updated 3 weeks ago
13 todayHits = hits.todayHits;
14 } catch (e) {
15 console.log("Caught database error: ", e);
16 }
17 return new Response(

cerebras_coderindex2 matches

@Bikβ€’Updated 3 weeks 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

@llmβ€’Updated 3 weeks 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> {

bhaavsynthlandipgpagemain.tsx1 match

@prashamtrivediβ€’Updated 3 weeks ago
414 const SCHEMA_VERSION = 1;
415
416 // Save email to database
417 await sqlite.execute(`
418 CREATE TABLE IF NOT EXISTS ${KEY}_signups_${SCHEMA_VERSION} (

cerebras_coderindex2 matches

@adsissuesβ€’Updated 3 weeks 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> {

OpenTownieTODOs.md1 match

@k7dβ€’Updated 4 weeks ago
13- [ ] Rebuild as React Router?
14- [ ] opentownie as a pr bot
15- [ ] give it the ability to see its own client-side and server-side logs by building a middleware that shoves them into a SQL light database date and then give it a tool to access them or use our trpc API in that tool
16- [ ] do a browser use or screenshot thing to give it access to its own visual output
17- [ ] Have it default to creating a new branch off main and then embedding and iframe to the resulting http val and give you a link to a pr opening url

OpenTowniethink.ts1 match

@k7dβ€’Updated 4 weeks ago
7export const thinkTool = tool({
8 description:
9 "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
10 parameters: z.object({
11 thought: z.string().describe("A thought to think about."),

OpenTowniesystem_prompt.txt2 matches

@k7dβ€’Updated 4 weeks ago
166```
167β”œβ”€β”€ backend/
168β”‚ β”œβ”€β”€ database/
169β”‚ β”‚ β”œβ”€β”€ migrations.ts # Schema definitions
170β”‚ β”‚ β”œβ”€β”€ queries.ts # DB query functions
228- Handle API calls properly with proper error catching
229
230### Database Patterns
231- Run migrations on startup or comment out for performance
232- Change table names when modifying schemas rather than altering