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/$%7BsvgDataUrl%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 8362 results for "database"(3162ms)

stevensDemohandleTelegramMessage.ts1 match

@michaelbellโ€ขUpdated 1 day ago
34
35/**
36 * Store a chat message in the database
37 */
38export async function storeChatMessage(

stevensDemogetWeather.ts1 match

@michaelbellโ€ขUpdated 1 day ago
130 }
131
132 console.log(`Weather forecast updated in the database.`);
133 return summary;
134}

stevensDemogetCalendarEvents.ts1 match

@michaelbellโ€ขUpdated 1 day ago
125 }
126
127 console.log(`Calendar events imported into the database.`);
128 return events;
129 } catch (error) {

stevensDemogenerateFunFacts.ts2 matches

@michaelbellโ€ขUpdated 1 day ago
8
9/**
10 * Retrieves previously generated fun facts from the memories database
11 * @returns Array of previous fun facts
12 */
47
48/**
49 * Inserts a fun fact into the memories database
50 * @param date Date for the fun fact in ISO format
51 * @param factText The fun fact text

stevensDemo.cursorrules2 matches

@michaelbellโ€ขUpdated 1 day ago
208```
209โ”œโ”€โ”€ backend/
210โ”‚ โ”œโ”€โ”€ database/
211โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
212โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
270- Handle API calls properly with proper error catching
271
272### Database Patterns
273- Run migrations on startup or comment out for performance
274- Change table names when modifying schemas rather than altering

loadboardmain.tsx7 matches

@joinโ€ขUpdated 1 day ago
67`;
68
69// --- DATABASE INITIALIZATION ---
70// This function ensures our tables are ready before the application handles requests.
71async function initializeDatabase() {
72 await sqlite.execute(`
73 CREATE TABLE IF NOT EXISTS loads (
99 const { count: loadCount } = await sqlite.execute("SELECT COUNT(*) as count FROM loads");
100 if (loadCount === 0) {
101 console.log("Seeding database with initial loads...");
102 await sqlite.execute({
103 sql:
117 const { count: carrierCount } = await sqlite.execute("SELECT COUNT(*) as count FROM carriers");
118 if (carrierCount === 0) {
119 console.log("Seeding database with initial carriers...");
120 await sqlite.batch([
121 {
345const app = new Hono();
346
347// Middleware for database initialization and CORS
348app.use("*", cors());
349app.use("*", async (c, next) => {
350 await initializeDatabase();
351 await next();
352});
433 }
434
435 // If approved, update the database
436 const updateResult = await sqlite.execute({
437 sql: "UPDATE loads SET subcontractor_id = ?, status = 'claimed', claimed_at = CURRENT_TIMESTAMP WHERE id = ?",

reactHonoStarterREADME.md1 match

@Staccyachieโ€ขUpdated 1 day ago
21## Further resources
22
23- [React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a bigger example project, with a SQLite database table, queries, client-side CSS, a favicon, and shared code that runs on both client and server.

gtdapi.ts1 match

@jessicaoceanโ€ขUpdated 1 day ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import type { CreateTaskRequest, UpdateTaskRequest, CreateProjectRequest, UpdateProjectRequest } from "../../shared/types.ts";
3import * as queries from "../database/queries.ts";
4
5const api = new Hono();

gtdindex.ts3 matches

@jessicaoceanโ€ขUpdated 1 day ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils/index.ts";
3import { initializeDatabase } from "./database/schema.ts";
4import api from "./routes/api.ts";
5
11});
12
13// Initialize database on startup
14await initializeDatabase();
15
16// API routes

gtdschema.ts1 match

@jessicaoceanโ€ขUpdated 1 day ago
6const CONTEXTS_TABLE = 'gtd_contexts_v1';
7
8export async function initializeDatabase() {
9 // Create tasks table
10 await sqlite.execute(`

customer-database-setup2 file matches

@stevenvapiโ€ขUpdated 1 week ago

prDatabase

@pdwโ€ขUpdated 1 week ago