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=249&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 2820 results for "database"(300ms)

reactRouter7ExampleHome.loader.ts1 match

@stevekrouseโ€ขUpdated 2 weeks ago
1import { LoaderFunctionArgs } from "https://esm.sh/react-router@7.5.0?deps=react@18.2.0,react-dom@18.2.0";
2import { getAllTopics } from "../backend/database/queries.ts";
3
4export async function loader() {

stevens.cursorrules2 matches

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

stevensgetWeather.ts1 match

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

stevenssetupTelegramChatDb.ts2 matches

@geoffreylittโ€ขUpdated 2 weeks ago
1// Script to set up the telegram_chats table in SQLite
2// Run this script manually to create the database table
3
4export default async function setupTelegramChatDb() {
25 `);
26
27 return "Telegram chat database table created successfully.";
28 } catch (error) {
29 console.error("Error setting up telegram_chats table:", error);

OpenTownieTODOs.md1 match

@stevekrouseโ€ขUpdated 2 weeks ago
15- [ ] Rebuild as React Router?
16- [ ] opentownie as a pr bot
17- [ ] 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
18- [ ] do a browser use or screenshot thing to give it access to its own visual output
19- [ ] 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

FarcasterMiniAppStoreREADME.md1 match

@moeโ€ขUpdated 2 weeks 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/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.

fixItWandmod_http.ts2 matches

@wolfโ€ขUpdated 2 weeks ago
1import { drizzle } from "https://esm.sh/drizzle-orm@0.41.0/neon-http";
2import { neon } from "https://esm.sh/@neondatabase/serverless@1.0.0";
3import { usersTable, wandsTable, workordersTable } from "./schemas_http.ts";
4
5// Initialize the Neon SQL client
6const sql = neon(Deno.env.get("DATABASE_URL")!);
7
8// Instantiate Drizzle client with the Neon driver and schemas

fixItWandmod.ts2 matches

@wolfโ€ขUpdated 2 weeks ago
1import { drizzle } from "drizzle-orm/neon-http";
2import { neon } from "@neondatabase/serverless";
3import { usersTable, wandsTable } from "./schemas.ts";
4
5// Initialize the Neon SQL client
6const sql = neon(Deno.env.get("DATABASE_URL")!);
7
8// Instantiate Drizzle client with the Neon driver and schemas

reactRouter7Examplemigrations.ts3 matches

@stevekrouseโ€ขUpdated 2 weeks ago
6
7/**
8 * Initialize the database schema
9 */
10export async function initializeDatabase() {
11 // Create topics table
12 await sqlite.execute(`
44
45/**
46 * Seed the database with initial data for demonstration
47 */
48async function seedInitialData() {

mapsclonerREADME.md1 match

@mattiโ€ขUpdated 2 weeks 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.