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/$%7Burl%7D?q=database&page=239&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 7427 results for "database"(3479ms)

To-owired-niethink.ts1 match

@toowiredโ€ขUpdated 3 weeks 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."),

To-owired-niesystem_prompt.txt2 matches

@toowiredโ€ขUpdated 3 weeks 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

To-owired-niesend-message.ts1 match

@toowiredโ€ขUpdated 3 weeks ago
10 overLimit,
11 startTrackingUsage,
12} from "../database/queries.tsx";
13import { makeChangeValTypeTool, makeFetchTool, makeTextEditorTool } from "../tools/index.ts";
14import fileWithLinesNumbers from "../utils/fileWithLinesNumbers.ts";

To-owired-niequeries.tsx1 match

@toowiredโ€ขUpdated 3 weeks 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 } = {};

To-owired-nie.cursorrules2 matches

@toowiredโ€ขUpdated 3 weeks 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

reactHonoStarter_remix_66542README.md1 match

@johnroyallโ€ขUpdated 3 weeks 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/components/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.
12
13This is a test

bragreelshowcaseHTML.tsx12 matches

@lightweightโ€ขUpdated 3 weeks ago
12const app = new Hono();
13
14// Endpoint to get all pages from a specified database
15app.get("/:id", async (c) => {
16 try {
39 return c.html(html);
40 } catch (error) {
41 console.error("Error querying database:", error);
42 return c.html(
43 `
45 <body>
46 <h1>Error</h1>
47 <p>Failed to query database: ${error.message}</p>
48 </body>
49 </html>
57app.get("/:id/filtered", async (c) => {
58 try {
59 const databaseId = c.req.param("id");
60 const statusValue = c.req.query("status") || "Embed ready";
61
62 if (!databaseId) {
63 return c.html(
64 `
66 <body>
67 <h1>Error</h1>
68 <p>Missing required parameter: database ID</p>
69 </body>
70 </html>
74 }
75
76 // Query the database with a filter for the specified status
77 // Using select type for the Status property
78 const response = await notion.databases.query({
79 database_id: databaseId,
80 filter: {
81 property: "Status",
101 return c.html(html);
102 } catch (error) {
103 console.error("Error querying database:", error);
104 return c.html(
105 `
107 <body>
108 <h1>Error</h1>
109 <p>Failed to query database: ${error.message}</p>
110 </body>
111 </html>
122 <body>
123 <h1>Showcase HTML API</h1>
124 <p>Use /showcase-html/:database_id to get all pages from a database as HTML</p>
125 </body>
126 </html>

bragreelcache.tsx8 matches

@lightweightโ€ขUpdated 3 weeks ago
10// update the cache that was saved to blob storage by the /cache route
11export default async function(interval: Interval) {
12 // build key fragment to find the blob with the database cache in it
13 const blobKey = [
14 "cache", // this matches the path that sets the blob and tells us what the purpose of this blob is
15 "db", // we added this bit to the key when we saved it so that we know is a database cache when we look at blob storage
16 ].join("--");
17 // get blob with database JSON
18 const blobKeys = await blob.list(blobKey); // array of keys that start with the blobKey fragment
19 // console.log(blobKeys[0]);
20 const databaseId = blobKeys[0].key.split("--").pop();
21 // console.log(databaseId);
22 // Query the database without any filters to get all pages
23 const response = await notion.databases.query({
24 database_id: databaseId,
25 filter: {
26 property: "Publication status",

bragreelpublish.tsx8 matches

@lightweightโ€ขUpdated 3 weeks ago
10// update the cache that was saved to blob storage by the /cache route
11export default async function(interval: Interval) {
12 // build key fragment to find the blob with the database cache in it
13 const blobKey = [
14 "cache", // this matches the path that sets the blob and tells us what the purpose of this blob is
15 "db", // we added this bit to the key when we saved it so that we know is a database cache when we look at blob storage
16 ].join("--");
17 // get blob with database JSON
18 const blobKeys = await blob.list(blobKey); // array of keys that start with the blobKey fragment
19 // console.log(blobKeys[0]);
20 const databaseId = blobKeys[0].key.split("--").pop();
21 // console.log(databaseId);
22 // Query the database without any filters to get all pages
23 const response = await notion.databases.query({
24 database_id: databaseId,
25 filter: {
26 property: "Publication status",

reactHonoExampleREADME.md2 matches

@johnroyallโ€ขUpdated 3 weeks ago
4
5* `index.ts` - this is the **entrypoint** for this whole project
6* `database/` - this contains the code for interfacing with the app's SQLite database table
7
8## Hono
26## CRUD API Routes
27
28This app has two CRUD API routes: for reading and inserting into the messages table. They both speak JSON, which is standard. They import their functions from `/backend/database/queries.ts`. These routes are called from the React app to refresh and update data.
29
30## Errors

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago