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=202&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"(3218ms)

dbssetprofileprofile.ts1 match

@desnilandโ€ขUpdated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getStudentById, getStudentByAdmission, updateStudent } from "../database/queries.ts";
3import type { ApiResponse, Student } from "../../shared/types.ts";
4

dbssetprofileREADME.md5 matches

@desnilandโ€ขUpdated 2 weeks ago
5## Features
6
7- **Profile Management**: View and edit student profiles with database persistence
8- **Academics**: Track units, examinations, and academic progress
9- **Finances**: Manage fee payments and view fee structures
16โ”œโ”€โ”€ backend/
17โ”‚ โ”œโ”€โ”€ index.ts # Main Hono server
18โ”‚ โ”œโ”€โ”€ database/
19โ”‚ โ”‚ โ”œโ”€โ”€ schema.ts # Database schema and migrations
20โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database query functions
21โ”‚ โ””โ”€โ”€ routes/
22โ”‚ โ”œโ”€โ”€ profile.ts # Profile management routes
37## Setup
38
391. The backend automatically creates the database tables on first run
402. Access the profile page at the root URL
413. Use the API endpoints to manage data

luciaMagicLinkStarterREADME.md1 match

@tsuchi_yaโ€ขUpdated 2 weeks ago
25## Technical Implementation
26
27- **Database**:[Val Town SQLite](https://docs.val.town/std/sqlite/) for storing users, sessions, and magic link tokens
28- **Frontend**: React with Tailwind CSS
29- **Backend**: Hono.js for API routes and middleware

luciaMagicLinkStartermagic-links.ts2 matches

@tsuchi_yaโ€ขUpdated 2 weeks ago
59 const tokenHash = hashToken(token);
60
61 // Get the token from the database using its hash
62 const { rows } = await sqlite.execute(
63 `SELECT email, expires_at FROM ${MAGIC_LINKS_TABLE} WHERE id = ?`,
66
67 if (rows.length === 0) {
68 console.log("Did not find magic link token in database");
69 return { valid: false };
70 }

luciaMagicLinkStarterindex.ts1 match

@tsuchi_yaโ€ขUpdated 2 weeks ago
3import { Hono } from "npm:hono";
4import { authMiddleware } from "./auth.ts";
5import { USER_TABLE } from "./database/schema.ts";
6
7const app = new Hono();

luciaMagicLinkStarterauth.ts2 matches

@tsuchi_yaโ€ขUpdated 2 weeks ago
1import { getCookie, setCookie } from "npm:hono/cookie";
2import { createMiddleware } from "npm:hono/factory";
3import { createMagicLinkToken, sendMagicLinkEmail, validateMagicLinkToken } from "./database/magic-links.ts";
4import { createSession, generateSessionToken, invalidateSession, validateSessionToken } from "./database/sessions.ts";
5
6export const authMiddleware = createMiddleware(async (c, next) => {

ioindex.ts2 matches

@jexโ€ขUpdated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { runMigrations } from "./database/migrations.ts";
4import auth from "./routes/auth.ts";
5import posts from "./routes/posts.ts";
14});
15
16// Initialize database on startup
17await runMigrations();
18

social_dataindex.ts2 matches

@tsuchi_yaโ€ขUpdated 2 weeks ago
5import ValTown from "npm:@valtown/sdk";
6import SocialData from "../sdk/index.ts";
7import { setupDatabase, USAGE_TABLE } from "./database.ts";
8import { searchTwitterRoute } from "./routes/search.ts";
9
14
15// Uncomment this if you're forking this project:
16// await setupDatabase()
17
18// https://socialdata.gitbook.io/docs/pricing

social_datadatabase.ts1 match

@tsuchi_yaโ€ขUpdated 2 weeks ago
3export const USAGE_TABLE = "socialDataProxy_usage_2";
4
5export async function setupDatabase() {
6 await sqlite.execute(`
7 CREATE TABLE IF NOT EXISTS ${USAGE_TABLE} (

iomessages.ts1 match

@jexโ€ขUpdated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { requireAuth } from "./auth.ts";
3import { createMessage, getMessages } from "../database/queries.ts";
4import { generateId } from "../../shared/utils.ts";
5import type { ApiResponse, Message } from "../../shared/types.ts";

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago