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=1&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 693 results for "database"(501ms)

Numismatikermain.ts4 matches

@qrtrcgnβ€’Updated 56 mins ago
2
3// Ausgelagerte MΓΌnz-Datenbank
4const COIN_DATABASE = [
5 {
6 id: "de-2006",
432
433 <script>
434 const coinDatabase = ${JSON.stringify(COIN_DATABASE)};
435 let collection = JSON.parse(localStorage.getItem('numisCollection_v03')) || [];
436
454 grid.innerHTML = '';
455
456 coinDatabase.forEach(coin => {
457 const item = document.createElement('div');
458 item.className = 'catalog-item';
564
565 window.saveCoin = function(coinId) {
566 const coinData = coinDatabase.find(c => c.id === coinId);
567 const mintEl = document.getElementById(\`mint-\${coinId}\`);
568 const commentEl = document.getElementById(\`comment-\${coinId}\`);

x402-playgroundSLIDES.md1 match

@stevekrouseβ€’Updated 1 hour ago
78
79- What about LLM payments where it can be variablea
80- What about vms/storage/databases like ec2 or s3 or supabase?
81
82---

mdsiteburpees-system.md1 match

@dcm31β€’Updated 6 hours ago
73**Beeminder**: every goal hit POSTs a +1 datapoint to my Beeminder `burpees` goal. If the cumulative line falls below the yellow brick road, I lose money. This is the actual forcing function.
74
75**Fatebook**: every morning the system creates a prediction β€” *"Will I do N burpees on [date]?"* β€” with the model's probability as the forecast. The next morning it auto-resolves YES or NO from the database. Over time this tells me if the model is well-calibrated.
76
77## The stack

tanstackReactHonoExampleREADME.md2 matches

@sistrallβ€’Updated 11 hours ago
23- Optimistic updates
24- Server-side data injection
25- Type-safe database operations
26
27## Project Structure
29```
30β”œβ”€β”€ backend/ # Hono server running on Val Town
31β”‚ β”œβ”€β”€ database/ # Drizzle schema, migrations, and queries
32β”‚ └── index.ts # Main Hono application
33β”œβ”€β”€ frontend/ # React app running in browser

tanstackReactHonoExampleREADME.md2 matches

@sistrallβ€’Updated 11 hours ago
4
5* `index.ts` - this is the **entrypoint** for this whole project
6* `database/` - this contains the code for interfacing with the app's SQLite database table
7
8## Hono
26## CRUD API Routes
27
28This app has two CRUD API routes: for reading and inserting into the messages table. They both speak JSON, which is standard. They import their functions from `/backend/database/queries.ts`. These routes are called from the React app to refresh and update data.
29
30## Errors

tanstackReactHonoExampleREADME.md6 matches

@sistrallβ€’Updated 11 hours ago
1# Database
2
3This app uses [Val Town SQLite](https://docs.val.town/std/sqlite/) to manage data. Every Val Town account comes with a free SQLite database, hosted on [Turso](https://turso.tech/). This folder is broken up into two files:
4
5* `migrations.ts` - code to set up the database tables the app needs
6* `queries.ts` - functions to run queries against those tables, which are imported and used in the main Hono server in `/backend/index.ts`
7
8## Migrations
9
10In `backend/database/migrations.ts`, this app creates a new SQLite table `reactHonoStarter_messages` to store messages.
11
12This "migration" runs once on every app startup because it's imported in `index.ts`. You can comment this line out for a slight (30ms) performance improvement on cold starts. It's left in so that users who fork this project will have the migration run correctly.
13
14SQLite has much more limited support for altering existing tables as compared to other databases. Often it's easier to create new tables with the schema you want, and then copy the data over. Happily LLMs are quite good at those sort of database operations, but please reach out in the [Val Town Discord](https://discord.com/invite/dHv45uN5RY) if you need help.
15
16## Queries
17
18The queries file is where running the migrations happen in this app. It'd also be reasonable for that to happen in index.ts, or as is said above, for that line to be commented out, and only run when actual changes are made to your database schema.
19
20The queries file exports functions to get and write data. It relies on shared types and data imported from the `/shared` directory.

tanstackReactHonoExamplequeries.ts2 matches

@sistrallβ€’Updated 11 hours ago
4import { createTables } from "./migrations.ts";
5
6// This will create the database table if it doesn't exist.
7// This will run every time the app starts up. You can
8// comment out this line for a modest (30ms) performance improvement
9// on cold starts. It's left in to ensure the database tables are
10// automatically set up correctly for users who fork this app.
11

tanstackReactHonoExamplemigrations.ts1 match

@sistrallβ€’Updated 11 hours ago
3
4export async function createTables() {
5 // Uncomment to reset database
6 await db.run(sql`DROP TABLE IF EXISTS messages`);
7 // Create messages table

tanstackReactHonoExampleindex.ts1 match

@sistrallβ€’Updated 11 hours ago
1import { parseProject, readFile, serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { Hono } from "npm:hono";
3import { getMessages, insertMessage } from "./database/queries.ts";
4
5const app = new Hono();

thirdTimeradmin.ts2 matches

@ozanatgreenptβ€’Updated 12 hours ago
14 mergeUsers,
15 stopTimerSession,
16} from "../database/admin-queries.ts";
17import { getConfig, setConfig } from "../database/config-queries.ts";
18
19const adminApp = new Hono();
migrate-sqlite

migrate-sqlite2 file matches

@nbbaierβ€’Updated 1 week ago
Copy database tables from account-scoped to val-scoped SQLite

Farm-Road-Database-031 file match

@RobooHoodβ€’Updated 1 week ago
Backup