3Creates a global redis instance and exposes functions to use it.
4
5To use, create a redis database on [Upstash](https://upstash.com/) and set the environment variables.
6* `UPSTASH_REDIS_REST_URL`
7* `UPSTASH_REDIS_REST_TOKEN`
20 "papers": {
21 "todoist-section-id": "SECTION_ID_HERE",
22 "notion-map-type": "database",
23 "notion-id": "DB_ID_HERE",
24 },
102}
103
104async function addPageToNotionDatabse(database_id, content) {
105 const response = await notion.pages.create({
106 "parent": {
107 "type": "database_id",
108 "database_id": database_id,
109 },
110 "properties": {
133 addCalloutToNotionPage(mappedNotionId, task.content, convertDateObject(task.due));
134 }
135 else if (mappedNotionType == "database" && mappedNotionId) {
136 addPageToNotionDatabse(mappedNotionId, task.content);
137 }
1Use todoist for quick notes to add to notion. Uses project to decide which project to fetch to add stuff to notion. Can add to page or database based on config below. Demarkation using sections in the todoist project. Extracts date for page blocks that are added as callouts.
2
3Migrated from folder: Public/add_to_notion_from_todoist
8
9 if (!NOTION_API_KEY || !PAPERPILE_DB_ID) {
10 throw new Error("Please fill in your API key and database ID");
11 }
12 let dont_update = [];
14 const notion = new Client({ auth: NOTION_API_KEY });
15
16 const databaseId = PAPERPILE_DB_ID;
17
18 const queryResponse = await notion.databases.query({
19 database_id: databaseId,
20 page_size: 100,
21 filter: {
35
36 console.log(
37 `Checked database, found ${relevant_results.length} items to update.`,
38 );
39
1import { notionGetDatabase } from "https://esm.town/v/stevekrouse/notionGetDatabase";
2import process from "node:process";
3
4export let dateMeNotionDatabase = notionGetDatabase({
5 databaseId: "725cb1d741674413b933a37a50f1961f",
6 auth: process.env.notion,
7});
2
3```ts
4import { setupDatabase } from "https://esm.town/v/stevekrouse/dateme_sqlite"
5
6await setupDatabase()
7```
8
1Implementation of Redis-like cache - a key-value store with expiring keys. Data is stored in the Val Town SQLite database and shared between all your vals.
2
3# Setup
7It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
8
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
7It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
8
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
7[Turso](https://turso.tech/) is a serverless SQLite platform designed for the edge. It runs [libSQL](https://github.com/libsql/libsql), their open contribution fork of SQLite.
8
9Every Val Town user automatically gets their own Turso SQLite database! It's great for >100kb data (ie bigger than a val) or when you need SQL: relations, ACID transactions, etc.
10
11Storage used in Turso will count against your Val Town total storage (10mb for free users; 1gb for Pro users). Contact us if you'd need more – it should be no problem!
35## Architecture
36
37This @std.turso function is the client or SDK to @std.tursoAPI, which acts as a "proxy" to Turso. It handles authentication, creates databases, and forwards on your SQL queries. You can get lower latency (~200ms vs ~800ms), more storage, databases, CLI & API access by having your own Turso account.