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/$%7BsvgDataUrl%7D?q=database&page=6&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 7795 results for "database"(2794ms)

stevensDemogenerateFunFacts.ts2 matches

@asim13juneโ€ขUpdated 2 days ago
8
9/**
10 * Retrieves previously generated fun facts from the memories database
11 * @returns Array of previous fun facts
12 */
47
48/**
49 * Inserts a fun fact into the memories database
50 * @param date Date for the fun fact in ISO format
51 * @param factText The fun fact text

stevensDemo.cursorrules2 matches

@asim13juneโ€ขUpdated 2 days ago
208```
209โ”œโ”€โ”€ backend/
210โ”‚ โ”œโ”€โ”€ database/
211โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
212โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
270- Handle API calls properly with proper error catching
271
272### Database Patterns
273- Run migrations on startup or comment out for performance
274- Change table names when modifying schemas rather than altering

personalShopperindex.ts3 matches

@bgschillerโ€ขUpdated 2 days ago
25 updateUserLocation,
26 updateUserTokens,
27} from "./database/krogerQueries.ts";
28import { runMigrations } from "./database/migrations.ts";
29// import { KrogerAuthService } from "./services/krogerAuth.ts";
30import { MockKrogerAuthService } from "./services/fakeKrogerAuth.ts";
34const app = new Hono();
35
36// Initialize database on startup
37await runMigrations();
38

reactHonoStarterREADME.md1 match

@anup_d911โ€ขUpdated 2 days ago
21## Further resources
22
23- [React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a bigger example project, with a SQLite database table, queries, client-side CSS, a favicon, and shared code that runs on both client and server.

SocialArchetypeQuizindex.ts6 matches

@mccailsโ€ขUpdated 2 days ago
802import { email } from "https://esm.town/v/std/email";
803
804// Database setup
805const TABLE_NAME = 'archetype_quiz_results_v1';
806
807async function initDatabase() {
808 await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
809 id INTEGER PRIMARY KEY AUTOINCREMENT,
818
819async function saveQuizResult(userEmail: string, calculatedArchetype: string, chosenArchetype: string, scores: any, answers: any) {
820 await initDatabase();
821 await sqlite.execute(
822 `INSERT INTO ${TABLE_NAME} (email, calculated_archetype, chosen_archetype, scores, answers) VALUES (?, ?, ?, ?, ?)`,
826
827async function getQuizResults(limit = 50, offset = 0) {
828 await initDatabase();
829 try {
830 const results = await sqlite.execute(
849
850async function getQuizStats() {
851 await initDatabase();
852
853 try {
1015 const { email, calculatedArchetype, chosenArchetype, scores, answers } = await req.json();
1016
1017 // Save to database
1018 await saveQuizResult(email, calculatedArchetype, chosenArchetype, scores, answers);
1019

SocialArchetypeQuizREADME.md3 matches

@mccailsโ€ขUpdated 2 days ago
9- **Confetti Animations**: Celebratory confetti on every button click
10- **Iridescent Design**: Purple, blue, and pink gradient theme with glassmorphism effects
11- **Backend Storage**: SQLite database stores quiz results and user choices
12- **User Choice**: Users can choose their preferred archetype after seeing results
13- **Mobile Responsive**: Works perfectly on all device sizes
91- Timestamp of completion
92
93Database table: `archetype_quiz_results_v1`
94
95## ๐Ÿ›  Technical Stack
99- **Animations**: Canvas Confetti library
100- **Icons**: Font Awesome 6.4.0
101- **Backend**: Val Town SQLite database
102- **Platform**: Val Town serverless
103

ssscQuizadmin.http.ts8 matches

@allโ€ขUpdated 2 days ago
12const TABLE_NAME = 'sssc_quiz_submissions_v1'; // Must match the table name in index.http.ts
13
14// Database initialization - ensure table exists
15async function initDatabase() {
16 await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
17 id INTEGER PRIMARY KEY AUTOINCREMENT,
33}
34
35// Initialize database on startup
36await initDatabase();
37
38// Main admin dashboard route
94 <body>
95 <div style="padding: 2rem; text-align: center;">
96 <h1>โš ๏ธ Database Error</h1>
97 <p>Unable to load dashboard data. Please check if the database is initialized.</p>
98 <a href="/" style="color: #4361ee;">โ† Back to Quiz</a>
99 </div>
204});
205
206// Debug endpoint to check database contents
207app.get("/api/debug", async c => {
208 try {
527 <p>Total Submissions: <strong>${total}</strong></p>
528 <p style="font-size: 0.9rem; opacity: 0.8;">
529 <a href="/api/debug" style="color: rgba(255,255,255,0.8); text-decoration: none;">๐Ÿ” Debug Database</a>
530 </p>
531 </div>

ssscQuizREADME.md9 matches

@allโ€ขUpdated 2 days ago
10- **Personality Analysis**: Advanced algorithm determining primary social archetype
11- **Email Delivery**: Automated email with detailed results and insights
12- **Data Persistence**: All submissions stored in SQLite database
13
14### Enhanced Features
61- **Backend**: Hono web framework on Deno
62- **Frontend**: React 18 with TypeScript
63- **Database**: Val Town SQLite
64- **Email**: Val Town email service
65- **Styling**: CSS with custom properties and responsive design
91- Primary HTTP val that users visit
92- Hono web server with comprehensive error handling
93- SQLite database with optimized schema and indexing
94- Enhanced email system with HTML/text templates
95- API endpoints for quiz submission and analytics
107### Backend (Hono)
108- RESTful API with proper error handling
109- SQLite database with structured schema and indexes
110- Email automation with professional HTML templates
111- Admin analytics with real-time data
120- Progressive enhancement
121
122### Database Schema
123```sql
124CREATE TABLE sssc_quiz_submissions (
180
181- **Email Validation**: Client and server-side validation
182- **Data Sanitization**: All inputs sanitized before database storage
183- **Privacy Focused**: No tracking beyond essential quiz functionality
184- **Secure Storage**: Encrypted database storage through Val Town
185
186## ๐Ÿš€ Deployment
1901. **Main Application**: `index.http.ts` - Primary entry point users visit
1912. **Admin Dashboard**: `admin.http.ts` - Analytics and data management
1923. **Database**: Automatic SQLite initialization with proper indexing
1934. **Email**: Enhanced email service with HTML templates following Val Town standards
1945. **Frontend**: Served as static files with mobile-responsive design
254- **Efficient Rendering**: Optimized React components
255- **CSS Optimization**: Custom properties and efficient selectors
256- **Database Queries**: Indexed and optimized queries
257
258

ssscQuizindex.http.ts9 matches

@allโ€ขUpdated 2 days ago
13});
14
15// Database setup following Val Town standards
16const TABLE_NAME = 'sssc_quiz_submissions_v1'; // Must match admin.http.ts table name
17
18// Initialize database with Val Town best practices
19async function initDatabase() {
20 await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
21 id INTEGER PRIMARY KEY AUTOINCREMENT,
37}
38
39// Initialize database on startup
40await initDatabase();
41
42// Serve static files
86 const ipHash = forwarded ? await hashIP(forwarded.split(',')[0].trim()) : '';
87
88 console.log("Storing in database...");
89 console.log("Table name:", TABLE_NAME);
90 console.log("Data to insert:", {
96 });
97
98 // Store in database following Val Town patterns
99 const insertResult = await sqlite.execute(
100 `INSERT INTO ${TABLE_NAME} (
113 ]
114 );
115 console.log("Database insert successful, result:", insertResult);
116
117 // Verify the insert worked
200app.get("/api/test-insert", async c => {
201 try {
202 console.log("Testing database insert...");
203
204 const testEmail = `test${Date.now()}@example.com`;

ssscQuizconfig.ts2 matches

@allโ€ขUpdated 2 days ago
37 },
38
39 // Database configuration
40 database: {
41 tableName: "sssc_quiz_submissions_v1",
42 enableIndexes: true

bookmarksDatabase

@s3thiโ€ขUpdated 4 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 7 months ago