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

stevensDemoindex.ts1 match

@skrishnan99โ€ขUpdated 3 months ago
6import { Hono } from "npm:hono";
7import { type Memory } from "../shared/types.ts";
8import { createMemory, deleteMemory, getAllMemories, updateMemory } from "./database/queries.ts";
9
10const app = new Hono();

stevensDemohandleTelegramMessage.ts1 match

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

stevensDemogetWeather.ts1 match

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

stevensDemogetCalendarEvents.ts1 match

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

stevensDemogenerateFunFacts.ts2 matches

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

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

cerebras_codermain.tsx2 matches

@zeviperโ€ขUpdated 3 months ago
1import { serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { generateCode } from "./backend/generate-code.ts";
3import { createTables } from "./database/migrations.ts";
4import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries.ts";
5
6await createTables();

pixelartindex.ts5 matches

@loadingโ€ขUpdated 3 months ago
1import { Hono } from 'https://esm.sh/hono@3.11.7';
2import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { initializeDatabase, cleanupExpiredSessions } from './database/schema.ts';
4import {
5 createUser,
12 getSession,
13 deleteSession
14} from './database/users.ts';
15import {
16 createArtwork,
22 searchArtworks,
23 getArtworkCountByUserId
24} from './database/artworks.ts';
25import {
26 hashPassword,
36const app = new Hono();
37
38// Initialize database on startup
39initializeDatabase().catch(console.error);
40
41// Clean up expired sessions periodically

pixelartschema.ts5 matches

@loadingโ€ขUpdated 3 months ago
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2
3// Database table names with versioning for schema changes
4export const TABLES = {
5 USERS: 'pixelart_users_v1',
8};
9
10// Initialize database tables
11export async function initializeDatabase() {
12 try {
13 // Users table
64 await sqlite.execute(`CREATE INDEX IF NOT EXISTS idx_sessions_expires_at ON ${TABLES.SESSIONS}(expires_at)`);
65
66 console.log('Database initialized successfully');
67 } catch (error) {
68 console.error('Error initializing database:', error);
69 throw error;
70 }

untitled-9921tools.ts1 match

@DevGokuโ€ขUpdated 3 months ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { getAllTools, getToolsByCategory, searchTools, getFeaturedTools, getToolStats } from "../database/queries.ts";
4import { CATEGORIES } from "../../shared/types.ts";
5

customer-database-setup2 file matches

@stevenvapiโ€ขUpdated 2 months ago

prDatabase

@pdwโ€ขUpdated 2 months ago