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=145&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 7106 results for "database"(820ms)

todo-sqlitetodos.ts2 matches

@diegoivo•Updated 6 days ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getTodos, getTodo, createTodo, updateTodo, deleteTodo, createUser } from "../database/queries.ts";
3import type { CreateTodoRequest, UpdateTodoRequest } from "../../shared/types.ts";
4
12 }
13
14 // Ensure user exists in database
15 await createUser(email);
16 c.set('userEmail', email);

GlancersetAction.ts1 match

@lightweight•Updated 6 days ago
12 console.log(data);
13 try {
14 // create a database page in the interactions database
15 const page = await setAction(data);
16 // console.log(page);

GlancersetAction.ts1 match

@lightweight•Updated 6 days ago
10 const page = await notion.pages.create({
11 parent: {
12 database_id: Deno.env.get("GLANCE_INTERACTIONS_DB_ID"),
13 },
14 properties: {

GlancerservePDF.ts1 match

@lightweight•Updated 6 days ago
8
9 // get each of the actions from this demo from Notion
10 // data is stored in the "Glancer interactions" database and attached to the demo via relation
11 // we can't really use the relation property b/c that only holds an array of page IDs in Notion
12 // so, in Notion, we use a formula to transform the relation array into a string

GlancerREADME.md10 matches

@lightweight•Updated 6 days ago
221```typescript
222export default async function (interval: Interval) {
223 const pages = await notion.databases.query({
224 database_id: Deno.env.get("GLANCE_DEMOS_DB_ID"),
225 });
226
244});
245
246const databaseId = Deno.env.get("GLANCE_DEMOS_DB_ID");
247```
248
250
251- `NOTION_API_KEY`: Notion integration token
252- `GLANCE_DEMOS_DB_ID`: Notion database ID for demo pages
253- `GLANCE_INTERACTIONS_DB_ID`: Notion database ID for interaction tracking
254
255## Project Conventions
291- `/api/*`: JSON data endpoints for frontend consumption
292- `/demo/*`: Personalized demo page serving with data injection
293- `/tasks/*`: Notion webhook processing and database updates
294
295## External Dependencies
300
301- **Email and Alerting**: Slack notifications and email alerts are configured within Notion
302- **Database Management**: Three core Notion databases power the application:
303 - **Glancer Demos Database**: Stores demo configurations, visitor information, and personalization data
304 - **Glancer Interactions Database**: Warehouses demo events, clicks, and user behavior analytics
305 - **Glancer Agents Database**: Manages agent assignments, availability, and contact information
306
307The Val Town application serves as an automation and presentation layer that extends Notion's native capabilities, providing real-time cobrowsing experiences while maintaining all data persistence and workflow management within the Notion ecosystem.

GlancerINSTRUCTIONS.md5 matches

@lightweight•Updated 6 days ago
43- blob storage for the cache, which enables snappy demos
44- cron(s) that keep the cache up-to-date
45- environment variables, which we use to store connection details for Notion, database ids for essential Notion databases (including the demos and interactions databases)
46- logging features
47
63
64- email and other alerting (e.g., Slack)
65- databases, including:
66 - the "Glancer demos" database
67 - the "Glancer interactions" database, which is where certain demo events (e.g., clicks) are warehoused and visualized
68 - the "Glancer agents" database, which handles agent assignments and management
69
70Note that this app integrates with Notion to extend Notion in important ways; namely, automation and logging. Please be clear about that.

GlancerhealthCheck.ts3 matches

@lightweight•Updated 6 days ago
12 status: "connected",
13 message: "Successfully connected to Notion API",
14 databases: response.results.map((db) => ({
15 title: db.title?.[0]?.plain_text || "Untitled",
16 id: db.id,
20
21// update the cache
22// this cron updates a blob that stores the JSON that shows the databases that val.town is connected to
23// we present that at root and embed that into Notion
24// to show everyone that the connection is healthy btw Notion and val.town
29 filter: {
30 property: "object",
31 value: "database",
32 },
33 });

GlancergetDatabase.ts5 matches

@lightweight•Updated 6 days ago
6});
7
8export async function getDatabase(id: string) {
9 // get database
10 try {
11 const database = await notion.databases.retrieve({
12 database_id: id,
13 });
14 return database;
15 } catch (error: any) {
16 return {

GlancergetActions.ts8 matches

@lightweight•Updated 6 days ago
7
8export async function getAllInteractionsPages() {
9 const databaseId = Deno.env.get("GLANCE_INTERACTIONS_DB_ID");
10
11 if (!databaseId) {
12 throw new Error(
13 "GLANCE_INTERACTIONS_DB_ID environment variable is not set"
16
17 try {
18 const response = await notion.databases.query({
19 database_id: databaseId,
20 });
21
37
38export async function getAllInteractionsPagesWithPagination() {
39 const databaseId = Deno.env.get("GLANCE_INTERACTIONS_DB_ID");
40
41 if (!databaseId) {
42 throw new Error(
43 "GLANCE_INTERACTIONS_DB_ID environment variable is not set"
51
52 while (hasMore) {
53 const response = await notion.databases.query({
54 database_id: databaseId,
55 start_cursor: startCursor,
56 });

GlancerdemoCache.ts5 matches

@lightweight•Updated 6 days ago
12// that blob determines whether or not the cobrowsing button is ON or OFF
13export default async function (interval: Interval) {
14 // every page in the "Glancer demo" database should have it's own blob, so we have a cache for each demo
15 // this cron saves a blob for every page in the Demos DB
16 try {
17 // get notion pages with the databaseId
18 const pages = await notion.databases.query({
19 database_id: Deno.env.get("GLANCE_DEMOS_DB_ID"),
20 });
21 // for each page in the demo database, save a blob
22 for (const page of pages.results) {
23 const blobKey = await blobKeyForDemoCache(import.meta.url, page.id);

bookmarksDatabase

@s3thi•Updated 3 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 6 months ago