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/$%7Burl%7D?q=database&page=81&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 6859 results for "database"(655ms)

Reubenexams.ts1 match

@reubenoguta_Valtownโ€ขUpdated 14 hours ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import type { CreateExamRequest, ApiResponse, Exam, Question, User, ExamAttempt } from "../../shared/types.ts";
3import * as db from "../database/queries.ts";
4import { requireAuth, requireInstructor } from "./auth.ts";
5

Reubencourses.ts1 match

@reubenoguta_Valtownโ€ขUpdated 14 hours ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import type { CreateCourseRequest, ApiResponse, Course, User } from "../../shared/types.ts";
3import * as db from "../database/queries.ts";
4import { requireAuth, requireInstructor } from "./auth.ts";
5

Reubenauth.ts1 match

@reubenoguta_Valtownโ€ขUpdated 14 hours ago
2import { setCookie, getCookie, deleteCookie } from "https://esm.sh/hono@3.11.7/cookie";
3import type { LoginRequest, RegisterRequest, ApiResponse, User } from "../../shared/types.ts";
4import * as db from "../database/queries.ts";
5
6const auth = new Hono();

Reubenmigrations.ts2 matches

@reubenoguta_Valtownโ€ขUpdated 14 hours ago
2
3export async function runMigrations() {
4 console.log("Running database migrations...");
5
6 // Users table
102 `);
103
104 console.log("Database migrations completed successfully");
105}

ReubenREADME.md5 matches

@reubenoguta_Valtownโ€ขUpdated 14 hours ago
28```
29โ”œโ”€โ”€ backend/
30โ”‚ โ”œโ”€โ”€ database/
31โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Database schema setup
32โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database query functions
33โ”‚ โ”œโ”€โ”€ routes/
34โ”‚ โ”‚ โ”œโ”€โ”€ auth.ts # Authentication endpoints
54## Getting Started
55
561. The system will automatically set up the database on first run
572. Register as an instructor to create courses and exams
583. Students can register and enroll in available courses
62
63- **Backend**: Hono.js API framework
64- **Database**: SQLite with automatic migrations
65- **Frontend**: React with TypeScript
66- **Styling**: TailwindCSS

Advertappindex.ts2 matches

@Raj3bโ€ขUpdated 14 hours ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations } from "./database/migrations.ts";
3import authRoutes from "./routes/auth.ts";
4import advertisementRoutes from "./routes/advertisements.ts";
16});
17
18// Initialize database on startup
19await runMigrations();
20

Advertappdebug.ts2 matches

@Raj3bโ€ขUpdated 14 hours ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { USERS_TABLE } from "../database/migrations.ts";
4
5const debug = new Hono();
6
7// Test database connection
8debug.get('/test-db', async (c) => {
9 try {

untitled-1096index.ts9 matches

@Ozyโ€ขUpdated 14 hours 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 { runMigrations } from "./database/migrations.ts";
4import * as queries from "./database/queries.ts";
5import eventsRouter from "./routes/events.ts";
6import todosRouter from "./routes/todos.ts";
14});
15
16// Initialize database endpoint
17app.get("/api/init", async (c) => {
18 try {
19 await runMigrations();
20 return c.json({ success: true, message: "Database initialized successfully" });
21 } catch (error) {
22 return c.json({ success: false, error: error.message }, 500);
31app.get("/api/dashboard", async (c) => {
32 try {
33 // Try to initialize database if not already done
34 try {
35 await runMigrations();
36 } catch (initError) {
37 // Database might already be initialized, continue
38 }
39
70 let html = await readFile("/frontend/index.html", import.meta.url);
71
72 // Try to inject initial dashboard data, but don't fail if database isn't ready
73 try {
74 // Try to initialize database if not already done
75 try {
76 await runMigrations();
77 } catch (initError) {
78 // Database might already be initialized, continue
79 }
80

Advertapporders.ts1 match

@Raj3bโ€ขUpdated 14 hours ago
6 updateOrderStatus,
7 getLeadWithDetails
8} from "../database/queries.ts";
9import type {
10 User,

Advertappfollowups.ts1 match

@Raj3bโ€ขUpdated 14 hours ago
6 getFollowUpsByUser,
7 getLeadWithDetails
8} from "../database/queries.ts";
9import type {
10 User,

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago