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/$%7Bart_info.art.src%7D?q=database&page=559&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 6046 results for "database"(1266ms)

cerebras_coder_archivedindex2 matches

@stevekrouseUpdated 3 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

@pchinjrUpdated 3 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

@jpbrasileUpdated 3 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

@bootsUpdated 3 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

@AbleswealthUpdated 3 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

@AIWBUpdated 3 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

@vawogbemiUpdated 3 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" }), {

InstantQuerygetSystemPrompt4 matches

@vawogbemiUpdated 3 months ago
1function getSystemPrompt(schema: string) {
2 return `You have access to an instantdb database. When people ask for info you will provide it for
3 them by creating an instantdb query for the server to query the database. Return the query param json string only -- the json object that query is assigned to.
4 --------------------------------------------------------------------------
5 Here is an example instantdb query (the examples use an unrelated database):
6
7 Fetch namespace
555 ------------------------------------------------
556
557 Here is the schema of the instantdb database:
558
559 ${schema}

rosylovemain.tsx1 match

@imankii01Updated 3 months ago
554 "🌹 Your love needs more passion! Whisper 'I love you' to the screen and try again. 😘",
555 "😱 API fell in love with your request and froze! Try again soon. 💘",
556 "✨ Oops! The romance overload broke our database. Give it a sec. ⏳",
557 ];
558

valentines_day_card_generatorget_images3 matches

@shouserUpdated 3 months ago
1import { blob } from "https://esm.town/v/std/blob";
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { DATABASE_TABLENAME } from "./constants";
4
5// export async function getImages(type: string, count: number): Promise<string[]> {
8// `
9// SELECT path
10// FROM ${DATABASE_TABLENAME}
11// WHERE type = ?
12// ORDER BY RANDOM()
32
33 for (const [type, count] of Object.entries(typeCountMap)) {
34 const query = `SELECT '${type}' as type, path FROM ${DATABASE_TABLENAME} WHERE type = ? ORDER BY RANDOM() LIMIT ?`;
35 const result = await sqlite.execute(query, [type, count]);
36 results.push(...result.rows);

bookmarksDatabase

@s3thiUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkUpdated 6 months ago