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=363&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 4145 results for "database"(597ms)

reactHonoExampleindex.ts1 match

@alexwein•Updated 2 months ago
2import { readFile, servePublicFile } from "https://esm.town/v/stevekrouse/utils@187-main/serve-public/index.ts";
3import { Hono } from "npm:hono";
4import { getMessages, insertMessage } from "./database/queries.ts";
5
6const app = new Hono();

helloWorldGreetingmain.tsx1 match

@Hemant•Updated 2 months ago
465 const KEY = "helloWorldGreeting";
466
467 // Initialize Database
468 await sqlite.execute(`
469 CREATE TABLE IF NOT EXISTS ${KEY}_users (

getProjectsAsZipsREADME.md1 match

@charmaine•Updated 2 months ago
25## CRUD API Routes
26
27This 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.
28
29## Errors

cakeOffReviewPlatformmigrations.ts1 match

@charmaine•Updated 2 months ago
17
18 However, you should know that SQLite has much more limited
19 support for altering existing tables as compared to other databases.
20 Often it's easier to create new tables with the schema you want, and then
21 copy the data over. */

cakeOffReviewPlatformqueries.ts4 matches

@charmaine•Updated 2 months ago
3import { createTables, tableName } from "./migrations.ts";
4
5// This will create the database table if it doesn't exist.
6// This will run every time the app starts up. You can
7// comment out this line for a modest (30ms) perforamnce improvement
8// on cold starts. It's left in to ensure the database tables are
9// automatically set up correctly for users who fork this app.
10await createTables();
99 try {
100 await sqlite.execute(`DELETE FROM ${tableName}`);
101 console.log("All reviews successfully cleared from the database.");
102 } catch (error) {
103 console.error("Error clearing reviews:", error);
104 throw new Error("Failed to clear reviews from the database.");
105 }
106}

cakeOffReviewPlatformindex.ts1 match

@charmaine•Updated 2 months ago
2import { readFile, servePublicFile } from "https://esm.town/v/stevekrouse/utils@187-main/serve-public/index.ts";
3import { Hono } from "npm:hono";
4import { analyzeReviews, clearReviews, getReviews, insertReview } from "./database/queries.ts";
5
6const app = new Hono();

cerebras_coderindex2 matches

@saqibaziz19•Updated 2 months ago
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
4
5async function servePublicFile(path: string): Promise<Response> {

cerebras_coder_testindex2 matches

@charmaine•Updated 2 months ago
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
4
5async function servePublicFile(path: string): Promise<Response> {

cerebras_coderindex2 matches

@TejonivasPogu•Updated 2 months ago
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
4
5async function servePublicFile(path: string): Promise<Response> {

neocities_hit_countermain.tsx4 matches

@mbo•Updated 2 months ago
347 // If using sitename parameter, fetch from Neocities API
348 if (sitename) {
349 // Create the database key using sitename.neocities.org format
350 const dbKey = `${sitename}.neocities.org`;
351
353 const neocitiesData = await fetchNeocitiesStats(sitename);
354
355 // Get the current count from database (either fresh or cached)
356 const count = await getCount(dbKey);
357
358 // If API fetch successful, update the database
359 if (neocitiesData && neocitiesData.result === "success") {
360 // Extract the hits value
361 const hits = neocitiesData.info.hits || 0;
362
363 // Store the value in our database for tracking
364 await setCount(dbKey, hits);
365 } else {

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago