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=357&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"(1407ms)

InstantQuerygetSystemPrompt4 matches

@vawogbemiUpdated 2 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 2 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 2 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);
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useCallback, useRef, useState } from "https://esm.sh/react@18.2.0";
4import { DATABASE_TABLENAME } from "./constants";
5
6function App() {
179 // const KEY = new URL(import.meta.url).pathname.split("/").at(-1);
180 await sqlite.execute(`
181 CREATE TABLE IF NOT EXISTS ${DATABASE_TABLENAME} (
182 id INTEGER PRIMARY KEY AUTOINCREMENT,
183 type TEXT NOT NULL,
203 // Save metadata to SQLite
204 await sqlite.execute(
205 `INSERT INTO ${DATABASE_TABLENAME} (type, path) VALUES (?, ?)`,
206 [imageType, publicUrl],
207 );

vtdbmain.tsx5 matches

@gUpdated 2 months ago
1import type { CompiledQuery, DatabaseConnection, Dialect, QueryResult, Selectable } from 'npm:kysely';
2import { Kysely } from 'npm:kysely';
3import { DummyDriver, SqliteAdapter, SqliteIntrospector, SqliteQueryCompiler } from 'npm:kysely';
6import { db as restdriver } from 'https://esm.town/v/sqlite/db';
7
8interface Database {
9 vals: ValsTable;
10}
23
24class VTDriver extends DummyDriver {
25 async acquireConnection(): Promise<DatabaseConnection> {
26 return new VTConnection();
27 }
28}
29class VTConnection implements DatabaseConnection {
30 async executeQuery<R>(compiledQuery: CompiledQuery): Promise<QueryResult<R>> {
31 const formattedQuery = SqlString.format(compiledQuery.sql, compiledQuery.parameters);
47};
48
49export const vtdb = new Kysely<Database>({ dialect });
50export default vtdb;

vtdbREADME.md2 matches

@gUpdated 2 months ago
1# Val Town Database
2
3This val exports `vtdb`, a correctly typed **Kysely** instance
4to query the [@sqlite.db](https://www.val.town/v/sqlite/db) database containing public vals.
5
6Example usage:
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 const manager = {
14 `
15 SELECT path
16 FROM ${DATABASE_TABLENAME}
17 WHERE type = ?
18 ORDER BY RANDOM()
1export const DATABASE_TABLENAME = "VALENTINES_DAY_CARD_IMGS";

datemeREADME.md2 matches

@stevekrouseUpdated 3 months ago
4
5The directory is a simple
6database of Date Me Docs. Date Me Docs are long-form, earnest dating profiles for romantic partners.
7[Learn more here](https://dateme.directory/faq).
8
9## Todos
10
11- [ ] Make the SQLite database forkable and build a widget/workflow for that, ie fix @stevekrouse/dateme_sqlite
12- [ ] Require an email (that isn't shared publicly)
13 - [ ] Verify the email address with a "magic link"
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 const manager = {
14 `
15 SELECT path
16 FROM ${DATABASE_TABLENAME}
17 WHERE type = ?
18 ORDER BY RANDOM()

bookmarksDatabase

@s3thiUpdated 2 months ago

sqLiteDatabase1 file match

@ideofunkUpdated 5 months ago