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=362&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 3893 results for "database"(2009ms)

notionRecurringTasksmain.tsx4 matches

@apppeak•Updated 7 months ago
3import dayjs from "npm:dayjs";
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
13
14export default async function(interval: Interval) {
15 const response = await notion.databases.query({
16 database_id: DATABASE_ID,
17 filter: {
18 and: [
40
41 const nextItem = {
42 parent: { database_id: DATABASE_ID },
43 properties: {
44 ...item.properties,

lucia_honomain.tsx2 matches

@saolsen•Updated 7 months ago
10import { eq } from "npm:drizzle-orm";
11import { drizzle } from "npm:drizzle-orm/libsql";
12import { LibSQLDatabase } from "npm:drizzle-orm/libsql";
13import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";
14import { Uuid25 } from "npm:uuid25";
66
67 export const schema = { users };
68 export type DB = LibSQLDatabase<typeof schema>;
69}
70

sqliteExplorerAppREADME.md1 match

@feb•Updated 7 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

sqliteExplorerAppREADME.md1 match

@teamgroove•Updated 7 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

sqliteExplorerAppREADME.md1 match

@peterhartree•Updated 8 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

checkHackerNewsForPatreonmain.tsx3 matches

@mikker•Updated 8 months ago
1// This val checks Hacker News for news about Patreon, Buy Me A Coffee, and Ko-fi,
2// sends an email alert if any are found, and keeps track of notified stories in a database.
3// It runs automatically every hour.
4
9const TABLE_NAME = `${KEY}_notified_stories`;
10
11async function initializeDatabase() {
12 await sqlite.execute(`
13 CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
20
21async function checkHackerNewsForPatreon() {
22 await initializeDatabase();
23
24 const response = await fetch("https://hacker-news.firebaseio.com/v0/newstories.json");

notionGetDatabaseREADME.md3 matches

@junhoca•Updated 8 months ago
1# Get all the pages in a notion database
2
3## Usage
4
51. Find your `databaseId`: https://developers.notion.com/reference/retrieve-a-database
62. Get `auth` by setting up an internal integration: https://developers.notion.com/docs/authorization#internal-integration-auth-flow-set-up
7
8Example usage: @stevekrouse.dateMeNotionDatabase
9
10deno-notion-sdk docs: https://github.com/cloudydeno/deno-notion_sdk

notionGetDatabasemain.tsx4 matches

@junhoca•Updated 8 months ago
1export const notionGetDatabase = async ({ databaseId, auth, filter }: {
2 databaseId: string;
3 auth: string;
4 filter?: any;
8 );
9 const notion = new Client({ auth });
10 return collectPaginatedAPI(notion.databases.query, {
11 database_id: databaseId,
12 filter,
13 });

add_to_notion_w_aiREADME.md4 matches

@junhoca•Updated 8 months ago
1Uses instructor and open ai (with gpt-4-turbo) to process any content into a notion database entry.
2
3Use `addToNotion` with any database id and content.
4
5```
10```
11
12Prompts are created based on your database name, database description, property name, property type, property description, and if applicable, property options (and their descriptions).
13
14Supports: checkbox, date, multi_select, number, rich_text, select, status, title, url, email
15
16- Uses `NOTION_API_KEY`, `OPENAI_API_KEY` stored in env variables and uses [Valtown blob storage](https://esm.town/v/std/blob) to store information about the database.
17- Use `get_notion_db_info` to use the stored blob if exists or create one, use `get_and_save_notion_db_info` to create a new blob (and replace an existing one if exists).

add_to_notion_w_aimain.tsx17 matches

@junhoca•Updated 8 months ago
37function createPrompt(title, description, properties) {
38 let prompt =
39 "You are processing content into a database. Based on the title of the database, its properties, their types and options, and any existing descriptions, infer appropriate values for the fields:\n";
40 prompt += `Database Title: ${title}\n`;
41
42 if (description) {
43 prompt += `Database Description: ${description}\n\n`;
44 } else {
45 prompt += "\n";
111}
112
113async function get_and_save_notion_db_processed_properties(databaseId)
114{
115 const response = await notion.databases.retrieve({ database_id: databaseId });
116 const db_id = response.id.replaceAll("-", "");
117 const processed_properties = processProperties(response);
122}
123
124async function get_notion_db_info(databaseId) {
125 databaseId = databaseId.replaceAll("-", "");
126 let db_info = null;
127 try {
128 db_info = await blob.getJSON(databaseId);
129 if (!db_info) {
130 throw new Error("db_info is null or undefined");
131 }
132 } catch (error) {
133 db_info = await get_and_save_notion_db_processed_properties(databaseId);
134 }
135 db_info["zod_schema"] = createZodSchema(db_info["filteredProps"]);
137}
138
139async function get_and_save_notion_db_info(databaseId) {
140 databaseId = databaseId.replaceAll("-", "");
141 let db_info = await get_and_save_notion_db_processed_properties(databaseId);
142 db_info["zod_schema"] = createZodSchema(db_info["filteredProps"]);
143 return db_info;
283}
284
285async function addToNotion(databaseId, text) {
286 databaseId = databaseId.replaceAll("-", "");
287 const properties = await process_text(databaseId, text);
288 console.log(properties);
289 const response = await notion.pages.create({
290 "parent": {
291 "type": "database_id",
292 "database_id": databaseId,
293 },
294 "properties": properties,

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago