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=257&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 10131 results for "database"(5476ms)

Towniepurchase-credits.ts1 match

@fave_24β€’Updated 3 months 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

Townie.cursorrules2 matches

@fave_24β€’Updated 3 months 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

@fave_24β€’Updated 3 months ago
1import { Hono } from "npm:hono";
2import { getUser, getCreditBalance } from "../database/queries.tsx";
3
4const app = new Hono();

TownieBRANCH-TODO.md5 matches

@fave_24β€’Updated 3 months 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

val-town-http-mcp-servervalley.txt4 matches

@tkneislyβ€’Updated 3 months ago
189```
190β”œβ”€β”€ backend/
191β”‚ β”œβ”€β”€ database/
192β”‚ β”‚ β”œβ”€β”€ migrations.ts # Schema definitions
193β”‚ β”‚ β”œβ”€β”€ queries.ts # DB query functions
248 ```
249
250### Database Patterns
251- Run migrations on startup or comment out for performance
252- Change table names when modifying schemas rather than altering
315
316### SQL Operations
317- **execute-sql** / **sqlite-query**: Execute a SQL query against a SQLite database
318- **execute-sql-batch** / **sqlite-exec**: Execute multiple SQL statements against a SQLite database
319
320## Creating Val Town Projects

val-town-http-mcp-servervalley_local.txt3 matches

@tkneislyβ€’Updated 3 months ago
97```
98β”œβ”€β”€ backend/
99β”‚ β”œβ”€β”€ database/
100β”‚ β”‚ β”œβ”€β”€ migrations.ts
101β”‚ β”‚ └── queries.ts
229#### SQL Operations
23021. **execute-sql** / **sqlite-query**
231 - Description: Execute a SQL query against a SQLite database
232 - Arguments: `statement` (string)
233 - Returns: Query results
234
23522. **execute-sql-batch** / **sqlite-exec**
236 - Description: Execute multiple SQL statements against a SQLite database
237 - Arguments: `statements` (array of strings), Optional: `mode` (string: "read" or "write", default: "read")
238 - Returns: Results of the batch execution

val-town-http-mcp-serversqliteTools.ts4 matches

@tkneislyβ€’Updated 3 months ago
9 server.tool(
10 "execute-sql",
11 "Execute a SQL query against a SQLite database",
12 {
13 statement: z.string().describe("SQL statement to execute"),
36 server.tool(
37 "execute-sql-batch",
38 "Execute multiple SQL statements against a SQLite database",
39 {
40 statements: z.array(z.string()).describe("Array of SQL statements to execute"),
67 server.tool(
68 "sqlite-query",
69 "Execute a SQL query against a SQLite database",
70 {
71 statement: z.string().describe("SQL statement to execute"),
94 server.tool(
95 "sqlite-exec",
96 "Execute multiple SQL statements against a SQLite database",
97 {
98 statements: z.array(z.string()).describe("Array of SQL statements to execute"),

val-town-http-mcp-serveropentownie.txt2 matches

@tkneislyβ€’Updated 3 months ago
172```
173β”œβ”€β”€ backend/
174β”‚ β”œβ”€β”€ database/
175β”‚ β”‚ β”œβ”€β”€ migrations.ts # Schema definitions
176β”‚ β”‚ β”œβ”€β”€ queries.ts # DB query functions
234- Handle API calls properly with proper error catching
235
236### Database Patterns
237- Run migrations on startup or comment out for performance
238- Change table names when modifying schemas rather than altering

val-to-textvaltown.mdc2 matches

@tkneislyβ€’Updated 3 months ago
179```
180β”œβ”€β”€ backend/
181β”‚ β”œβ”€β”€ database/
182β”‚ β”‚ β”œβ”€β”€ migrations.ts # Schema definitions
183β”‚ β”‚ β”œβ”€β”€ queries.ts # DB query functions
239 ```
240
241### Database Patterns
242- Run migrations on startup or comment out for performance
243- Change table names when modifying schemas rather than altering

untitled-6069main.tsx11 matches

@masterpieceβ€’Updated 3 months ago
83 </a>
84 <div class="dropdown-content" id="departmentsDropdown">
85 <!-- Dynamically populated from database -->
86 </div>
87 </div>
117 </div>
118 <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="webinarsContainer">
119 <!-- Dynamically populated from database -->
120 </div>
121 </section>
131 <h3 class="text-xl font-semibold mb-4 text-blue-800">Featured Publications</h3>
132 <div class="space-y-6" id="featuredResearch">
133 <!-- Dynamically populated from database -->
134 </div>
135 </div>
137 <h3 class="text-xl font-semibold mb-4 text-blue-800">Recent Additions</h3>
138 <ul class="space-y-3" id="recentResearch">
139 <!-- Dynamically populated from database -->
140 </ul>
141 </div>
150 </div>
151 <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="innovationsContainer">
152 <!-- Dynamically populated from database -->
153 </div>
154 </section>
161 </div>
162 <div class="space-y-6" id="conferencesContainer">
163 <!-- Dynamically populated from database -->
164 </div>
165 </section>
172 </div>
173 <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="departmentsContainer">
174 <!-- Dynamically populated from database -->
175 </div>
176 </section>
186 <h3 class="text-xl font-semibold text-blue-800 mb-4">Optimization Reports</h3>
187 <div class="space-y-4" id="supplyChainReports">
188 <!-- Dynamically populated from database -->
189 </div>
190 </div>
192 <h3 class="text-xl font-semibold text-blue-800 mb-4">Key Metrics</h3>
193 <div class="space-y-6" id="supplyChainMetrics">
194 <!-- Dynamically populated from database -->
195 </div>
196 </div>
209 <h3 class="text-xl font-semibold text-blue-800 mb-4">Upcoming Events</h3>
210 <div class="space-y-4" id="upcomingEvents">
211 <!-- Dynamically populated from database -->
212 </div>
213 </div>
231 <h3 class="text-lg font-semibold text-blue-800 mb-4">This Week</h3>
232 <div class="space-y-2 text-sm" id="weekSummary">
233 <!-- Dynamically populated from database -->
234 </div>
235 </div>

customer-database-setup2 file matches

@stevenvapiβ€’Updated 2 months ago

prDatabase

@pdwβ€’Updated 2 months ago