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/$2?q=database&page=533&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 5688 results for "database"(2644ms)

sqliteREADME.md2 matches

@dkinzer222•Updated 6 months ago
1# SQLite - [Docs ↗](https://docs.val.town/std/sqlite)
2
3[SQLite](https://www.sqlite.org/) is a lightweight, standard database. Every Val Town account comes with its own private SQLite database that is accessible from any of your vals via [`std/sqlite`](https://www.val.town/v/std/sqlite).
4
5Val Town SQLite is powered by [Turso](https://turso.tech/).
9* [ORMs](https://docs.val.town/std/sqlite/orms)
10
11We recommend these admin data viewers for managing your database – viewing or editing data or your database table schema:
12
13* [Outerbase Studio](https://libsqlstudio.com/) **(recommended)** - formely known as LibSQL Studio – see instructions [here](https://libsqlstudio.com/docs/connect-valtown)

sqlitemain.tsx1 match

@dkinzer222•Updated 6 months ago
5/**
6 * Every Val Town account comes with its own private
7 * [SQLite database](https://www.sqlite.org/) that
8 * is accessible from any of your vals.
9 * ([Docs ↗](https://docs.val.town/std/sqlite))

sqlite_adminREADME.md1 match

@sitrucl•Updated 6 months ago
7It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
8
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).

userManagementmain.tsx1 match

@ideofunk•Updated 6 months ago
44 // 2. Check password strength
45 // 3. Hash password
46 // 4. Store in database
47
48 return {

sqLiteDatabasemain.tsx27 matches

@ideofunk•Updated 6 months ago
2
3/**
4 * Initialize database tables for authentication system
5 * Includes users, login attempts, and verification tokens
6 */
7export async function initializeDatabase() {
8 // Use the val's unique identifier as a prefix for tables
9 const KEY = "sqLiteDatabase";
10 const SCHEMA_VERSION = 3; // Increment when schema changes
11
54 `);
55
56 console.log(`Database tables initialized for authentication system (Schema v${SCHEMA_VERSION})`);
57 return { success: true, message: 'Database setup complete' };
58 } catch (error) {
59 console.error('Database initialization error:', error);
60 return {
61 success: false,
62 message: 'Failed to initialize database',
63 error: error.message
64 };
67
68/**
69 * Utility function to reset or clean up database
70 * Use with caution in production
71 */
72export async function resetDatabase() {
73 const KEY = "sqLiteDatabase";
74 const SCHEMA_VERSION = 3;
75
79 await sqlite.execute(`DROP TABLE IF EXISTS ${KEY}_verification_tokens_${SCHEMA_VERSION}`);
80
81 await initializeDatabase();
82
83 console.log('Database reset completed successfully');
84 return { success: true, message: 'Database reset complete' };
85 } catch (error) {
86 console.error('Database reset error:', error);
87 return {
88 success: false,
89 message: 'Failed to reset database',
90 error: error.message
91 };
94
95/**
96 * Utility function to perform database migrations
97 * Call this when schema changes are needed
98 */
99export async function migrateDatabase() {
100 const KEY = "sqLiteDatabase";
101 const SCHEMA_VERSION = 3;
102
108 `);
109
110 console.log('Database migration completed successfully');
111 return { success: true, message: 'Database migration complete' };
112 } catch (error) {
113 console.error('Database migration error:', error);
114 return {
115 success: false,
116 message: 'Failed to migrate database',
117 error: error.message
118 };
120}
121
122// Initialize database on module import
123initializeDatabase();
124
125export default {
126 initializeDatabase,
127 resetDatabase,
128 migrateDatabase
129};

plantIdentifierAppmain.tsx3 matches

@mahtabtattur•Updated 6 months ago
4import OpenAI from "https://esm.sh/openai";
5
6// Plant Database
7const PLANT_DATABASE = {
8 'Rosa damascena': {
9 scientificName: 'Rosa damascena',
166 : plantDescription;
167
168 const matchedPlant = Object.values(PLANT_DATABASE).find(
169 plant =>
170 plant.scientificName.toLowerCase() === scientificName.toLowerCase() ||

captivatingLimeGuanmain.tsx3 matches

@mahtabtattur•Updated 6 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5// Expanded plant database with more comprehensive entries
6const PLANT_DATABASE = {
7 'Rosa damascena': {
8 scientificName: 'Rosa damascena',
94 if (bestMatch[1] > 0.6) { // Confidence threshold
95 resolve({
96 plant: PLANT_DATABASE[bestMatch[0]],
97 confidence: Math.round(bestMatch[1] * 100)
98 });

yc_findermain.tsx3 matches

@stevekrouse•Updated 6 months ago
40 <li>We extract email domains from your user list</li>
41 <li>
42 We match these domains against our database of YC companies (sourced{" "}
43 <a href="https://docs.google.com/spreadsheets/d/181GQmXflgMCCI9awLbzK4Zf0uneQBKoh51wBjNTc8Us/edit?gid=0#gid=0">
44 here
45 </a>
46 , cached <a href="https://www.val.town/v/stevekrouse/yc_database">here</a>)
47 </li>
48 <li>You get a detailed report of matches, enriched with YC company data</li>
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);
230 if (url.pathname === "/companies.json") {

sqliteExplorerAppREADME.md1 match

@spinningideas•Updated 6 months ago
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable

sqliteExplorerAppREADME.md1 match

@granin•Updated 6 months ago
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable

bookmarksDatabase

@s3thi•Updated 3 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 6 months ago