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//%22$%7BviewSourceLink%7D/%22?q=database&page=3&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 10130 results for "database"(1341ms)

Townie-Al2credit-balance.ts1 match

@prubeandoAlโ€ขUpdated 2 days ago
1import { Hono } from "npm:hono";
2import { getCreditBalance, getUser } from "../database/queries.tsx";
3
4const app = new Hono();

location-feed-generatoranchor-api.ts4 matches

@tijsโ€ขUpdated 2 days ago
1// @val-town anchorAPI
2// Main HTTP API handler for Anchor AppView
3import { db, initializeTables } from "../database/db.ts";
4import {
5 checkinsTable,
6 processingLogTable,
7 userFollowsTable,
8} from "../database/schema.ts";
9import { and, desc, eq, inArray, lt, sql } from "https://esm.sh/drizzle-orm";
10import { ATProtocolProfileResolver } from "../utils/profile-resolver.ts";
18import { PlacesNearbyResponse } from "../models/place-models.ts";
19import { createCheckin } from "./checkins.ts";
20import { getCheckinCounts, getRecentActivity } from "../database/queries.ts";
21
22// Types for better TypeScript support
69 }
70
71 // Initialize database tables - let errors bubble up
72 await initializeTables();
73

manga-updates-to-discordAGENTS.md2 matches

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

react19README.md1 match

@nbbaierโ€ขUpdated 2 days ago
29
30- [React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a
31 bigger example project, with a SQLite database table, queries, client-side
32 CSS, a favicon, and shared code that runs on both client and server.

wa-hono-reactREADME.md1 match

@nbbaierโ€ขUpdated 3 days ago
29
30- [React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a
31 bigger example project, with a SQLite database table, queries, client-side
32 CSS, a favicon, and shared code that runs on both client and server.

location-feed-generatorcheckins.ts8 matches

@tijsโ€ขUpdated 3 days ago
4import type { Place } from "../models/place-models.ts";
5import { processCheckinEvent as _processCheckinEvent } from "../ingestion/record-processor.ts";
6import { db } from "../database/db.ts";
7import { checkinsTable } from "../database/schema.ts";
8import { eq } from "https://esm.sh/drizzle-orm";
9
441 console.log(`โœ… Created checkin record: ${checkinResult.uri}`);
442
443 // IMMEDIATELY save to local database for instant feed updates
444 try {
445 const rkey = extractRkey(checkinResult.uri);
455 },
456 });
457 console.log(`โœ… Saved checkin to local database: ${rkey}`);
458 } catch (localSaveError) {
459 console.error(
460 "Failed to save checkin to local database:",
461 localSaveError,
462 );
648// console.log(`โœ… Created checkin record: ${checkinResult.uri}`);
649//
650// // IMMEDIATELY save to local database for instant feed updates
651// try {
652// const rkey = extractRkey(checkinResult.uri);
662// },
663// });
664// console.log(`โœ… Saved checkin to local database: ${rkey}`);
665// } catch (localSaveError) {
666// console.error(
667// "Failed to save checkin to local database:",
668// localSaveError,
669// );

location-feed-generatorstorage-adapter.ts2 matches

@tijsโ€ขUpdated 3 days ago
4
5import { DrizzleStorage } from "jsr:@tijs/atproto-oauth-hono@^0.2.3/drizzle";
6import { db } from "../database/db.ts";
7
8// Create singleton instance using Drizzle storage with our database
9export const storage = new DrizzleStorage(db);
10

location-feed-generatormain.tsx2 matches

@tijsโ€ขUpdated 3 days ago
2// Main HTTP entry point for Anchor AppView - organized route groups
3import { Hono } from "jsr:@hono/hono@4.9.6";
4import { initializeTables } from "./backend/database/db.ts";
5import { oauthRoutes } from "./backend/routes/oauth.ts";
6import { createAdminRoutes } from "./backend/routes/admin.ts";
11const app = new Hono();
12
13// Initialize database on startup
14await initializeTables();
15

Supply-Restockingmain.ts2 matches

@anstill79โ€ขUpdated 3 days ago
15
16 try {
17 // Simple GET endpoint to test database
18 if (req.method === "GET") {
19 const result = await sqlite.execute("SELECT datetime() as current_time");
21 JSON.stringify({
22 success: true,
23 message: "Database connection works!",
24 time: result.rows[0],
25 }),
bible-mcp

bible-mcpAGENTS.md2 matches

@cameronpakโ€ขUpdated 3 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

customer-database-setup2 file matches

@stevenvapiโ€ขUpdated 2 months ago

prDatabase

@pdwโ€ขUpdated 2 months ago