No matches found in users.
Try switching to another result type using the tabs above.
You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7BsvgDataUrl%7D?q=database&page=1&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 7464 results for "database"(2888ms)
No matches found in users.
Try switching to another result type using the tabs above.
179```
180├── backend/
181│ ├── database/
182│ │ ├── migrations.ts # Schema definitions
183│ │ ├── queries.ts # DB query functions
239```
240241### Database Patterns
242- Run migrations on startup or comment out for performance
243- Change table names when modifying schemas rather than altering
2import { Client } from "npm:@notionhq/client";
3import { blobKeyForDemoCache } from "../../shared/utils/blobKeyForDemoCache.ts";
4import { getRelatedPagesFromDatabase } from "../controllers/relatedPages.controller.ts";
56// Initialize Notion client
11export default async function (interval: Interval) {
12// this cron runs every minute
13// it saves a blob for every page in the "Glancer demos" database
14// that holds the Notion data and markup needed for every demo
15// this way, to build a demo in the browser (ie., when /demo/:id is called),
18const twoDaysAgo = new Date(Date.now() - 48 * 60 * 60 * 1000).toISOString();
19try {
20const pages = await notion.databases.query({
21database_id: Deno.env.get("GLANCE_DEMOS_DB_ID"),
22filter: {
23// only get recently edited demos; we don't need to keep stale demos in the cache
29});
30console.log("pages to cache: ", pages.results.length);
31// for each page in the demo database, save a blob
32for (const page of pages.results) {
33// remove properties that are not used in the demo and don't need to be saved to the blob
48page.properties = scrubbed;
4950// get "Glancer content" database pages added to the demo page
51const relatedPages = await getRelatedPagesFromDatabase(page.id);
5253// use the same blob key that /views/demo/demo.ts calls to build the page