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=294&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 3427 results for "database"(528ms)

neocities_hit_countermain.tsx4 matches

@mbo•Updated 2 months ago
347 // If using sitename parameter, fetch from Neocities API
348 if (sitename) {
349 // Create the database key using sitename.neocities.org format
350 const dbKey = `${sitename}.neocities.org`;
351
353 const neocitiesData = await fetchNeocitiesStats(sitename);
354
355 // Get the current count from database (either fresh or cached)
356 const count = await getCount(dbKey);
357
358 // If API fetch successful, update the database
359 if (neocitiesData && neocitiesData.result === "success") {
360 // Extract the hits value
361 const hits = neocitiesData.info.hits || 0;
362
363 // Store the value in our database for tracking
364 await setCount(dbKey, hits);
365 } else {

cerebras_coderindex2 matches

@Shazan•Updated 2 months ago
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
4
5async function servePublicFile(path: string): Promise<Response> {

cakeOffReviewPlatformREADME.md2 matches

@charmaine•Updated 2 months 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`. This routes are called from the React app to refresh and update data.
29
30## Errors

cakeOffReviewPlatformREADME.md6 matches

@charmaine•Updated 2 months 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.

datemeREADME.md2 matches

@commandertvis•Updated 2 months ago
4
5The directory is a simple
6database of Date Me Docs. Date Me Docs are long-form, earnest dating profiles for romantic partners.
7[Learn more here](https://dateme.directory/faq).
8
9## Todos
10
11- [ ] Make the SQLite database forkable and build a widget/workflow for that, ie fix @stevekrouse/dateme_sqlite
12- [ ] Require an email (that isn't shared publicly)
13 - [ ] Verify the email address with a "magic link"

sqliteExplorerAppREADME.md1 match

@myles•Updated 2 months ago
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable

reactHonoExamplequeries.ts2 matches

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

reactHonoExampleREADME.md6 matches

@stevekrouse•Updated 2 months 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.

reactHonoExamplemigrations.ts1 match

@stevekrouse•Updated 2 months ago
13
14 However, you should know that SQLite has much more limited
15 support for altering existing tables as compared to other databases.
16 Often it's easier to create new tables with the schema you want, and then
17 copy the data over. */

groundedWhiteFowlmain.tsx2 matches

@Shaff_thv•Updated 2 months ago
218 `);
219 } catch (error) {
220 console.error("Database initialization error:", error);
221 return new Response("Database error", {
222 status: 500,
223 headers: corsHeaders,

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago