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=307&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 3427 results for "database"(553ms)

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

findingsvgfilesmain.tsx2 matches

@richi1969•Updated 5 months ago
42 <p>Our comprehensive resource center is dedicated to helping you navigate the exciting world of Cricut crafting. We'll guide you through finding the best free SVG files, understanding their potential, and mastering your Cricut machine to bring your most imaginative designs to life.</p>
43
44 <p>For those looking to dive deep into the world of free SVG resources, we recommend exploring sites like <a href="https://crafty-crafter.club" target="_blank" rel="noopener noreferrer">Crafty Crafter Club</a>, which offers an extensive collection of community-driven designs. Additionally, <a href="https://svgfiles.info/" target="_blank" rel="noopener noreferrer">SVG Files Info</a> provides a comprehensive database of high-quality vector graphics that can elevate your crafting projects.</p>
45 </section>
46 </div>
68 <li>
69 <strong>SVG Files Info</strong>
70 <p>The ultimate comprehensive SVG database for digital crafters. <a href="https://svgfiles.info/" target="_blank" rel="noopener noreferrer">SVG Files Info</a> offers an unparalleled collection of vector graphics that cater to every imaginable crafting project.</p>
71 </li>
72 </ul>

notionDbCalendarFeedREADME.md3 matches

@bao•Updated 5 months ago
1Publishes a Notion database with a date property to a calendar feed.
2
31. Create a Notion integration in http://notion.so/profile/integrations
42. Go to the Notion database -> click ••• from top right -> Connections -> Connect to, select the integration from last step
53. Fork this val
64. Set NOTION_API_TOKEN and NOTION_EVENTS_DATABASE_ID in https://www.val.town/settings/environment-variables
75. Update datePropertyName and maxEventAgeInMonths if necessary

notionSiteRssREADME.md4 matches

@bao•Updated 5 months ago
1Generate an RSS feed for your Notion site.
2
3Prerequisite: the articles/posts needs to be in a Notion database.
4
51. Create a Notion integration in http://notion.so/profile/integrations
62. Go to the Notion database -> click ••• from top right -> Connections -> Connect to, select the integration from last step
73. Fork this val
84. Set up your NOTION_DATABASE_ID and NOTION_API_TOKEN in: https://www.val.town/settings/environment-variables
95. Update the code to customize with your database properties (look out for "Customize based on your database")
106. Share the RSS url

sqlite2README.md2 matches

@std•Updated 5 months ago
4Specifically, this will support the full [@libsql/client interface](https://docs.turso.tech/sdk/ts/reference#simple-query)._
5
6[SQLite](https://www.sqlite.org/) is a lightweight, standard database. Every Val Town account comes with its own private SQLite database that is accessible from any of your vals via [`std/sqlite`](https://www.val.town/v/std/sqlite).
7
8Val Town SQLite is powered by [Turso](https://turso.tech/).
12* [ORMs](https://docs.val.town/std/sqlite/orms)
13
14We recommend these admin data viewers for managing your database – viewing or editing data or your database table schema:
15
16* [Outerbase Studio](https://libsqlstudio.com/) **(recommended)** - formely known as LibSQL Studio – see instructions [here](https://libsqlstudio.com/docs/connect-valtown)

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago