• Townie
    AI
  • Blog
  • Docs
  • Pricing
Log inSign up
vtTestLocal

vtTestLocal

a8b48747537_

Public
Like
a8b48747537_
Home
Code
59
dailyBriefing
3
dashboard
4
dbUtils
4
importers
5
shared
1
.cursorrules
README.md
backstory.ts
file0-ff16522a-ef01-4704-92e2-c7c4b3a58a78.txt
file1-6d86a22b-adf1-44b7-ab32-2f108e3533d6.txt
file10-c1f3a535-4716-49a6-8e59-7dbc46c8d847.txt
file11-c9ed8182-11c4-4585-bc06-7267745027f6.txt
file12-dcac3b57-aa43-481a-b4e9-90bd767b425b.txt
file13-3d080379-8ef9-4085-ac29-03234c6f5bdc.txt
file14-bbcf5104-5169-49f2-8e74-070fe18196fb.txt
file15-7b3f991a-2b5d-4699-beab-842031ea1f8a.txt
file16-565de4f7-174f-41d4-8e43-7828c0b42ce5.txt
file17-421a8a0d-5b2e-4f0e-8a23-7826088d42d2.txt
file18-1534a541-5f95-44c2-8ca0-1cc581b56e67.txt
file19-5abbff7e-1a4f-4a57-9942-103988917714.txt
file2-78563ff5-2c21-4862-829e-e527d00b65ed.txt
file20-0a10269a-e220-4bda-8ef2-5692edb6d5de.txt
file21-29320260-5171-4f31-a1f6-4b29d617f324.txt
file22-87d6c3c2-7e8b-4747-adf1-e3ca02ee60c9.txt
file23-23d5a6b5-1beb-40cd-a1bd-962536fd7847.txt
file24-91813a31-8374-46ba-9f7f-e0cdd4b0ab6e.txt
file25-f1a34c70-bd7f-42fc-8242-9980f9c422f0.txt
file26-800b0442-9d27-4324-820e-fea26485f941.txt
file27-b9223d50-b621-4177-87ab-7bc8079abc10.txt
file28-3afe90e0-2427-4d2e-9629-2738f103afec.txt
file29-97c6dca8-d21b-4a92-8729-42707ab538c2.txt
file3-06cd3555-dd80-44b4-abf9-2947c0fd59c0.txt
file30-d18f31a1-fd74-4780-89b5-3a2289aac720.txt
file31-7429ad71-d2a5-4207-bc46-c2b0014ca384.txt
file32-e02e54ce-82fe-4ac8-97c9-23b4778caf4e.txt
file33-602d5ee8-221d-4f96-aedb-c74b33f5701a.txt
file34-c818b8e4-936c-4459-9967-91c0f465f31c.txt
file35-701e0ed9-8dd1-40ce-a7b7-a327ea731118.txt
file36-8913e5bb-7af7-42a8-81bc-6d1d8e6a8fcc.txt
file37-22a35e92-28fa-4285-bb20-845a610fb789.txt
file38-bd7bee87-5167-4d25-8fc9-32925ff9f047.txt
file39-7892e979-100b-4b18-b3a2-aada77658a01.txt
file4-0e073133-7bd8-48c0-8c1d-d1b68c642c9c.txt
file40-aec572cc-e347-4fd9-b0d7-ce9aff40e99e.txt
file41-453d82e1-56f2-44d6-83cb-aec101bbf039.txt
file42-71a288d5-fc14-4af4-bce0-401c00cd91a8.txt
file43-61788208-bd35-49cb-9ea8-8f3a84147db9.txt
file44-489d98be-dcd9-45cc-98b3-f458b9236673.txt
file45-7b7c7836-ea93-4280-a106-3a114989acb2.txt
file46-9c20d700-1edb-4a1f-853c-3c24e089bc41.txt
file47-e15e2c2c-5616-4874-ad26-20087338755e.txt
file49-512868df-c2e4-48df-9d6d-da8c17793886.txt
file5-151d31e1-2629-4ecf-b752-d405c188ed12.txt
file6-ffacf80d-7a26-4dbd-92bc-4da3cf9c21fc.txt
file7-6d65e70e-bac1-41b9-be8d-d886ad0a8847.txt
file8-4493f3c5-6b30-4425-b2dc-b67a72073e4d.txt
file9-11aadbb4-7f7b-4ec2-8dd0-561d9b23a71e.txt
memoryUtils.ts
populateDemo.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
dashboard
/
backend
/
database
/
README.md
Code
/
dashboard
/
backend
/
database
/
README.md
Search
5/12/2025
Viewing readonly version of main branch: v98
View latest version
README.md

Database

This app uses Val Town SQLite to manage data. Every Val Town account comes with a free SQLite database, hosted on Turso. This folder is broken up into two files:

  • migrations.ts - code to set up the database tables the app needs
  • queries.ts - functions to run queries against those tables, which are imported and used in the main Hono server in /backend/index.ts

Migrations

In backend/database/migrations.ts, this app creates a new SQLite table reactHonoStarter_messages to store messages.

This "migration" runs once on every app startup because it's imported in index.ts. You can comment this line out for a slight (30ms) performance improvement on cold starts. It's left in so that users who fork this project will have the migration run correctly.

SQLite has much more limited support for altering existing tables as compared to other databases. Often it's easier to create new tables with the schema you want, and then copy the data over. Happily LLMs are quite good at those sort of database operations, but please reach out in the Val Town Discord if you need help.

Queries

The queries file is where running the migrations happen in this app. It'd also be reasonable for that to happen in index.ts, or as is said above, for that line to be commented out, and only run when actual changes are made to your database schema.

The queries file exports functions to get and write data. It relies on shared types and data imported from the /shared directory.

FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.