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/image-url.jpg%20%22Image%20title%22?q=database&page=276&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 7182 results for "database"(2595ms)

6
7- `index.ts`: Main entry point for the API
8- `database/`: Database schema and queries
9- `routes/`: API route handlers
10
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { cors } from "https://esm.sh/hono@3.11.7/middleware";
3import { runMigrations } from "./database/migrations.ts";
4import usersRoutes from "./routes/users.ts";
5import opportunitiesRoutes from "./routes/opportunities.ts";
7import staticRoutes from "./routes/static.ts";
8
9// Initialize the database
10await runMigrations();
11
6 createMessage,
7 getUserById
8} from "../database/queries.ts";
9import { ApiResponse, ChatRoom, Message, MessageInput } from "../../shared/types.ts";
10
5 getOpportunitiesByCategory,
6 getUserById
7} from "../database/queries.ts";
8import { ApiResponse, Opportunity, OpportunityInput } from "../../shared/types.ts";
9
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createUser, getUserByUsername } from "../database/queries.ts";
3import { ApiResponse, User } from "../../shared/types.ts";
4
1# Database Layer
2
3This directory contains the database schema and query functions for the Side Hustle Hub application.
4
5## Files
6
7- `migrations.ts`: Contains the database schema definitions and initial setup
8- `queries.ts`: Contains typed query functions for interacting with the database
9
10## Database Schema
11
12The application uses SQLite with the following tables:
19## Usage
20
21The database is initialized when the application starts by calling `runMigrations()` from the main backend entry point.
22
23Query functions are exported from `queries.ts` and provide typed access to the database.

untitled-8939index.ts4 matches

@pmaxxโ€ขUpdated 3 weeks ago
2import { cors } from "https://esm.sh/hono@3.11.7/middleware";
3import { readFile, serveFile } from "https://esm.town/v/std/utils/index.ts";
4import { setupDatabase } from "./database/migrations.ts";
5import {
6 createUser,
11 assignTransactionToEnvelope,
12 checkFullAllocation
13} from "./database/queries.ts";
14import { parseCSV } from "./parsers/csv-parser.ts";
15import type { CSVMapping } from "../shared/types.ts";
25app.use("/*", cors());
26
27// Initialize database on startup
28app.use("*", async (c, next) => {
29 await setupDatabase();
30 await next();
31});

untitled-8939migrations.ts1 match

@pmaxxโ€ขUpdated 3 weeks ago
7export const ACHIEVEMENTS_TABLE = "cash_stash_achievements";
8
9export async function setupDatabase() {
10 // Create users table
11 await sqlite.execute(`

untitled-8939README.md1 match

@pmaxxโ€ขUpdated 3 weeks ago
25```
26โ”œโ”€โ”€ backend/
27โ”‚ โ”œโ”€โ”€ database/ # SQLite database setup and queries
28โ”‚ โ”œโ”€โ”€ parsers/ # CSV parsing logic
29โ”‚ โ””โ”€โ”€ index.ts # Main API entry point

reactHonoStarterREADME.md1 match

@Janane_CMโ€ขUpdated 3 weeks 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.

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago