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=9&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 7404 results for "database"(2070ms)

untitled-9078main.tsx1 match

@navya_kโ€ขUpdated 1 day ago
62Frontend & ReactJS \\
63Backend & Flask (Python) \\
64Database & MongoDB / Firebase \\
65NLP API & OpenAI GPT \\
66Styling & TailwindCSS / Bootstrap \\

EEPPortalnewsArticle.tsx1 match

@solomonferedeโ€ขUpdated 1 day ago
513 try {
514 // **REMOVED: newId = crypto.randomUUID();**
515 // The database will auto-increment the ID.
516 const response = await fetch("/submit-news", {
517 method: "POST",

GlancergetRelatedPagesFromDatabase.ts5 matches

@lightweightโ€ขUpdated 1 day ago
7});
8
9export async function getRelatedPagesFromDatabase(pageId: string) {
10 try {
11 const response = await notion.databases.query({
12 database_id: Deno.env.get("GLANCE_CONTENT_DB_ID"),
13 filter: {
14 property: "Glancer demos", // the property in the Glancer content database that connects to the /demo
15 relation: {
16 contains: pageId, // the Glancer demos property holds the /demo page id to which it is related
25 });
26 // loop through the response and attach a "page_contents" object to each page
27 // page_content is the markdown in Notion in each "Glancer content" database page
28 for (const page of response.results) {
29 page.page_content = await getPageContents(page.id);

Towniequeries.tsx1 match

@valdottownโ€ขUpdated 1 day ago
6const PRICE_MULTIPLIER = 1.5;
7
8// Eventually we'll have a user database,
9// but in the meantime, we can cache user info in memory
10const userIdCache: { [key: string]: any } = {};

TownieTokenGeneratorTerminal.tsx15 matches

@allโ€ขUpdated 2 days ago
516 await animateProgress('Asset transfer protocol', 2000);
517
518 addLog('info', 'Synchronizing civic databases with Val.Town');
519 await animateProgress('Database synchronization', 1500);
520
521 // Generate massive token haul
759
760 const checks = [
761 { name: 'Database connectivity', delay: 800 },
762 { name: 'Token integrity verification', delay: 1200 },
763 { name: 'Cryptographic hash validation', delay: 1000 },
781 addLog('info', 'โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”');
782 addLog('info', `๐Ÿ“Š Status: ${healthData.status.toUpperCase()}`);
783 addLog('info', `๐Ÿ—„๏ธ Database: ${healthData.database}`);
784 addLog('info', `๐Ÿท๏ธ Total tokens: ${healthData.total_tokens}`);
785 addLog('info', `โฐ Timestamp: ${new Date(healthData.timestamp).toLocaleString()}`);
854 };
855
856 const resetDatabase = async () => {
857 if (state.isRunning) return;
858
859 // Confirmation dialog
860 if (!confirm('โš ๏ธ WARNING: This will permanently delete ALL tokens from the database. This action cannot be undone. Are you sure you want to proceed?')) {
861 return;
862 }
867 addLog('info', '');
868 addLog('error', 'โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—');
869 addLog('error', 'โ•‘ โš ๏ธ DATABASE RESET โ•‘');
870 addLog('error', 'โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
871 addLog('info', '');
872
873 addLog('warning', '๐Ÿšจ DANGER ZONE: Initiating database reset...');
874 await sleep(1000);
875
876 addLog('info', '๐Ÿ”’ Acquiring exclusive database lock...');
877 await animateProgress('Database lock', 1000);
878 addLog('success', 'โœ… Database locked for maintenance');
879
880 addLog('info', '๐Ÿ—‘๏ธ Purging token records...');
888
889 if (result.success) {
890 addLog('success', 'โœ… Database reset completed');
891 addLog('info', 'โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”');
892 addLog('warning', `๐Ÿ—‘๏ธ ${result.message}`);
893 addLog('info', '๐Ÿ”„ Database is now in pristine state');
894 addLog('info', 'โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”');
895
897 onTokenCountUpdate(0);
898 } else {
899 addLog('error', 'โŒ Database reset failed');
900 }
901
1003 <button
1004 className="control-button reset"
1005 onClick={resetDatabase}
1006 disabled={state.isRunning}
1007 >

TownieTokenGeneratorindex.ts8 matches

@allโ€ขUpdated 2 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 {
5 createToken,
10 getRecentLogs,
11 clearAllTokens
12} from "./database/queries.ts";
13
14const app = new Hono();
19});
20
21// Initialize database on startup
22await runMigrations();
23
116});
117
118// Clear all tokens (reset database)
119app.delete("/api/tokens", async c => {
120 const deletedCount = await clearAllTokens();
121 await logTerminalEntry('warning', `Database reset: ${deletedCount} tokens cleared`, 'system');
122
123 return c.json({
124 success: true,
125 message: `Cleared ${deletedCount} tokens from database`
126 });
127});
138 heist_method: "Municipal Override Key",
139 status: "SUCCESSFUL",
140 vault_location: "Secure Civic Database",
141 warning: "Civic authorities have been notified"
142 };
164 status: 'healthy',
165 timestamp: new Date().toISOString(),
166 database: 'connected',
167 total_tokens: stats.total_tokens
168 });

TownieTokenGeneratormigrations.ts2 matches

@allโ€ขUpdated 2 days ago
5
6export async function runMigrations() {
7 console.log('๐Ÿ”ง Running database migrations...');
8
9 // Create tokens table
44 `);
45
46 console.log('โœ… Database migrations completed');
47}
48

TownieTODOs.md1 match

@moltarโ€ขUpdated 2 days ago
9- [ ] make it one click to branch off like old jp townie demos
10- [ ] opentownie as a pr bot
11- [ ] give it the ability to see its own client-side and server-side logs by building a middleware that shoves them into a SQL light database date and then give it a tool to access them
12- [ ] do a browser use or screenshot thing to give it access to its own visual output
13- [ ] Have it default to creating a new branch off main

Towniethink.ts1 match

@moltarโ€ขUpdated 2 days ago
7export const thinkTool = tool({
8 description:
9 "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
10 parameters: z.object({
11 thought: z.string().describe("A thought to think about."),

Towniesystem_prompt.txt2 matches

@moltarโ€ขUpdated 2 days ago
174```
175โ”œโ”€โ”€ backend/
176โ”‚ โ”œโ”€โ”€ database/
177โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
178โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
234 ```
235
236### Database Patterns
237- Run migrations on startup or comment out for performance
238- Change table names when modifying schemas rather than altering

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago