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/$%7BsvgDataUrl%7D?q=database&page=18&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 7799 results for "database"(4714ms)

Glancer_TesthealthCheck.ts3 matches

@charmaineโ€ขUpdated 4 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 });

Glancer_TestgetRelatedPagesFromDatabase.ts4 matches

@charmaineโ€ขUpdated 4 days ago
6});
7
8export async function getRelatedPagesFromDatabase(pageId: string) {
9 try {
10 const response = await notion.databases.query({
11 database_id: Deno.env.get("GLANCE_CONTENT_DB_ID"),
12 filter: {
13 property: "Glancer demos", // the property in the Glancer content database that connects to the /demo
14 relation: {
15 contains: pageId, // the Glancer demos property holds the /demo page id to which it is related

Glancer_TestgetDatabase.ts5 matches

@charmaineโ€ขUpdated 4 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 {

Glancer_TestgetActions.ts8 matches

@charmaineโ€ขUpdated 4 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 });

Glancer_Testdemo.ts2 matches

@charmaineโ€ขUpdated 4 days ago
7import { examplePDF } from "../../api/servePDF.ts";
8import { getPage } from "../../../controllers/getPage.ts";
9import { getRelatedPagesFromDatabase } from "../../../controllers/getRelatedPagesFromDatabase.ts";
10
11const app = new Hono();
34
35 // get related Glancer content
36 const relatedPages = await getRelatedPagesFromDatabase(id);
37 // console.log("relatedPages: ", relatedPages);
38

Glancer_Testdemo.ts1 match

@charmaineโ€ขUpdated 4 days ago
1import { Hono } from "npm:hono";
2import { getPage } from "../../controllers/getPage.ts";
3import { getDatabase } from "../../controllers/getDatabase.ts";
4
5const app = new Hono();

Glancer_TestdemoCache.ts5 matches

@charmaineโ€ขUpdated 4 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);

Glancer_Testdatabase.ts2 matches

@charmaineโ€ขUpdated 4 days ago
1import { Hono } from "npm:hono";
2import { getDatabase } from "../../controllers/getDatabase.ts";
3
4const app = new Hono();
9 // hit the controller to return data
10 try {
11 const data = await getDatabase(id);
12 //
13 console.log(data);

Glancer_Test.cursorrules2 matches

@charmaineโ€ขUpdated 4 days ago
198```
199โ”œโ”€โ”€ backend/
200โ”‚ โ”œโ”€โ”€ database/
201โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
202โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
257 ```
258
259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering

Glancer_Testapi.ts2 matches

@charmaineโ€ขUpdated 4 days ago
3// Import route modules
4import cobrowse from "./cobrowse.ts";
5import database from "./database.ts";
6import demo from "./demo.ts";
7import page from "./page.ts";
12
13// mount routes
14app.route("/db", database);
15app.route("/page", page);
16app.route("/cobrowse", cobrowse);

bookmarksDatabase

@s3thiโ€ขUpdated 4 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 7 months ago