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/%7Bresult.originalUrl%7D?q=database&page=5&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 10131 results for "database"(842ms)

social-proof.cursorrules2 matches

@Jamesllllllllllโ€ขUpdated 4 days ago
198```
199โ”œโ”€โ”€ backend/
200โ”‚ โ”œโ”€โ”€ database/
201โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
202โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
257 ```
258
259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering

tijs_orgAGENTS.md2 matches

@tijsโ€ขUpdated 4 days ago
230```
231โ”œโ”€โ”€ backend/
232โ”‚ โ”œโ”€โ”€ database/
233โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
234โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
294 ```
295
296### Database Patterns
297
298- Run migrations on startup or comment out for performance

eventsCalendarAGENTS.md2 matches

@roopโ€ขUpdated 5 days ago
198```
199โ”œโ”€โ”€ backend/
200โ”‚ โ”œโ”€โ”€ database/
201โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
202โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
257 ```
258
259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering

Therapymain.ts5 matches

@realtimeโ€ขUpdated 5 days ago
6import { Hono } from "npm:hono@4.4.12";
7
8// --- DATABASE INITIALIZATION ---
9// Establishes the necessary tables for storing session transcripts and user-defined boundaries.
10// This function is called once before the application starts handling requests.
11async function initializeDatabase() {
12 await sqlite.execute(`
13 CREATE TABLE IF NOT EXISTS sessions (
27}
28
29// Top-level await to ensure the database is ready before any requests are processed.
30await initializeDatabase();
31
32// --- AI BEHAVIORAL GUIDELINES & PROMPTS ---
435const openai = new OpenAI();
436
437// Helper to get all boundaries from the database
438async function getBoundaries() {
439 const { results } = await sqlite.execute("SELECT id, topic FROM boundaries");
221. User must be authenticated (Google OAuth via LastLogin)
232. System extracts user's email from authentication context
243. Queries `GLANCE_DEMOS_DB_ID` database for user's record
254. **If user found**: Extracts redirect URL and redirects to personal URL
265. **If user not found**: Creates new user record and redirects to `/thanks`
27
28### Database Requirements
29The `GLANCE_DEMOS_DB_ID` database must contain:
30- **Email property**: User's email address (exact match with authenticated email)
31- **URL property**: User's redirect URL (optional for new users)
39- **Missing URL**: Returns JSON error with debugging information
40- **Invalid URL**: Returns JSON error with validation details
41- **Database errors**: Returns JSON error with technical details
42
43### Environment Variables
44- `GLANCE_DEMOS_DB_ID` - Required Notion database ID for user lookup
45
46## Thanks Route (`/thanks`)

TownieTODOs.md1 match

@chetanshiโ€ขUpdated 5 days ago
9- [ ] make it one click to branch off like old jp townie demos
10- [ ] opentownie as a pr bot
11- [ ] 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
12- [ ] do a browser use or screenshot thing to give it access to its own visual output
13- [ ] Have it default to creating a new branch off main

Towniethink.ts1 match

@chetanshiโ€ขUpdated 5 days 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."),

Towniesystem_prompt.txt2 matches

@chetanshiโ€ขUpdated 5 days ago
175```
176โ”œโ”€โ”€ backend/
177โ”‚ โ”œโ”€โ”€ database/
178โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
179โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
233```
234
235### Database Patterns
236- Run migrations on startup or comment out for performance
237- Change table names when modifying schemas rather than altering

Towniestripe-webhook.ts1 match

@chetanshiโ€ขUpdated 5 days ago
3import Stripe from "npm:stripe";
4import { getEnvVarName } from "../../shared/is-prod-branch.ts";
5import { addCredits } from "../database/queries.tsx";
6
7const app = new Hono();

Towniesend-message.ts1 match

@chetanshiโ€ขUpdated 5 days ago
15 insertInferenceCall,
16 startTrackingUsage,
17} from "../database/queries.tsx";
18import {
19 makeChangeValTypeTool,

customer-database-setup2 file matches

@stevenvapiโ€ขUpdated 2 months ago

prDatabase

@pdwโ€ขUpdated 2 months ago