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%20%22Image%20title%22?q=database&page=330&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 4179 results for "database"(1055ms)

hn_notifierutils.ts2 matches

@nbbaier•Updated 1 month ago
71
72/**
73 * Creates a database item from Hacker News API response data
74 * @param id - The ID of the Hacker News item
75 * @param data - The Hacker News API response data
76 * @returns A promise that resolves to a formatted database item
77 */
78export async function createDBItem(

cerebras_coderindex2 matches

@smirfolio•Updated 1 month 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> {
SecureSend

SecureSendmain.tsx2 matches

@maxm•Updated 1 month ago
4const table_prefix = "efs";
5
6// Initialize database schema
7async function initDB() {
8 await sqlite.batch([
763// Main handler
764export default async function(req: Request): Promise<Response> {
765 // Initialize the database
766 await initDB();
767

onboarding_drafttutorial.ts5 matches

@charmaine•Updated 1 month ago
101 instructions: `
102 <p><b>1.</b> Create <code>sqliteStorage.ts</code> with this code:</p>
103 <p>This creates a SQLite database to store your todos permanently!</p>
104 `,
105 code: `import { sqlite } from "https://esm.town/v/std/sqlite";
113
114await sqlite.execute(TABLE_SCHEMA);
115console.log("Database table 'todos' checked/created.");
116
117// Type definition for todo items from database
118interface Todo {
119 id: number;
164 title: "Step 4b: Update Web App",
165 instructions: `
166 <p><b>Task:</b> Now let's update <code>todo.ts</code> to use the database!</p>
167 <p>Replace the <b>entire content</b> of <code>todo.ts</code> with this code:</p>
168 `,
280 <ul>
281 <li>Web App: <code>todo.ts</code></li>
282 <li>Database: <code>sqliteStorage.ts</code></li>
283 <li>Email: <code>emailReminder.ts</code></li>
284 </ul>

hn_notifierqueries.ts5 matches

@nbbaier•Updated 1 month ago
1import { tableName } from "https://esm.town/v/nbbaier/hn_notifier/backend/database/migrations.ts";
2import type { DBItem } from "https://esm.town/v/nbbaier/hn_notifier/shared/types.ts";
3import sqliteRowsToObject from "https://esm.town/v/nbbaier/sqliteRowsToObject?v=6";
5
6/**
7 * Follows a Hacker News item by inserting it into the database
8 * @param {DBItem} item - The item to follow containing id and comments
9 * @returns {Promise<DBItem[]>} The inserted item
19
20/**
21 * Unfollows a Hacker News item by deleting it from the database
22 * @param {number} id - The ID of the item to unfollow
23 * @returns {Promise<void>}
31
32/**
33 * Retrieves a single item from the database by ID
34 * @param {number} id - The ID of the item to retrieve
35 * @returns {Promise<DBItem[]>} The matching item(s)
44
45/**
46 * Retrieves all items from the database
47 * @returns {Promise<DBItem[]>} Array of all items
48 */

hn_notifierapi.ts1 match

@nbbaier•Updated 1 month ago
1import { HTTPException } from "https://esm.sh/hono@4.7.4/http-exception";
2import * as db from "https://esm.town/v/nbbaier/hn_notifier/backend/database/queries.ts";
3import {
4 createDBItem,

hn_notifierindex.ts1 match

@nbbaier•Updated 1 month ago
1import api from "https://esm.town/v/nbbaier/hn_notifier/backend/api.ts";
2import { createTables } from "https://esm.town/v/nbbaier/hn_notifier/backend/database/migrations.ts";
3import {
4 readFile,

stevensgetCalendarEvents.ts1 match

@geoffreylitt•Updated 1 month ago
125 }
126
127 console.log(`Calendar events imported into the database.`);
128 return events;
129 } catch (error) {

FC-Alt-Client-RedirectREADME.md1 match

@artlu•Updated 1 month 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/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.

vtProjectSearch2db.ts3 matches

@charmaine•Updated 1 month ago
172
173/**
174 * Get database statistics for the homepage
175 */
176export async function getSearchStats(): Promise<{
837 const offset = (page - 1) * pageSize;
838
839 // Start all database queries in parallel
840 // 1. Launch count queries
841 const countsPromise = Promise.all([
924 );
925
926 // Wait for all database operations to complete in parallel
927 const [
928 [totalFileResults, totalProjectResults, totalUserResults],

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago