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/image-url.jpg%20%22Optional%20title%22?q=database&page=645&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 7207 results for "database"(1262ms)

OpenTowniethink.ts1 match

@k7dโ€ขUpdated 2 months 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 2 months 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

FixItWanddrizzle.config.ts1 match

@wolfโ€ขUpdated 2 months ago
7 out: "./backend/drizzle",
8 dbCredentials: {
9 url: process.env.DATABASE_URL!,
10 },
11});

reactHonoStarterREADME.md1 match

@shortdivโ€ขUpdated 2 months ago
9- The **client-side entrypoint** is `/frontend/index.html`, which in turn imports `/frontend/index.tsx`, which in turn imports the React app from `/frontend/components/App.tsx`.
10
11[React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a fuller featured example project, with a SQLite database table, queries, client-side CSS and a favicon, and some shared code that runs on both client and server.

dmvmain.tsx1 match

@yawnxyzโ€ขUpdated 2 months ago
1305 }
1306
1307 // Removed difficulty/progress tracking and database updates
1308 },
1309

Emailsreciever1 match

@avycado13โ€ขUpdated 2 months ago
39 } catch (error) {
40 console.error("Failed to save email:", error);
41 // throw new Error("Failed to save email to database");
42 }
43}

Learningmain.tsx2 matches

@findโ€ขUpdated 2 months ago
407 const openai = new OpenAI(); // Automatically uses process.env.OPENAI_API_KEY
408
409 // --- Database Setup ---
410 // Use a consistent key based on the val's path for table namespacing
411 const valPath = new URL(import.meta.url).pathname.split("/").pop() || "default_learning_app";
422 `);
423 } catch (e) {
424 console.error("Database setup failed:", e);
425 // Don't necessarily stop the whole app, but log the error
426 }

email_capture_system_2routes.ts5 matches

@prashamtrivediโ€ขUpdated 2 months ago
6import { cors } from "https://esm.sh/hono@4.0.9/cors?dts";
7import { ProjectStatus, ApiResponse, CreateProjectRequest, CreateSubscriberRequest } from "../shared/types.ts";
8import { initDatabase } from "../database/migrations.ts";
9import {
10 createProject,
17 getProjectsByEmail,
18 getAllSubscribers
19} from "../database/queries.ts";
20import { sendNewSubscriberNotification, sendWelcomeEmail } from "./email-service.ts";
21import { isValidEmail, logger } from "./utils.ts";
24const api = new Hono();
25
26// Initialize database on startup
27initDatabase().catch(error => {
28 logger.error('Failed to initialize database', error);
29 throw error;
30});
6import { email } from "https://esm.town/v/std/email";
7import { logger } from "./utils.ts";
8import { getAllProjects, getSubscribersByProjectId } from "../database/queries.ts";
9import { sendWelcomeEmail } from "./email-service.ts";
10

email_capture_system_2queries.ts1 match

@prashamtrivediโ€ขUpdated 2 months ago
1/**
2 * Database queries for the email capture system
3 */
4

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago