1# VALL-E
2
3LLM code generation for vals! Make apps with a frontend, backend, and database.
4
5It's a bit of work to get this running, but it's worth it.
27 {
28 keyword: 'Translation Memory',
29 staticDefinition: 'Database of previously translated text segments that helps translators maintain consistency and improve translation efficiency.',
30 proficiencyLevel: 'Intermediate'
31 },
280 } catch (error) {
281 console.error("Failed to create table:", error);
282 return new Response("Database initialization error", { status: 500 });
283 }
284
1import { generateCode } from "./backend/generate-code";
2import { createTables } from "./database/migrations";
3import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries";
4
5async function servePublicFile(path: string): Promise<Response> {
173 const userId = crypto.randomUUID(); // Generates a unique identifier
174
175 // Store user in database
176 await sqlite.execute(
177 `INSERT OR IGNORE INTO ${KEY}_users_${SCHEMA_VERSION} (id) VALUES (?)`,
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
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
112 } catch (importError) {
113 console.error('SQLite import error:', importError);
114 return new Response('Database module unavailable', {
115 status: 500,
116 headers: { 'Content-Type': 'text/plain' }
131 } catch (tableCreateError) {
132 console.error('Table creation error:', tableCreateError);
133 return new Response('Database initialization failed', {
134 status: 500,
135 headers: { 'Content-Type': 'text/plain' }
294 }
295 } catch (error) {
296 console.error('Database initialization error:', error);
297 return new Response(JSON.stringify({
298 error: 'Database initialization failed',
299 details: error.message
300 }), {
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)