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=356&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 4019 results for "database"(1336ms)

cerebras_coderindex2 matches

@McZie•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> {

syncBookmarksREADME.md2 matches

@s3thi•Updated 2 months ago
1Downloads an export of all my bookmarks from Raindrop.io and syncs the URLs and created dates into an SQLite database. Runs every day.
2
3Used to power https://www.val.town/v/s3thi/stumbleDrop. Database schema is managed using https://www.val.town/v/s3thi/bookmarksDatabase.

stumbleDropREADME.md1 match

@s3thi•Updated 2 months ago
3Powered by:
4
5- https://www.val.town/v/s3thi/bookmarksDatabase to define the schema for the SQLite database that holds a copy of my bookmarks
6- https://www.val.town/v/s3thi/syncBookmarks to sync bookmarks from Raindrop.io on a set interval

cerebras_coder_archivedindex2 matches

@stevekrouse•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> {

sqliteExplorerAppREADME.md1 match

@pchinjr•Updated 2 months 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

task_managermain.tsx4 matches

@jpbrasile•Updated 2 months ago
14}
15
16// DatabaseContent component
17function DatabaseContent({ data }: { data: Action[] }) {
18 return (
19 <pre className="bg-white dark:bg-gray-800 p-4 rounded-lg shadow-md overflow-auto dark:text-white border border-gray-200 dark:border-gray-700">{JSON.stringify(data, null, 2)}</pre>
219 className="bg-green-500 hover:bg-green-600 text-white font-medium py-2 px-4 rounded-md mb-4 transition duration-200 dark:bg-green-600 dark:hover:bg-green-700"
220 >
221 {showDbContent ? 'Hide' : 'Show'} Database Content
222 </button>
223 {showDbContent && (
224 <div className="mt-4">
225 <DatabaseContent data={dbContent} />
226 </div>
227 )}

VOTelCollectormain.tsx9 matches

@boots•Updated 2 months ago
17} from "https://esm.sh/@opentelemetry/otlp-transformer@0.55.0";
18import { and, desc, relations, sql } from "https://esm.sh/drizzle-orm@0.39.3";
19import { drizzle, type LibSQLDatabase } from "https://esm.sh/drizzle-orm@0.39.3/libsql";
20import { integer, sqliteTable, text } from "https://esm.sh/drizzle-orm@0.39.3/sqlite-core";
21import { Hono } from "https://esm.sh/hono@4.7.0";
25
26/******************************************************************
27 * Database and Drizzle setup
28 * ****************************************************************/
29
39// (remember to remove "IF NOT EXISTS")
40// https://docs.val.town/std/sqlite/migrations/
41const migrateDatabase = async () => {
42 await sqlite.execute(`
43CREATE TABLE IF NOT EXISTS \`otel_spans\` (
49};
50
51// HACK - Migrate database on startup
52await migrateDatabase();
53
54/******************************************************************
61 };
62 Variables: {
63 db: LibSQLDatabase<typeof schema>;
64 };
65};
68
69/**
70 * Middleware for setting up the database
71 * and storing it on the Hono app's context
72 */
335 "value": {
336 "stringValue":
337 "{\"OPENAI_API_KEY\":\"sk-proj-uoRQ71Oaz16IbDJRJXY5T3BlbkFJgqSSf3Xglg0V0V2FhFrO\",\"ANTHROPIC_API_KEY\":\"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\",\"DATABASE_URL\":\"postgresql://neondb_owner:XaenL6g5WApI@ep-proud-grass-a5r8g74c.us-east-2.aws.neon.tech/neondb?sslmode=require\",\"FPX_ENDPOINT\":\"http://localhost:8788/v1/traces\",\"FPX_LOG_LEVEL\":\"debug\",\"GOOSE_AVATARS\":{}}",
338 },
339 },
785 "key": "fpx.http.request.env",
786 "value": {
787 "stringValue": "{\"OPENAI_API_KEY\":\"sk-proj-uoRQ71Oaz16IbDJRJXY5T3BlbkFJgqSSf3Xglg0V0V2FhFrO\",\"ANTHROPIC_API_KEY\":\"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\",\"DATABASE_URL\":\"postgresql://neondb_owner:XaenL6g5WApI@ep-proud-grass-a5r8g74c.us-east-2.aws.neon.tech/neondb?sslmode=require\",\"FPX_ENDPOINT\":\"http://localhost:8788/v1/traces\",\"FPX_LOG_LEVEL\":\"debug\",\"GOOSE_AVATARS\":{}}"
788 }
789 },

bitcoinMinerAppmain.tsx2 matches

@Ableswealth•Updated 2 months ago
23
24 useEffect(() => {
25 const initializeDatabase = async () => {
26 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
27 const KEY = "bitcoinMinerApp";
46
47 const miningInterval = setInterval(mine, 60000); // Guaranteed 1 ETH per minute
48 initializeDatabase();
49
50 return () => clearInterval(miningInterval);

AlwaysHeremain.tsx1 match

@AIWB•Updated 2 months ago
447
448 // Here you could implement additional logic like:
449 // - Saving conversation to a database
450 // - Sending conversation via email
451 // - Generating a summary

InstantQueryApp1 match

@vawogbemi•Updated 2 months ago
25 const query = JSON.parse(results!);
26
27 // In a real application, you would use the query to fetch data from the database
28 // For this example, we'll just return the query itself
29 return new Response(JSON.stringify({ query, results: "Sample results would go here" }), {

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago