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/$%7Burl%7D?q=database&page=99&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 5411 results for "database"(556ms)

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 1 week 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 1 week 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 1 week 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 1 week 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.

stockAppbillService.ts2 matches

@prashamtrivediโ€ขUpdated 1 week ago
8 CreateProductPayload, // Added import
9} from "../../shared/types.ts"
10import * as db from "../database/queries.ts"
11import {aiServiceInstance} from "./aiService.ts"
12import {logUserAction} from "./userService.ts"
36 await blob.set(blobId, ia)
37
38 // Create a preliminary bill record in the database
39 const scanDate = new Date().toISOString()
40 const partialBill = await db.createSupplierBill(blobId, scanDate, userId)

stockAppproductService.ts1 match

@prashamtrivediโ€ขUpdated 1 week ago
5 CreateCategoryPayload,
6} from "../../shared/types.ts";
7import * as db from "../database/queries.ts";
8import { logUserAction } from "./userService.ts"; // For logging actions
9

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago