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/image-url.jpg%20%22Optional%20title%22?q=database&page=3&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 3920 results for "database"(858ms)

Towniesystem_prompt.txt2 matches

@charmaineโ€ขUpdated 4 hours ago
192```
193โ”œโ”€โ”€ backend/
194โ”‚ โ”œโ”€โ”€ database/
195โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
196โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
251 ```
252
253### Database Patterns
254- Run migrations on startup or comment out for performance
255- Change table names when modifying schemas rather than altering

Towniesend-message.ts1 match

@charmaineโ€ขUpdated 4 hours ago
4import { convertToCoreMessages, type CoreUserMessage, streamText } from "npm:ai";
5import { Hono } from "npm:hono";
6import { overLimit, trackUsage } from "../database/queries.tsx";
7import { getTextEditorTool, makeChangeValTypeTool, makeDeleteTool, thinkTool } from "../tools/index.ts";
8import fileWithLinesNumbers from "../utils/fileWithLinesNumbers.ts";

Towniequeries.tsx1 match

@charmaineโ€ขUpdated 4 hours ago
4import { USAGE_TABLE } from "./schema.tsx";
5
6// Eventually we'll have a user database,
7// but in the meantime, we can cache user info in memory
8const userIdCache: { [key: string]: any } = {};

telegramBotStartermessage.tsx1 match

@asdfgโ€ขUpdated 4 hours ago
21
22/**
23 * Store a message in the database using Val Town's blob storage
24 */
25export default async function storeMessage(

adportalindex.ts5 matches

@devtoโ€ขUpdated 5 hours ago
2import { serveStatic } from "https://esm.sh/@hono/node-server@1.2.0/serve-static";
3import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
4import { setupDatabase, saveSubmission, getSubmission, updateSubmission } from "./database.ts";
5import { sendConfirmationEmail } from "./email.ts";
6import { generateUniqueId } from "./utils.ts";
59app.post("/submit", async (c) => {
60 try {
61 // Initialize database if needed
62 await setupDatabase();
63
64 const formData = await c.req.formData();
73 const uniqueId = generateUniqueId();
74
75 // Save to database
76 await saveSubmission(uniqueId, companyName, email);
77
105 const { id: _, images: __, ...fieldsToUpdate } = body;
106
107 // Update the submission in the database
108 await updateSubmission(id, fieldsToUpdate);
109

adportalREADME.md7 matches

@devtoโ€ขUpdated 5 hours ago
7- Simple landing page with LauraMepson branding
8- Form to collect company name and email
9- SQLite database storage for submissions
10- Email functionality to send users a unique link
11- Continuation page for adding more information
15
16- `index.ts` - Main HTTP endpoint and route handling
17- `database.ts` - SQLite database operations
18- `email.ts` - Email sending functionality
19- `utils.ts` - Helper functions
22- `image-storage.ts` - Image storage and retrieval functionality
23
24## Database Schema
25
26The application uses a SQLite database with the following schema:
27
28```sql
401. User visits the landing page
412. User submits company name and email
423. Data is saved to SQLite database
434. User receives an email with a unique link
445. User can click the link to add more information
456. Additional information is saved to the database
467. User can upload and manage images related to their submission
47
61## Development Notes
62
63- When modifying the database schema, create a new table with a new version number
64- Email templates are defined in `email.ts`
65- The unique ID generation is handled in `utils.ts`

adportaldatabase.ts5 matches

@devtoโ€ขUpdated 5 hours ago
13}
14
15// Set up the database tables
16export async function setupDatabase() {
17 try {
18 // Create submissions table
25 )`);
26
27 console.log("Database setup complete");
28 } catch (error) {
29 console.error("Error setting up database:", error);
30 throw error;
31 }
102 };
103
104 // Update the database
105 await sqlite.execute(
106 `UPDATE ${SUBMISSIONS_TABLE}

cerebras_codermain.tsx2 matches

@Webmakerโ€ขUpdated 14 hours 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();

testPondiverseaddCreation2 matches

@argmnโ€ขUpdated 23 hours ago
45 }
46
47 // Now it's time to upload things to database and blob storage
48 // First, add to database, and get the ID
49 const id = await sqlite.execute(
50 `INSERT INTO ${TABLE_NAME} (title, data, type, time) VALUES ($title, $data, $type, $time)`,

Towniesend-message.ts1 match

@valdottownโ€ขUpdated 1 day ago
4import { convertToCoreMessages, type CoreUserMessage, streamText } from "npm:ai";
5import { Hono } from "npm:hono";
6import { overLimit, trackUsage } from "../database/queries.tsx";
7import { getTextEditorTool, makeChangeValTypeTool, makeDeleteTool, thinkTool } from "../tools/index.ts";
8import fileWithLinesNumbers from "../utils/fileWithLinesNumbers.ts";

bookmarksDatabase

@s3thiโ€ขUpdated 2 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 5 months ago