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/$%7Bsuccess?q=database&page=165&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 5061 results for "database"(941ms)

discord-botindex.js6 matches

@boucher•Updated 2 weeks ago
1import { initializeDatabase } from './database.js';
2import { fetchAndStoreDMs } from './discord-client.js';
3import { batchProcessLinks } from './link-analyzer.js';
10app.use(express.json());
11
12// Initialize database
13initializeDatabase();
14
15// API routes
134 console.log('Initializing Discord DM Analyzer...');
135
136 // Initialize database
137 const db = initializeDatabase();
138 console.log('Database initialized');
139
140 // Additional setup if needed

discord-botlink-analyzer.js3 matches

@boucher•Updated 2 weeks ago
1import linkify from 'linkify-it';
2import { getMessages, updateLinkCategory } from './database.js';
3import { categorizeContent } from './anthropic-service.js';
4import 'dotenv/config';
174
175/**
176 * Batch process all links in the database
177 * - Categorizes uncategorized links
178 * - Updates link metadata
194 const metadata = await extractLinkMetadata(link.url);
195
196 // Update link in database
197 updateLinkCategory(link.id, categorization.category);
198

discord-botREADME.md2 matches

@boucher•Updated 2 weeks ago
12The project is structured to work with Val.town and has the following components:
13
14- **Database Layer**: Uses Val.town's built-in SQLite database
15- **AI Integration**: Leverages Anthropic's Claude API for analysis
16- **Discord Integration**:
90## Val.town Specific Considerations
91
92- The database uses Val.town's built-in SQLite database
93- The code uses Deno and ESM modules compatible with Val.town
94- HTTP endpoints are designed to work with Val.town's serverless model

discord-bottypes.ts1 match

@boucher•Updated 2 weeks ago
55}
56
57// Database-related types
58export interface MessageRecord {
59 id: string;

discord-botlink-analyzer.ts3 matches

@boucher•Updated 2 weeks ago
1// Link analyzer for Val.town
2import { getMessages, updateLinkCategory } from "./database.ts";
3import { categorizeContent } from "./anthropic-service.ts";
4import { extractUrls, log } from "../shared/utils.ts";
204
205/**
206 * Batch process all links in the database
207 * - Categorizes uncategorized links
208 * - Updates link metadata
230 const metadata = await extractLinkMetadata(link.url);
231
232 // Update link in database
233 await updateLinkCategory(link.id, categorization.category);
234

discord-botindex.ts4 matches

@boucher•Updated 2 weeks ago
2import { Hono } from "https://esm.sh/hono@3.12.5";
3import { cors } from "https://esm.sh/@hono/cors@0.0.8";
4import { initializeDatabase } from "./database.ts";
5import { fetchAndStoreDMs } from "./discord-client.ts";
6import { handleDiscordInteractionRequest } from "./discord-interactions.ts";
20async function initializeServices() {
21 try {
22 // Initialize the database
23 await initializeDatabase();
24 log("Database initialized successfully", "info");
25
26 // Initialize Anthropic client

discord-botdatabase.ts9 matches

@boucher•Updated 2 weeks ago
1// Database adapter for Val.town SQLite
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { extractUrls, log } from "../shared/utils.ts";
19
20/**
21 * Initialize the database schema
22 */
23export async function initializeDatabase() {
24 try {
25 // Create messages table
102 }
103
104 log("Database initialized successfully", "info");
105 return true;
106 } catch (error) {
107 log(`Error initializing database: ${error.message}`, "error");
108 throw error;
109 }
111
112/**
113 * Save messages to the database
114 * @param messages - Array of message objects to save
115 */
168 }
169
170 log(`Saved ${savedCount} of ${messages.length} messages to database`, "info");
171 return savedCount;
172 } catch (error) {
177
178/**
179 * Get messages from the database, with optional filtering
180 * @param filters - Optional filters for messages
181 * @returns Array of message objects
239
240/**
241 * Get links from the database, with optional filtering
242 * @param filters - Optional filters for links
243 * @returns Array of link objects

discord-botdiscord-client.ts2 matches

@boucher•Updated 2 weeks ago
1// Discord client for Val.town
2import { saveDMMessages } from "./database.ts";
3
4// Discord API endpoints
36 console.log(`Fetched ${messages.length} messages`);
37
38 // Save messages to database
39 await saveDMMessages(messages);
40

discord-botquery-service.ts1 match

@boucher•Updated 2 weeks ago
1// Query service for Val.town
2import { getMessages, getLinks } from "./database.ts";
3import { analyzeConversation, summarizeConversation } from "./anthropic-service.ts";
4

discord-botdiscord-interactions.ts2 matches

@boucher•Updated 2 weeks ago
2import { verifyKey } from "https://esm.sh/discord-interactions@3.4.0";
3import { processQuery } from "./query-service.ts";
4import { getCategories } from "./database.ts";
5import { createCommandResponse, getEnv, log, truncateText } from "../shared/utils.ts";
6import type {
117
118 case 'categories': {
119 // Get categories from database instead of hardcoding
120 const categoriesFromDB = await getCategories();
121 const categoryNames = categoriesFromDB.length > 0

bookmarksDatabase

@s3thi•Updated 3 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 6 months ago