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/image-url.jpg%20%22Image%20title%22?q=database&page=266&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 7207 results for "database"(1616ms)

RSVPindex.ts5 matches

@willykiptoo•Updated 3 weeks ago
15app.use("*", cors());
16
17// Initialize database
18const TABLE_NAME = "rsvp_responses";
19async function initDatabase() {
20 await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
21 id INTEGER PRIMARY KEY AUTOINCREMENT,
30}
31
32// Initialize database on startup
33initDatabase();
34
35// Serve static files
51 }
52
53 // Insert into database
54 await sqlite.execute(
55 `INSERT INTO ${TABLE_NAME} (name, email, attending, guests, dietary_restrictions, message)

RSVPREADME.md3 matches

@willykiptoo•Updated 3 weeks ago
6
7- **RSVP Form**: Collects guest information including name, email, attendance status, number of guests, dietary restrictions, and optional messages
8- **Response Storage**: Stores all submissions in a SQLite database
9- **Response Viewing**: Provides a simple interface to view all submitted RSVPs
10- **Responsive Design**: Works well on both desktop and mobile devices
12## Project Structure
13
14- `/index.ts` - Main backend file with API endpoints and database setup
15- `/frontend/index.html` - Frontend RSVP form and response viewer
16
20- `GET /api/rsvp` - Get all RSVP responses
21
22## Database Schema
23
24The RSVP responses are stored in a SQLite table with the following schema:

untitled-1945new-file-919.tsx2 matches

@Oyor•Updated 3 weeks ago
5import { useState } from "react";
6
7const mockDatabase = [
8 {
9 title: "Half of a Yellow Sun",
47function filterBooks(query) {
48 const q = query.toLowerCase();
49 return mockDatabase.filter(({ title, author, genre, moods, duration }) => {
50 return (
51 title.toLowerCase().includes(q)

IQ-LETTERS2new-file-7329.tsx1 match

@Winshula•Updated 3 weeks ago
5import { cors } from "https://esm.sh/hono@3.11.7/middleware";
6import * as bcrypt from "https://esm.sh/bcryptjs@2.4.3";
7import * as queries from "../database/queries.ts";
8import type { ApiResponse } from "../../shared/types.ts";
9

IQ-LETTERSnew-file-7329.tsx1 match

@Winshula•Updated 3 weeks ago
5import { cors } from "https://esm.sh/hono@3.11.7/middleware";
6import * as bcrypt from "https://esm.sh/bcryptjs@2.4.3";
7import * as queries from "../database/queries.ts";
8import type { ApiResponse } from "../../shared/types.ts";
9

voiceindex.ts2 matches

@rehanbgmi•Updated 3 weeks ago
5import { setupAuthRoutes } from "./routes/auth.ts";
6import { setupChannelRoutes } from "./routes/channels.ts";
7import { runMigrations } from "./database/migrations.ts";
8
9// Initialize the app
18app.use("*", cors());
19
20// Run database migrations
21await runMigrations();
22

voicechannels.ts1 match

@rehanbgmi•Updated 3 weeks ago
8 addUserToChannel,
9 removeUserFromChannel
10} from "../database/queries.ts";
11import { WebSocketHandler } from "../websocket/handler.ts";
12

voiceauth.ts1 match

@rehanbgmi•Updated 3 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createUser, getUserByUsername, updateLastLogin } from "../database/queries.ts";
3
4// Simple password hashing function (in production, use a proper hashing library)

voicemigrations.ts3 matches

@rehanbgmi•Updated 3 weeks ago
7
8/**
9 * Run database migrations to set up the schema
10 */
11export async function runMigrations(): Promise<void> {
12 console.log("Running database migrations...");
13
14 // Create users table
49 `);
50
51 console.log("Database migrations completed");
52}

voicehandler.ts3 matches

@rehanbgmi•Updated 3 weeks ago
1import { addUserToChannel, removeUserFromChannel } from "../database/queries.ts";
2
3// Define the user connection type
47 this.channelConnections.get(userConnection.channelId)?.add(socket);
48
49 // Update database
50 addUserToChannel(userConnection.userId, userConnection.channelId);
51
107 }
108
109 // Update database
110 removeUserFromChannel(userConnection.userId, userConnection.channelId);
111

bookmarksDatabase

@s3thi•Updated 3 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 6 months ago