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/image-url.jpg?q=database&page=209&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 7155 results for "database"(4426ms)

github-commit-extractorauth.ts5 matches

@stevekrouseโ€ขUpdated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getCookie, setCookie, deleteCookie } from "https://esm.sh/hono@3.11.7/cookie";
3import { createSession, deleteSession } from "../database/sessions.ts";
4import { storeOAuthState, verifyOAuthState } from "../database/oauth_states.ts";
5import type { GitHubUser } from "../../shared/types.ts";
6
39 });
40
41 // Store state in database instead of cookie for better reliability
42 await storeOAuthState(state);
43
44 console.log('OAuth state stored in database:', state);
45
46 return new Response(null, {
98 }
99
100 // Verify state using database
101 const stateValid = await verifyOAuthState(state);
102 if (!stateValid) {

github-commit-extractorREADME.md1 match

@stevekrouseโ€ขUpdated 2 weeks ago
120โ”œโ”€โ”€ backend/
121โ”‚ โ”œโ”€โ”€ index.ts # Main Hono server with routes
122โ”‚ โ”œโ”€โ”€ database/
123โ”‚ โ”‚ โ””โ”€โ”€ sessions.ts # Session management
124โ”‚ โ””โ”€โ”€ routes/

github-commit-extractorapi.ts1 match

@stevekrouseโ€ขUpdated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getCookie } from "https://esm.sh/hono@3.11.7/cookie";
3import { getSession } from "../database/sessions.ts";
4import type { GitHubUser, GitHubRepo, GitHubCommit, CommitExtractRequest } from "../../shared/types.ts";
5

support_caseindex.ts5 matches

@beekayโ€ขUpdated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { runMigrations } from "./database/migrations.ts";
4import auth from "./routes/auth.ts";
5import transactions from "./routes/transactions.ts";
14});
15
16// Initialize database on startup
17let dbInitialized = false;
18async function initializeDatabase() {
19 if (!dbInitialized) {
20 await runMigrations();
35// Serve main app
36app.get("/", async c => {
37 await initializeDatabase();
38
39 let html = await readFile("/frontend/index.html", import.meta.url);
56 status: "healthy",
57 timestamp: new Date().toISOString(),
58 database: dbInitialized ? "initialized" : "pending"
59 });
60});

support_caseanalytics.ts2 matches

@beekayโ€ขUpdated 2 weeks ago
5 getMonthlyData,
6 getTotalBalance
7} from "../database/queries.ts";
8
9const analytics = new Hono();
17
18 const token = authHeader.substring(7);
19 const { getSessionByToken } = await import("../database/queries.ts");
20 const session = await getSessionByToken(token);
21 return session?.user_id || null;

support_casebudgets.ts2 matches

@beekayโ€ขUpdated 2 weeks ago
5 getUserBudgets,
6 deleteBudget
7} from "../database/queries.ts";
8
9const budgets = new Hono();
17
18 const token = authHeader.substring(7);
19 const { getSessionByToken } = await import("../database/queries.ts");
20 const session = await getSessionByToken(token);
21 return session?.user_id || null;

support_casetransactions.ts2 matches

@beekayโ€ขUpdated 2 weeks ago
7 updateTransaction,
8 deleteTransaction
9} from "../database/queries.ts";
10
11const transactions = new Hono();
19
20 const token = authHeader.substring(7);
21 const { getSessionByToken } = await import("../database/queries.ts");
22 const session = await getSessionByToken(token);
23 return session?.user_id || null;

support_caseauth.ts2 matches

@beekayโ€ขUpdated 2 weeks ago
7 deleteSession,
8 getSessionByToken
9} from "../database/queries.ts";
10
11const auth = new Hono();
177 }
178
179 const { getUserById } = await import("../database/queries.ts");
180 const user = await getUserById(session.user_id);
181

support_casemigrations.ts2 matches

@beekayโ€ขUpdated 2 weeks ago
2
3export async function runMigrations() {
4 console.log("Running database migrations...");
5
6 // Users table
56 `);
57
58 console.log("Database migrations completed successfully!");
59}

support_caseREADME.md5 matches

@beekayโ€ขUpdated 2 weeks ago
17```
18โ”œโ”€โ”€ backend/
19โ”‚ โ”œโ”€โ”€ database/
20โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Database schema setup
21โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database query functions
22โ”‚ โ”œโ”€โ”€ routes/
23โ”‚ โ”‚ โ”œโ”€โ”€ auth.ts # Authentication routes
45- **Backend**: TypeScript with Hono framework
46- **Frontend**: React 18.2.0 with TypeScript
47- **Database**: SQLite
48- **Styling**: TailwindCSS
49- **Charts**: Chart.js
53
541. Set the backend trigger to HTTP
552. The app will automatically set up the database on first run
563. Access the app through the HTTP endpoint
574. Create an account and start tracking your budget!

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago