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?q=database&page=382&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 8244 results for "database"(2267ms)

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 month 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 month 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 month 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 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.

stockAppbillService.ts2 matches

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

stockAppapi.ts4 matches

@prashamtrivediโ€ขUpdated 1 month ago
14import {aiServiceInstance} from "./services/aiService.ts" // Added for direct AI calls
15
16import {runMigrations} from "./database/migrations.ts"
17import {
18 CreateUserPayload,
76 if (!migrationsRun) {
77 try {
78 console.log("Running database migrations...")
79 await runMigrations()
80 migrationsRun = true
81 console.log("Database migrations completed.")
82 } catch (e) {
83 console.error("Migration failed:", e)
84 // Optionally, you could prevent the app from starting or return an error response
85 return c.json({error: "Database migration failed", message: e.message}, 500)
86 }
87 }

customer-database-setup2 file matches

@stevenvapiโ€ขUpdated 3 days ago

prDatabase

@pdwโ€ขUpdated 1 week ago