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/?q=database&page=75&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 8544 results for "database"(8377ms)

doodleindex.tsx1 match

@helge•Updated 2 weeks ago
15};
16
17// Database setup
18await sqlite.execute(`
19 CREATE TABLE IF NOT EXISTS doodle_votes (

Linear-Slack-PingslashCommand.ts2 matches

@charmaine•Updated 2 weeks ago
1import { getLinearTicket, extractTicketId } from "./linearApi.ts";
2import { lookupUserByEmail, openModal } from "./slackApi.ts";
3import { getRemindersByCreator, initDatabase } from "./database.ts";
4import { LinearTicket, LinearIssue } from "./types.ts";
5
12 const userId = formData.get("user_id") as string;
13
14 await initDatabase();
15
16 if (command === "/track-linear") {

Linear-Slack-PingmodalSubmit.ts1 match

@charmaine•Updated 2 weeks ago
1import { createReminder } from "./database.ts";
2import { getLinearTicket } from "./linearApi.ts";
3import { SlackModalPayload } from "./types.ts";

Linear-Slack-PingcronChecker.ts1 match

@charmaine•Updated 2 weeks ago
1import { getActiveReminders, updateReminder } from "./database.ts";
2import { getLinearTicket } from "./linearApi.ts";
3import { sendDirectMessage } from "./slackApi.ts";

Linear-Slack-PingREADME.md1 match

@charmaine•Updated 2 weeks ago
27- **Linear SDK**: `@linear/sdk` for type-safe Linear queries
28- **Val Town**: Serverless hosting with Deno runtime
29- **SQLite**: Built-in Val Town database
30
31## Setup Instructions

Linear-Slack-Pingdatabase.ts1 match

@charmaine•Updated 2 weeks ago
2import { Reminder } from "./types.ts";
3
4export async function initDatabase() {
5 await sqlite.execute({
6 sql: `

reactHonoStarterREADME.md1 match

@Lebza•Updated 2 weeks ago
21## Further resources
22
23- [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.

Kinobitypes.d.ts1 match

@omniharmonic•Updated 2 weeks ago
8// Explicit module declarations for Bun built-ins
9declare module "bun:sqlite" {
10 export class Database {
11 constructor(filename: string);
12 query(sql: string): {

Kinobiserver.ts16 matches

@omniharmonic•Updated 2 weeks ago
1import { Database } from "bun:sqlite";
2import { join } from "path";
3
5const dbPath = process.env.DB_PATH || (isDev ? "shitty.db" : "/app/data/shitty.db");
6
7// Initialize database with error handling
8let db: Database;
9try {
10 db = new Database(dbPath);
11 console.log(`[INFO] Database initialized at: ${dbPath}`);
12} catch (error) {
13 console.error(`[ERROR] Failed to initialize database at ${dbPath}:`, error);
14 throw error;
15}
25}
26
27// Initialize database
28try {
29 await db.exec(`
37 )
38 `);
39 console.log("[INFO] Database table created/verified");
40} catch (error) {
41 console.error("[ERROR] Failed to create database table:", error);
42 throw error;
43}
44
45// Database schema migration
46function migrateDatabase() {
47 try {
48 // Check if new columns exist, add them if they don't
55 if (!hasConfig) {
56 db.query("ALTER TABLE kinobi_instances ADD COLUMN config TEXT").run();
57 console.log("Added config column to database");
58 }
59
60 if (!hasTenderScores) {
61 db.query("ALTER TABLE kinobi_instances ADD COLUMN tender_scores TEXT").run();
62 console.log("Added tender_scores column to database");
63 }
64 } catch (error) {
65 console.warn("Database migration warning:", error);
66 }
67}
68
69// Run migration on startup
70migrateDatabase();
71
72// Helper functions
105
106 let result = query.get(syncId) as any;
107 console.log(`[DEBUG] Database query result:`, result ? "found" : "not found");
108
109 if (!result) {

reddit-checkerREADME.md4 matches

@sunnyatlightswitch•Updated 2 weeks ago
9- **Multi-Subreddit Support**: Monitors 11 subreddits simultaneously
10- **Dual Notifications**: Sends both Slack and email notifications
11- **Database Storage**: Automatically saves matching posts to Supabase database
12- **Automated Scheduling**: Runs on cron schedule for consistent monitoring
13- **Manual Override**: Can also be run manually when needed
69- **Post Limit**: 25 posts per subreddit per check
70- **Notifications**: Both Slack and Email enabled
71- **Database**: Supabase integration enabled
72- **Execution**: Automated cron scheduling + manual override capability
73
118- **Format**: Both plain text and HTML versions
119
120### 3. Save to Supabase Database
121- **Table**: `relevant_reddit_posts`
122- **Fields Stored**:
207- ✅ **Multi-Method Fetching**: Reddit API → JSON API → RSS fallbacks
208- ✅ **Multi-Subreddit Support**: 11 subreddits monitored simultaneously
209- ✅ **Triple Output**: Slack notifications + Email alerts + Database storage
210- ✅ **Robust Error Handling**: Continues even if some subreddits fail
211- ✅ **Comprehensive Logging**: Detailed execution information

customer-database-setup2 file matches

@stevenvapi•Updated 1 week ago

prDatabase

@pdw•Updated 2 weeks ago