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=1&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 3897 results for "database"(853ms)

telegramBotStartermessage.tsx1 match

@asdfg•Updated 1 hour 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 1 hour 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 1 hour 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 1 hour 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 10 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 19 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 22 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

@valdottown•Updated 22 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 } = {};

sqliteExplorerApp2README.md1 match

@shouser•Updated 1 day ago
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable

TownieTODOs.md1 match

@valdottown•Updated 1 day 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

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago