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=45&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"(1912ms)

Contextualtypes.ts2 matches

@c15rโ€ขUpdated 5 days ago
135}
136
137// Database Models
138export interface DBThoughtFork extends Omit<ThoughtFork, 'explorations'> {
139 explorations: string; // JSON string
205}
206
207// Database models for user-scoped entities
208export interface DBUserScopedThoughtFork extends Omit<UserScopedThoughtFork, 'explorations'> {
209 explorations: string; // JSON string

untitled-5794index.ts7 matches

@Mac4โ€ขUpdated 5 days ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations, insertSampleData } from "./database/migrations.ts";
3import auth from "./routes/auth.ts";
4import apartments from "./routes/apartments.ts";
13});
14
15// Initialize database on startup
16let dbInitialized = false;
17async function initializeDatabase() {
18 if (!dbInitialized) {
19 console.log("Initializing Saint Benedict Joseph database...");
20 await runMigrations();
21 await insertSampleData();
22 dbInitialized = true;
23 console.log("Database initialization complete!");
24 }
25}
26
27// Initialize database before handling requests
28app.use("*", async (c, next) => {
29 await initializeDatabase();
30 await next();
31});

Rsettings.ts1 match

@Remnaโ€ขUpdated 5 days ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { requireAuth } from "./auth.ts";
3import { getUserSettings, updateUserSettings } from "../database/queries.ts";
4import type { ApiResponse, UserSettings } from "../../shared/types.ts";
5

RREADME.md4 matches

@Remnaโ€ขUpdated 5 days ago
26โ”œโ”€โ”€ backend/
27โ”‚ โ”œโ”€โ”€ index.ts # Main Hono server
28โ”‚ โ”œโ”€โ”€ database/
29โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Database schema
30โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database operations
31โ”‚ โ””โ”€โ”€ routes/
32โ”‚ โ”œโ”€โ”€ auth.ts # Authentication routes
54- **Backend**: Hono (TypeScript API framework)
55- **Frontend**: React with TypeScript
56- **Database**: SQLite
57- **Real-time**: WebSocket connections
58- **Styling**: TailwindCSS

Rmigrations.ts3 matches

@Remnaโ€ขUpdated 5 days ago
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2
3// Database schema for RChat application
4export async function runMigrations() {
5 console.log("Running database migrations...");
6
7 // Users table
164 await sqlite.execute(`CREATE INDEX IF NOT EXISTS idx_chatroom_replies_post_id ON chatroom_replies (post_id)`);
165
166 console.log("Database migrations completed successfully!");
167}

Rindex.ts4 matches

@Remnaโ€ขUpdated 5 days 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 { authRoutes } from "./routes/auth.ts";
5import { chatRoutes } from "./routes/chat.ts";
16});
17
18// Initialize database on startup
19await runMigrations();
20
95// Helper functions for WebSocket broadcasting
96function broadcastToChat(chatId: string, message: any, excludeUserId?: string) {
97 // In a real implementation, you'd query the database for chat participants
98 // For now, broadcast to all connected clients except the sender
99 for (const [userId, socket] of connectedClients.entries()) {
105
106function broadcastToContacts(userId: string, message: any) {
107 // In a real implementation, you'd query the database for user's contacts
108 // For now, broadcast to all connected clients
109 for (const [contactId, socket] of connectedClients.entries()) {

Rgroups.ts3 matches

@Remnaโ€ขUpdated 5 days ago
7 getUserById,
8 getUserContacts
9} from "../database/queries.ts";
10import type { ApiResponse, Chat } from "../../shared/types.ts";
11
239 }
240
241 // In a real implementation, you'd remove the participant from the database
242 // For now, just return success
243 return c.json<ApiResponse>({
306 }
307
308 // In a real implementation, you'd update the group details in the database
309 // For now, just return success
310 return c.json<ApiResponse>({

Rcontacts.ts1 match

@Remnaโ€ขUpdated 5 days ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { requireAuth } from "./auth.ts";
3import { addContact, getUserContacts, getUserByUsername, getUserByEmail } from "../database/queries.ts";
4import type { ApiResponse, Contact } from "../../shared/types.ts";
5

Rchat.ts2 matches

@Remnaโ€ขUpdated 5 days ago
8 getChatMessages,
9 getUserById
10} from "../database/queries.ts";
11import type { ApiResponse, Chat, Message } from "../../shared/types.ts";
12
194 }
195
196 // In a real implementation, you'd mark messages as read in the database
197 // For now, just return success
198 return c.json<ApiResponse>({

Rchatroom.ts1 match

@Remnaโ€ขUpdated 5 days ago
6 createChatRoomReply,
7 getChatRoomReplies
8} from "../database/queries.ts";
9import type { ApiResponse, ChatRoomPost, ChatRoomReply } from "../../shared/types.ts";
10

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago