Glanceraction.api.routes.ts1 match
12console.log(data);
13try {
14// create a database page in the interactions database
15const page = await setAction(data);
16// console.log(page);
huyhieu.cursorrules2 matches
198```
199โโโ backend/
200โ โโโ database/
201โ โ โโโ migrations.ts # Schema definitions
202โ โ โโโ queries.ts # DB query functions
257```
258259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering
huyhieu.cursorrules2 matches
198```
199โโโ backend/
200โ โโโ database/
201โ โ โโโ migrations.ts # Schema definitions
202โ โ โโโ queries.ts # DB query functions
257```
258259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering
reactHonoStarterREADME.md1 match
21## Further resources
2223- [React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a bigger example project, with a SQLite database table, queries, client-side CSS, a favicon, and shared code that runs on both client and server.
1import { serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { generateCode } from "./backend/generate-code.ts";
3import { createTables } from "./database/migrations.ts";
4import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries.ts";
56await createTables();
cerebras_codermain.tsx2 matches
1import { serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { generateCode } from "./backend/generate-code.ts";
3import { createTables } from "./database/migrations.ts";
4import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries.ts";
56await createTables();
Sketch_IdeasREADME.md1 match
21## Further resources
2223- [React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a bigger example project, with a SQLite database table, queries, client-side CSS, a favicon, and shared code that runs on both client and server.
readwise-ingesterREADME.md4 matches
1# Readwise Shortlist Sync Bot
23This project syncs your Readwise shortlist articles to a SQLite database for easy access and management.
45## Files
27- **Dashboard:** Visit the root URL to see a simple web interface
28- **Sync API:** `POST /sync` - Triggers a sync of your shortlist
29- **Links API:** `GET /links?limit=50` - Retrieves saved links from database
3031### Standalone Version
35- Set up as a cron job for automatic syncing
3637## Database Schema
3839The bot creates a `readwise_links` table with the following fields:
59- `saved_at` - When saved to Readwise
60- `last_moved_at` - When last moved between locations
61- `synced_at` - When synced to our database
6263## Features
readwise-ingesterreadwise-bot.ts10 matches
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
23// Database setup
4const LINKS_TABLE = 'readwise_links';
533}
3435// Initialize database table
36async function initializeDatabase() {
37await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${LINKS_TABLE} (
38id TEXT PRIMARY KEY,
105}
106107// Save documents to database
108async function saveDocumentsToDatabase(documents: ReadwiseDocument[]) {
109let savedCount = 0;
110let updatedCount = 0;
188console.log('Starting Readwise shortlist sync...');
189
190// Initialize database
191await initializeDatabase();
192console.log('Database initialized');
193194// Fetch shortlist documents
201}
202203// Save to database
204const { savedCount, updatedCount } = await saveDocumentsToDatabase(documents);
205
206const message = `Sync completed: ${savedCount} new documents saved, ${updatedCount} documents updated`;
readwise-ingesterreadwise-http.ts13 matches
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
23// Database setup
4const LINKS_TABLE = 'readwise_links';
533}
3435// Initialize database table
36async function initializeDatabase() {
37await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${LINKS_TABLE} (
38id TEXT PRIMARY KEY,
105}
106107// Save documents to database
108async function saveDocumentsToDatabase(documents: ReadwiseDocument[]) {
109let savedCount = 0;
110let updatedCount = 0;
183}
184185// Get saved links from database
186async function getSavedLinks(limit = 50) {
187const results = await sqlite.execute(`
237console.log('Starting Readwise shortlist sync...');
238
239// Initialize database
240await initializeDatabase();
241console.log('Database initialized');
242243// Fetch shortlist documents
257}
258259// Save to database
260const { savedCount, updatedCount } = await saveDocumentsToDatabase(documents);
261
262const message = `Sync completed: ${savedCount} new documents saved, ${updatedCount} documents updated`;
275} else if (path === '/links' && req.method === 'GET') {
276// Get saved links
277await initializeDatabase();
278const limit = parseInt(url.searchParams.get('limit') || '50');
279const links = await getSavedLinks(limit);
309<body>
310<h1>Readwise Shortlist Sync</h1>
311<p>Sync your Readwise shortlist articles to the database.</p>
312
313<button onclick="syncReadwise()">Sync Shortlist</button>