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/?q=database&page=303&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 3309 results for "database"(1596ms)

parseAmazonOrderEmailmain.tsx1 match

@seflless•Updated 4 months ago
133}
134
135// Database Admin
136// https://libsqlstudio.com/client/s/valtown?p=d7880ed3-ad63-4258-a939-5a375f2c3ed8
137//

stirringLavenderStoatmain.tsx1 match

@wade•Updated 4 months ago
42
43 // Mock exchange rates to USD for testing.
44 // In a real scenario, these would come from an external API or database.
45 const mockRatesToUSD: Record<string, number> = {
46 USD: 1,

sqliteExplorerAppREADME.md1 match

@seflless•Updated 4 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

getShowcaseValsREADME.md1 match

@stevekrouse•Updated 4 months ago
1Get vals that were created in the last month, augmented with all sorts of AI and screenshots, and shoved in a sqlite database for @stevekrouse/showcase.

GameAwards2024PredictionGamemain.tsx1 match

@bmitchinson•Updated 4 months ago
159 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
160 const KEY = "GameAwards2024PredictionGame";
161 const SCHEMA_VERSION = 2; // Increment to reset database
162
163 await sqlite.execute(`

notionSiteRssmain.tsx22 matches

@bao•Updated 4 months ago
4 // Retrieve Notion API token from environment variable
5 const notionToken = Deno.env.get("NOTION_API_TOKEN");
6 const databaseId = Deno.env.get("NOTION_DATABASE_ID");
7
8 if (!notionToken || !databaseId) {
9 return new Response("Notion API token or database ID not configured", { status: 500 });
10 }
11
13
14 try {
15 // Fetch database metadata
16 const databaseMetadata = await notion.databases.retrieve({
17 database_id: databaseId,
18 });
19
20 // Fetch pages from the database
21 const response = await notion.databases.query({
22 database_id: databaseId,
23 filter: {
24 property: "Published", // Customize based on your database schema
25 checkbox: {
26 equals: true, // Only fetch published pages
29 sorts: [
30 {
31 timestamp: "last_edited_time", // Customize based on your database schema
32 direction: "descending",
33 },
39 const rssXml = generateRSSFeed(
40 response.results,
41 databaseMetadata,
42 );
43
53}
54
55function generateRSSFeed(pages: any[], databaseMetadata: any): string {
56 // Get database title from database metadata
57 const databaseTitle = databaseMetadata.title[0]?.text.content
58 || `RSS Feed from Notion Database ${databaseMetadata.id}`;
59
60 // Get database description from database metadata
61 const databaseDescription = databaseMetadata.description[0]?.text.content
62 || "";
63
69
70 const itemsXml = pages.map(page => {
71 // Extract page metadata. Customize based on your database
72 const title = page.properties.Name?.title[0]?.plain_text || "Untitled";
73 const url = page.public_url;
75 const lastEditedTime = new Date(page.last_edited_time).toUTCString();
76
77 // Extract tags, handling different Notion multi-select tag formats. Customize based on your database
78 const tags = page.properties.Tags?.multi_select?.map(tag => tag.name) || [];
79
93<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
94<channel>
95 <title>${escapeXml(databaseTitle)}</title>
96 <link>https://baolei.org</link>
97 <description>${escapeXml(databaseDescription)}</description>
98 <pubDate>${pubDate}</pubDate>
99 <atom:link href="${import.meta.url}" rel="self" type="application/rss+xml" />

sqliteExplorerAppREADME.md1 match

@mparker•Updated 4 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

glifbuxmain.tsx2 matches

@jamiedubs•Updated 5 months ago
18}
19
20async function initializeDatabase() {
21 await sqlite.execute(`
22 CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
255
256export default async function(req: Request): Promise<Response> {
257 await initializeDatabase();
258
259 const url = new URL(req.url);

glifInventorymain.tsx3 matches

@jamiedubs•Updated 5 months ago
8const DEFAULT_IMAGE_URL = "https://res.cloudinary.com/dzkwltgyd/image/upload/v1733165766/image-input-block-production/apjbm5nfc6yoevwnisxh.jpg";
9
10// Inventory Database Initialization
11async function initializeInventoryDatabase() {
12 await sqlite.execute(`
13 CREATE TABLE IF NOT EXISTS ${INVENTORY_TABLE} (
225// Main Handler
226export default async function(req: Request): Promise<Response> {
227 await initializeInventoryDatabase();
228
229 const url = new URL(req.url);

notionDbCalendarFeedmain.tsx6 matches

@bao•Updated 5 months ago
5 // Ensure Notion API key is set
6 const notionApiKey = Deno.env.get("NOTION_API_TOKEN");
7 const databaseId = Deno.env.get("NOTION_EVENTS_DATABASE_ID");
8 const datePropertyName = "Date";
9 const maxEventAgeInMonths = 18;
10
11 if (!notionApiKey || !databaseId) {
12 return new Response("Missing Notion API credentials", { status: 500 });
13 }
19 someMonthsAgo.setMonth(someMonthsAgo.getMonth() - maxEventAgeInMonths);
20
21 // Fetch pages from Notion database
22 const response = await notion.databases.query({
23 database_id: databaseId,
24 filter: {
25 and: [
42 // Transform Notion pages to iCal format
43 const events = response.results.map(page => {
44 // Adjust these property names to match your specific Notion database
45 const dateProperty = page.properties[datePropertyName];
46

bookmarksDatabase

@s3thi•Updated 2 months ago

yc_database

@stevekrouse•Updated 5 months ago