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=261&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 2798 results for "database"(306ms)

stevekrouse_dot_comhomepage.tsx1 match

@shouserโ€ขUpdated 1 month ago
13 todayHits = hits.todayHits;
14 } catch (e) {
15 console.log("Caught database error: ", e);
16 }
17 return new Response(

apiifyREADME.md1 match

@wolfโ€ขUpdated 1 month ago
9- The **client-side entrypoint** is `/frontend/index.html`, which in turn imports `/frontend/index.tsx`, which in turn imports the React app from `/frontend/components/App.tsx`.
10
11[React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a fuller featured example project, with a SQLite database table, queries, client-side CSS and a favicon, and some shared code that runs on both client and server.

testmar24README.md3 matches

@charmaineโ€ขUpdated 1 month ago
15```
16โ”œโ”€โ”€ backend/
17โ”‚ โ”œโ”€โ”€ database/
18โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # SQLite database operations
19โ”‚ โ””โ”€โ”€ index.ts # Hono API server
20โ”œโ”€โ”€ frontend/
54
551. Fork this project in Val Town
562. The app will automatically create its database table on first run
573. Access the app through your Val Town URL

cerebras_coderindex2 matches

@draxโ€ขUpdated 1 month 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> {

reactHonoStarter_1742759574740README.md1 match

@charmaineโ€ขUpdated 1 month ago
9- The **client-side entrypoint** is `/frontend/index.html`, which in turn imports `/frontend/index.tsx`, which in turn imports the React app from `/frontend/components/App.tsx`.
10
11[React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a fuller featured example project, with a SQLite database table, queries, client-side CSS and a favicon, and some shared code that runs on both client and server.

HTTP101POSTrequestFormGuide1 match

@willthereaderโ€ขUpdated 1 month ago
99 to a variable because variables lose all data every time you save a version. On Val Town there are
100 two ways to store data long term. They are blob and SQlite. Both of them have 10mb on the free plan and
101 1gb on pro. The difference is that blob storage is just key value while SQlite is a database. Since it
102 doesn't make sense to use SQlite's data unnecessarily and it's complex enough to be its own guide,
103 we're using blob storage.</p>

AlwaysHereBackendREADME.md2 matches

@ninadxcโ€ขUpdated 1 month 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

AlwaysHereBackendREADME.md6 matches

@ninadxcโ€ขUpdated 1 month 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

@varun1352โ€ขUpdated 1 month ago
21
22 However, you should know that SQLite has much more limited
23 support for altering existing tables as compared to other databases.
24 Often it's easier to create new tables with the schema you want, and then
25 copy the data over. */

reactHonoExamplegoogleOAuth.ts1 match

@varun1352โ€ขUpdated 1 month ago
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2import { Hono } from "npm:hono";
3import { USERS } from "../database/migrations.ts"; // Make sure migrations defines this table
4
5const CLIENT_ID = "your_google_client_id";