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/$%7Burl%7D?q=database&page=5&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 7799 results for "database"(1572ms)

Towniethink.ts1 match

@ianmenethil•Updated 2 days ago
7export const thinkTool = tool({
8 description:
9 "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
10 parameters: z.object({
11 thought: z.string().describe("A thought to think about."),

Towniesystem_prompt.txt2 matches

@ianmenethil•Updated 2 days ago
174```
175├── backend/
176│ ├── database/
177│ │ ├── migrations.ts # Schema definitions
178│ │ ├── queries.ts # DB query functions
234 ```
235
236### Database Patterns
237- Run migrations on startup or comment out for performance
238- Change table names when modifying schemas rather than altering

Towniestripe-webhook.ts1 match

@ianmenethil•Updated 2 days ago
1import { Hono } from "npm:hono";
2import Stripe from "npm:stripe";
3import { addCredits } from "../database/queries.tsx";
4import { getEnvVarName } from "../../shared/is-prod-branch.ts";
5

Towniesend-message.ts1 match

@ianmenethil•Updated 2 days ago
17 insertInferenceCall,
18 startTrackingUsage,
19} from "../database/queries.tsx";
20import {
21 makeChangeValTypeTool,

Towniequeries.tsx1 match

@ianmenethil•Updated 2 days ago
6const PRICE_MULTIPLIER = 1.5;
7
8// Eventually we'll have a user database,
9// but in the meantime, we can cache user info in memory
10const userIdCache: { [key: string]: any } = {};

Towniepurchase-credits.ts1 match

@ianmenethil•Updated 2 days ago
1import { Hono } from "npm:hono";
2import Stripe from "npm:stripe";
3import { getUser } from "../database/queries.tsx";
4import { getEnvVarName } from "../../shared/is-prod-branch.ts";
5

Townieindex.ts1 match

@ianmenethil•Updated 2 days ago
9import favicon from "./frontend/favicon.http.tsx";
10import loginRoute from "./frontend/routes/login.tsx";
11import adminDashboard from "./backend/database/usage-dashboard/index.ts"
12
13const MODULE_URL = import.meta.resolve("./frontend/index.tsx");

Townie.cursorrules2 matches

@ianmenethil•Updated 2 days ago
198```
199├── backend/
200│ ├── database/
201│ │ ├── migrations.ts # Schema definitions
202│ │ ├── queries.ts # DB query functions
257 ```
258
259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering

Towniecredit-balance.ts1 match

@ianmenethil•Updated 2 days ago
1import { Hono } from "npm:hono";
2import { getUser, getCreditBalance } from "../database/queries.tsx";
3
4const app = new Hono();

TownieBRANCH-TODO.md5 matches

@ianmenethil•Updated 2 days ago
14**Goal**: Replace limit checking with credit checking
15
16**Database Changes:**
17
18* Added credit\_additions table with indexes for performance
21
22
23**New Functions in /backend/database/queries.tsx:**
24
25* getCreditBalance(userId) - calculates balance with 50% markup on usage
145--------------------------
146
147**Database Schema:**
148
149Plain textANTLR4BashCC#CSSCoffeeScriptCMakeDartDjangoDockerEJSErlangGitGoGraphQLGroovyHTMLJavaJavaScriptJSONJSXKotlinLaTeXLessLuaMakefileMarkdownMATLABMarkupObjective-CPerlPHPPowerShell.propertiesProtocol BuffersPythonRRubySass (Sass)Sass (Scss)SchemeSQLShellSwiftSVGTSXTypeScriptWebAssemblyYAMLXML` credit_additions ( id, user_id, created_at, stripe_payment_intent_id, amount, note ) -- Indexes on user_id for both credit_additions and townie_usage `
169**Backend:**
170
171* backend/database/schema.tsx - Added credit\_additions table
172
173* backend/database/queries.tsx - New credit functions, removed old limits
174
175* backend/routes/send-message.ts - Updated to use credit checking

bookmarksDatabase

@s3thi•Updated 4 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 7 months ago