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/?q=database&page=145&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 4145 results for "database"(1197ms)

recalloneindex.ts1 match

@nomโ€ขUpdated 3 weeks ago
12 getAllMemories,
13 updateMemory,
14} from "./database/queries.ts";
15import { type Memory } from "../shared/types.ts";
16import { blob } from "https://esm.town/v/std/blob";

recallonehandleTelegramMessage.ts1 match

@nomโ€ขUpdated 3 weeks ago
34
35/**
36 * Store a chat message in the database
37 */
38export async function storeChatMessage(

recallonegetWeather.ts1 match

@nomโ€ขUpdated 3 weeks ago
130 }
131
132 console.log(`Weather forecast updated in the database.`);
133 return summary;
134}

recallonegetCalendarEvents.ts1 match

@nomโ€ขUpdated 3 weeks ago
125 }
126
127 console.log(`Calendar events imported into the database.`);
128 return events;
129 } catch (error) {

recallonegenerateFunFacts.ts2 matches

@nomโ€ขUpdated 3 weeks ago
8
9/**
10 * Retrieves previously generated fun facts from the memories database
11 * @returns Array of previous fun facts
12 */
47
48/**
49 * Inserts a fun fact into the memories database
50 * @param date Date for the fun fact in ISO format
51 * @param factText The fun fact text

recallone.cursorrules2 matches

@nomโ€ขUpdated 3 weeks ago
208```
209โ”œโ”€โ”€ backend/
210โ”‚ โ”œโ”€โ”€ database/
211โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
212โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
270- Handle API calls properly with proper error catching
271
272### Database Patterns
273- Run migrations on startup or comment out for performance
274- Change table names when modifying schemas rather than altering

cerebras_codermain.tsx2 matches

@pavan_krishnaโ€ขUpdated 3 weeks ago
1import { serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { generateCode } from "./backend/generate-code.ts";
3import { createTables } from "./database/migrations.ts";
4import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries.ts";
5
6await createTables();

Bates_botdreamingUtility.ts10 matches

@greasegumโ€ขUpdated 3 weeks ago
17
18 try {
19 // Step 1: Get all memories from the database
20 const allMemories = await getAllMemories();
21
22 if (allMemories.length === 0) {
23 console.log("No memories found in the database");
24 return { success: true, message: "No memories to consolidate" };
25 }
33 const consolidatedMemories = await consolidateWithAI(formattedMemories);
34
35 // Step 4: Parse the consolidated memories back into the database
36 const result = await updateDatabaseWithConsolidatedMemories(consolidatedMemories);
37
38 console.log(`โœจ Dreaming complete - ${result.added} new memories created, ${result.deleted} duplicates removed`);
47}
48
49// Get all memories from the database
50async function getAllMemories() {
51 const result = await sqlite.execute(`
111 console.log("Sending memories to Anthropic for consolidation...");
112
113 const prompt = `You are helping consolidate a database of memories for an AI butler named Brandt.
114Please analyze these memories and perform the following tasks:
115
148 max_tokens: 4000,
149 temperature: 0.2,
150 system: "You are a helpful assistant specialized in database organization and memory consolidation.",
151 messages: [
152 { role: "user", content: prompt }
161}
162
163// Parse and update the database with Claude's consolidated memories
164async function updateDatabaseWithConsolidatedMemories(aiResponse) {
165 console.log("Processing AI response and updating database...");
166
167 // Track statistics

stevensDemosetupTelegramChatDb.ts2 matches

@velebanetโ€ขUpdated 3 weeks ago
1// Script to set up the telegram_chats table in SQLite
2// Run this script manually to create the database table
3
4export default async function setupTelegramChatDb() {
25 `);
26
27 return "Telegram chat database table created successfully.";
28 } catch (error) {
29 console.error("Error setting up telegram_chats table:", error);

stevensDemoREADME.md3 matches

@velebanetโ€ขUpdated 3 weeks ago
13## Technical Architecture
14
15**โš ๏ธ important caveat: the admin dashboard doesn't have auth! currently it just relies on security by obscurity of people not knowing the url to a private val. this is not very secure. if you fork this project and put sensitive data in a database you should think carefully about how to secure it.**
16
17Stevens has been designed with the utmost simplicity and extensibility, much like a well-organized household. At the heart of his operation lies a single "memories" table - a digital equivalent of a butler's meticulous records. This table serves as the foundation for all of Stevens' operations.
45- `dashboard`: the admin view for showing the memories notebook + visualizing imports
46- `dailyBriefing`: stuff related to sending a daily update via telegram
47- `dbUtils`: little one-off scripts for database stuff
48
49## Hiring your own Stevens
57- For the Google Calendar integration you'll need `GOOGLE_CALENDAR_ACCOUNT_ID` and `GOOGLE_CALENDAR_CALENDAR_ID`. See [these instuctions](https://www.val.town/v/stevekrouse/pipedream) for details.
58
59**important caveat: the admin dashboard doesn't have auth! currently it just relies on security by obscurity of people not knowing the url to a private val. this is not very secure, if you put sensitive data in a database you should think carefully about how to secure it.**
60
61Overall it's a simple enough project that I encourage you to just copy the ideas and run in your own direction rather than try to use it as-is.

bookmarksDatabase

@s3thiโ€ขUpdated 2 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 5 months ago