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=247&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 2812 results for "database"(334ms)

reactRouter7Exampleindex.ts3 matches

@stevekrouseโ€ขUpdated 2 weeks ago
9import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
10import { routes } from "../shared/routes.ts";
11import { initializeDatabase } from "./database/migrations.ts";
12
13// Initialize the database
14await initializeDatabase();
15
16// Create the Hono app

reactRouter7ExampleREADME.md3 matches

@stevekrouseโ€ขUpdated 2 weeks ago
17```
18โ”œโ”€โ”€ backend/
19โ”‚ โ”œโ”€โ”€ database/
20โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Database schema
21โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database queries
22โ”‚ โ””โ”€โ”€ index.ts # Server entry point
23โ”œโ”€โ”€ frontend/

reactRouter7Exampleindex.ts3 matches

@tmcwโ€ขUpdated 2 weeks ago
9import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
10import { routes } from "../shared/routes.ts";
11import { initializeDatabase } from "./database/migrations.ts";
12
13// Initialize the database
14await initializeDatabase();
15
16// Create the Hono app

reactRouter7ExampleTopics.action.ts1 match

@tmcwโ€ขUpdated 2 weeks ago
1import { ActionFunctionArgs, redirect } from "https://esm.sh/react-router@7.5.0?deps=react@18.2.0,react-dom@18.2.0";
2import { createTopic } from "../backend/database/queries.ts";
3
4export async function action({ request }: ActionFunctionArgs) {

reactRouter7ExampleTopicMessage.loader.ts1 match

@tmcwโ€ขUpdated 2 weeks ago
1import { LoaderFunctionArgs } from "https://esm.sh/react-router@7.5.0?deps=react@18.2.0,react-dom@18.2.0";
2import { getTopicById, getMessageById, getMessagesByTopicId } from "../backend/database/queries.ts";
3
4export async function loader({ params }: LoaderFunctionArgs) {

reactRouter7ExampleTopic.loader.ts1 match

@tmcwโ€ขUpdated 2 weeks ago
1import { LoaderFunctionArgs } from "https://esm.sh/react-router@7.5.0?deps=react@18.2.0,react-dom@18.2.0";
2import { getTopicById, getMessagesByTopicId } from "../backend/database/queries.ts";
3
4export async function loader({ params }: LoaderFunctionArgs) {

reactRouter7ExampleTopic.action.ts1 match

@tmcwโ€ขUpdated 2 weeks ago
1import { ActionFunctionArgs } from "https://esm.sh/react-router@7.5.0?deps=react@18.2.0,react-dom@18.2.0";
2import { createMessage } from "../backend/database/queries.ts";
3
4export async function action({ request }: ActionFunctionArgs) {

reactRouter7ExampleSearch.loader.ts1 match

@tmcwโ€ขUpdated 2 weeks ago
1import { LoaderFunctionArgs } from "https://esm.sh/react-router@7.5.0?deps=react@18.2.0,react-dom@18.2.0";
2import { search } from "../backend/database/queries.ts";
3
4export async function loader({ request }: LoaderFunctionArgs) {

reactRouter7ExampleREADME.md3 matches

@tmcwโ€ขUpdated 2 weeks ago
17```
18โ”œโ”€โ”€ backend/
19โ”‚ โ”œโ”€โ”€ database/
20โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Database schema
21โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database queries
22โ”‚ โ””โ”€โ”€ index.ts # Server entry point
23โ”œโ”€โ”€ frontend/

reactRouter7Examplemigrations.ts3 matches

@tmcwโ€ขUpdated 2 weeks ago
6
7/**
8 * Initialize the database schema
9 */
10export async function initializeDatabase() {
11 // Create topics table
12 await sqlite.execute(`
44
45/**
46 * Seed the database with initial data for demonstration
47 */
48async function seedInitialData() {