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?q=database&page=215&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 7105 results for "database"(3704ms)

bragreelshowcaseHTML.tsx18 matches

@yawnxyz•Updated 2 weeks ago
160};
161
162// Endpoint to get all pages from a specified database
163app.get("/:id", async (c) => {
164 try {
165 const databaseId = c.req.param("id");
166
167 if (!databaseId) {
168 return c.html(`
169 <html>
170 <body>
171 <h1>Error</h1>
172 <p>Missing required parameter: database ID</p>
173 </body>
174 </html>
176 }
177
178 // Query the database without any filters to get all pages
179 const response = await notion.databases.query({
180 database_id: databaseId,
181 // No filter - return all pages
182 });
197 return c.html(html);
198 } catch (error) {
199 console.error("Error querying database:", error);
200 return c.html(`
201 <html>
202 <body>
203 <h1>Error</h1>
204 <p>Failed to query database: ${error.message}</p>
205 </body>
206 </html>
212app.get("/:id/filtered", async (c) => {
213 try {
214 const databaseId = c.req.param("id");
215 const statusValue = c.req.query("status") || "Embed ready";
216
217 if (!databaseId) {
218 return c.html(`
219 <html>
220 <body>
221 <h1>Error</h1>
222 <p>Missing required parameter: database ID</p>
223 </body>
224 </html>
226 }
227
228 // Query the database with a filter for the specified status
229 // Using select type for the Status property
230 const response = await notion.databases.query({
231 database_id: databaseId,
232 filter: {
233 property: "Status",
253 return c.html(html);
254 } catch (error) {
255 console.error("Error querying database:", error);
256 return c.html(`
257 <html>
258 <body>
259 <h1>Error</h1>
260 <p>Failed to query database: ${error.message}</p>
261 </body>
262 </html>
271 <body>
272 <h1>Showcase HTML API</h1>
273 <p>Use /showcase-html/:database_id to get all pages from a database as HTML</p>
274 </body>
275 </html>

bragreelREADME.md1 match

@yawnxyz•Updated 2 weeks ago
229- `NOTION_API_KEY`: Your Notion API integration token
230
231You'll need to create an integration in the Notion workspace and grant it access to the relevant pages or databases.
232
233## Usage Examples

test-app-25521database.ts1 match

@cgshaq•Updated 2 weeks ago
9
10/**
11 * Get all YAML files from the database
12 */
13export async function getAllYamlFiles(): Promise<YamlFile[]> {

appindex.ts2 matches

@treasure000•Updated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations } from "./database/migrations.ts";
3import jobsRoutes from "./routes/jobs.ts";
4import chatRoutes from "./routes/chat.ts";
13});
14
15// Run database migrations
16app.use("*", async (c, next) => {
17 try {

appchat.ts1 match

@treasure000•Updated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createChatMessage, getChatMessages, ChatMessage } from "../database/queries.ts";
3
4const chat = new Hono();

appjobs.ts1 match

@treasure000•Updated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createJob, getJobs, getJobById, searchJobs, Job } from "../database/queries.ts";
3
4const jobs = new Hono();

appmigrations.ts1 match

@treasure000•Updated 2 weeks ago
32 `);
33
34 console.log("Database migrations completed");
35}

appREADME.md1 match

@treasure000•Updated 2 weeks ago
15
16- `/backend`: Server-side code (Hono.js API)
17 - `/database`: SQLite database setup and queries
18 - `/routes`: API endpoints
19- `/frontend`: Client-side code (React)

a_new_websiteREADME.md1 match

@wolf•Updated 2 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.

sqliteExplorerAppREADME.md1 match

@cgshaq•Updated 2 weeks 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

bookmarksDatabase

@s3thi•Updated 3 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 6 months ago