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%22Image%20title%22?q=database&page=63&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 5463 results for "database"(1265ms)

stevens-demomemoryUtils.ts1 match

@mrexceptionโ€ขUpdated 1 week ago
2
3/**
4 * Retrieves all memories from the database
5 * @param includeDate Whether to include date-specific memories or not
6 * @param startDate Optional start date to filter memories from (ISO format)

MiniAppStarterREADME.md1 match

@deodadโ€ขUpdated 1 week ago
9- The **client-side entrypoint** is `/frontend/index.html`, which in turn imports `/frontend/index.tsx`, which in turn imports the React app from `/frontend/App.tsx`.
10
11[React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a fuller featured example project, with a SQLite database table, queries, client-side CSS and a favicon, and some shared code that runs on both client and server.

MiniAppStarterApp.tsx5 matches

@deodadโ€ขUpdated 1 week ago
13 const navLinks = [
14 { name: "Farcaster SDK", path: "/" },
15 { name: "Database", path: "/db" },
16 { name: "About", path: "/about" },
17 ];
35 <Routes>
36 <Route path="/" element={<FarcasterMiniApp />} />
37 <Route path="/db" element={<Database />} />
38 <Route path="/about" element={<About />} />
39 <Route path="/neynar" element={<Neynar />} />
50 <div className="">โœท Hono + React + Tailwind</div>
51 <div className="">โœท React Router + React Query</div>
52 <div className="">โœท Built-in database (blob storage)</div>
53 <div className="">โœท Farcaster mini app manifest + webhook + embed metadata</div>
54 <div className="">โœท Farcaster notifications (storing tokens, sending recurring notifications, ...)</div>
66}
67
68function Database() {
69 const queryFn = () => fetch("/api/counter/get").then((r) => r.json());
70 const { data, refetch } = useQuery({ queryKey: ["counter"], queryFn });
71 return (
72 <Section className="flex flex-col items-start gap-3 m-5">
73 {/* <h2 className="font-semibold">Database Example</h2> */}
74 <div className="">Counter value: {data}</div>
75 <Button variant="outline" onClick={() => fetch("/api/counter/increment").then(refetch)}>

internshipindex.ts4 matches

@brigiallenโ€ขUpdated 1 week ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { serveFile, readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { setupDatabase } from "./database/migrations";
4import apiRoutes from "./routes/api";
5
23});
24
25// Set up the database on startup
26app.use("*", async (c, next) => {
27 try {
28 await setupDatabase();
29 } catch (error) {
30 console.error("Database setup error:", error);
31 }
32 return next();

TownieTODOs.md1 match

@johndevorโ€ขUpdated 1 week 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

@johndevorโ€ขUpdated 1 week 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

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

Towniesend-message.ts1 match

@johndevorโ€ขUpdated 1 week ago
10 overLimit,
11 startTrackingUsage,
12} from "../database/queries.tsx";
13import {
14 getTextEditorTool,

Towniequeries.tsx1 match

@johndevorโ€ขUpdated 1 week ago
4import { INFERENCE_CALLS_TABLE, 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 } = {};

Townie.cursorrules2 matches

@johndevorโ€ขUpdated 1 week ago
198```
199โ”œโ”€โ”€ backend/
200โ”‚ โ”œโ”€โ”€ database/
201โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
202โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
257 ```
258
259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago