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/$2?q=database&page=50&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 7183 results for "database"(2535ms)

Attindex.ts6 matches

@mentalโ€ขUpdated 6 days ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile } from "https://esm.town/v/std/utils/index.ts";
3import { runMigrations, seedSampleData } from "./database/migrations.ts";
4import studentsRoutes from "./routes/students.ts";
5import attendanceRoutes from "./routes/attendance.ts";
13});
14
15// Initialize database on startup
16let dbInitialized = false;
17async function initializeDatabase() {
18 if (!dbInitialized) {
19 await runMigrations();
32// Health check endpoint
33app.get("/api/health", async (c) => {
34 await initializeDatabase();
35 return c.json({
36 success: true,
43app.get("/", async (c) => {
44 try {
45 await initializeDatabase();
46
47 let html = await readFile("/frontend/index.html", import.meta.url);
76app.get("*", async (c) => {
77 try {
78 await initializeDatabase();
79
80 let html = await readFile("/frontend/index.html", import.meta.url);

Testjobs.ts1 match

@Alashakaweeโ€ขUpdated 6 days ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getAllJobs, createJob, deleteJob } from "../database/queries.ts";
3import type { CreateJobRequest, ApiResponse } from "../../shared/types.ts";
4

Createevents.ts3 matches

@Omosola_1โ€ขUpdated 6 days ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations } from "../database/migrations.ts";
3import {
4 createEvent, getEventById, getEvents, createRSVP,
5 getEventRSVPs, getUserRSVP
6} from "../database/queries.ts";
7import type { Event, EventRSVP, EventFilters, ApiResponse } from "../../shared/types.ts";
8
9const app = new Hono();
10
11// Initialize database on first request
12let dbInitialized = false;
13async function ensureDbInitialized() {

SURGICALGALAapi.ts1 match

@Sanya56โ€ขUpdated 6 days ago
8 getAllBodyRegions,
9 searchApproaches
10} from "../database/queries.ts";
11
12const api = new Hono();

LearnEasyauth.ts1 match

@jibolad1โ€ขUpdated 6 days ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getCookie, setCookie, deleteCookie } from "https://esm.sh/hono@3.11.7/cookie";
3import { createUser, getUserByEmail, createSession, getSessionUser, deleteSession } from "../database/queries.ts";
4import type { LoginForm, RegisterForm, ApiResponse, User } from "../../shared/types.ts";
5

Testmigrations.ts1 match

@Alashakaweeโ€ขUpdated 6 days ago
25 )`);
26
27 console.log('Database migrations completed');
28}
29

SURGICALGALAmigrations.ts2 matches

@Sanya56โ€ขUpdated 6 days ago
45 `);
46
47 console.log('Database migrations completed');
48}
49
206 }
207
208 console.log('Database seeded with sample data');
209}
210

TestREADME.md4 matches

@Alashakaweeโ€ขUpdated 6 days ago
13```
14โ”œโ”€โ”€ backend/
15โ”‚ โ”œโ”€โ”€ database/
16โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Database schema setup
17โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database query functions
18โ”‚ โ”œโ”€โ”€ routes/
19โ”‚ โ”‚ โ”œโ”€โ”€ jobs.ts # Job posting API routes
43- `POST /api/chat/messages` - Send a new chat message
44
45## Database Schema
46
47### Jobs Table

LearnEasymigrations.ts3 matches

@jibolad1โ€ขUpdated 6 days ago
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2
3// Database schema setup for the tutoring platform
4export async function runMigrations() {
5 console.log("Running database migrations...");
6
7 // Users table
129 `);
130
131 console.log("Database migrations completed successfully!");
132}

LearnEasyREADME.md3 matches

@jibolad1โ€ขUpdated 6 days ago
15```
16โ”œโ”€โ”€ backend/
17โ”‚ โ”œโ”€โ”€ database/
18โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Database schema setup
19โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database query functions
20โ”‚ โ”œโ”€โ”€ routes/
21โ”‚ โ”‚ โ”œโ”€โ”€ auth.ts # Authentication routes

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago