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=353&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 4128 results for "database"(511ms)

HONCdrizzle.ts2 matches

@charmaine•Updated 2 months ago
1// Import drizzle deps with npm: specifier because exports don't get picked up properly by typescript when using esm.sh
2import { drizzle, type LibSQLDatabase } from "npm:drizzle-orm@0.39.3/libsql";
3import { and, eq, desc, relations, sql } from "npm:drizzle-orm@0.39.3";
4import { integer, sqliteTable, text } from "npm:drizzle-orm@0.39.3/sqlite-core";
5
6export { drizzle };
7export type { LibSQLDatabase };
8export { and, eq, desc, relations, sql };
9export { integer, sqliteTable, text };

HONCclient.ts2 matches

@charmaine•Updated 2 months ago
5
6/**
7 * The typed database client, allowing us to construct sql queries and
8 * use Drizzle's ORM features against the ValTown sqlite database
9 */
10export const db: DBType = drizzle(sqlite as any, {

talentedGrayDonkeymain.tsx3 matches

@ajax•Updated 2 months ago
7};
8
9type MovieDatabase = Record<string, MovieData>;
10
11const movieDatabase: MovieDatabase = {
12 "star wars": {
13 characters: ["Luke", "Leia", "Han", "Anakin", "Padme", "Rey", "Kylo"],
55
56 const normalizedTitle = movieTitle.toLowerCase().trim();
57 const movieData = movieDatabase[normalizedTitle];
58
59 if (!movieData) {

generate_movie_inspired_namemain.tsx2 matches

@ajax•Updated 2 months ago
9}
10
11const movieDatabase: MovieData[] = [
12 {
13 title: "Inception",
36 const movieTitle: string = body?.movieTitle ?? "";
37
38 const movieData = movieDatabase.find(movie => movie.title.toLowerCase() === movieTitle.toLowerCase());
39
40 let nameOptions: string[] = [];

HONCtypes.ts2 matches

@cameronpak•Updated 2 months ago
1import type { LibSQLDatabase } from "../deps/drizzle.ts";
2import type * as schema from "./schema";
3
4export type DBType = LibSQLDatabase<typeof schema>;

HONCREADME.md1 match

@cameronpak•Updated 2 months ago
13## A Few Honkin' Notes
14
15### database migrations need love and care 🫂
16
17Not totally sure how to generate and apply drizzle migrations yet!

HONCmigrate.ts1 match

@cameronpak•Updated 2 months ago
5 * For this reason, we need to manually create the users table.
6 */
7export const migrateDatabase = async () => {
8 await sqlite.execute(`
9CREATE TABLE IF NOT EXISTS \`users\` (

HONCindex.ts4 matches

@cameronpak•Updated 2 months ago
6import usersApi from "./app/users.ts";
7import { db } from "./db/client.ts";
8import { migrateDatabase } from "./db/migrate.ts";
9
10// Migrate database on startup to make sure the proper table exists to store users
11// NOTE - Please comment on the template project if you have ideas on how to do migrations more cleanly on Valtown
12await migrateDatabase();
13
14const app = new Hono<AppType>();
15
16/**
17 * Middleware for setting up the database and storing it on the Hono app's context
18 */
19app.use(async (c, next) => {

HONCdrizzle.ts2 matches

@cameronpak•Updated 2 months ago
1// Import drizzle deps with npm: specifier because exports don't get picked up properly by typescript when using esm.sh
2import { drizzle, type LibSQLDatabase } from "npm:drizzle-orm@0.39.3/libsql";
3import { and, eq, desc, relations, sql } from "npm:drizzle-orm@0.39.3";
4import { integer, sqliteTable, text } from "npm:drizzle-orm@0.39.3/sqlite-core";
5
6export { drizzle };
7export type { LibSQLDatabase };
8export { and, eq, desc, relations, sql };
9export { integer, sqliteTable, text };

HONCclient.ts2 matches

@cameronpak•Updated 2 months ago
5
6/**
7 * The typed database client, allowing us to construct sql queries and
8 * use Drizzle's ORM features against the ValTown sqlite database
9 */
10export const db: DBType = drizzle(sqlite as any, {

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago