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/?q=database&page=246&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 10131 results for "database"(3260ms)

reactHonoExampleREADME.md6 matches

@gwoods22•Updated 2 months ago
1# Database
2
3This app uses [Val Town SQLite](https://docs.val.town/std/sqlite/) to manage data. Every Val Town account comes with a free SQLite database, hosted on [Turso](https://turso.tech/). This folder is broken up into two files:
4
5* `migrations.ts` - code to set up the database tables the app needs
6* `queries.ts` - functions to run queries against those tables, which are imported and used in the main Hono server in `/backend/index.ts`
7
8## Migrations
9
10In `backend/database/migrations.ts`, this app creates a new SQLite table `reactHonoStarter_messages` to store messages.
11
12This "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.
13
14SQLite 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](https://discord.com/invite/dHv45uN5RY) if you need help.
15
16## Queries
17
18The 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.
19
20The queries file exports functions to get and write data. It relies on shared types and data imported from the `/shared` directory.

reactHonoExamplequeries.ts2 matches

@gwoods22•Updated 2 months ago
3import { createTables, tableName } from "./migrations.ts";
4
5// This will create the database table if it doesn't exist.
6// This will run every time the app starts up. You can
7// comment out this line for a modest (30ms) perforamnce improvement
8// on cold starts. It's left in to ensure the database tables are
9// automatically set up correctly for users who fork this app.
10await createTables();

reactHonoExamplemigrations.ts1 match

@gwoods22•Updated 2 months ago
13
14 However, you should know that SQLite has much more limited
15 support for altering existing tables as compared to other databases.
16 Often it's easier to create new tables with the schema you want, and then
17 copy the data over. */

reactHonoExampleindex.ts1 match

@gwoods22•Updated 2 months ago
1import { parseProject, readFile, serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { Hono } from "npm:hono";
3import { getMessages, insertMessage } from "./database/queries.ts";
4
5const app = new Hono();

testefluxoutils.ts5 matches

@tallesjp•Updated 2 months ago
9export function calculateEstimatedDuration(steps: any[]): number {
10 const baseDuration = steps.length * 2;
11 const complexSteps = steps.filter(s => ["make_api_call", "database_operation"].includes(s.type)).length;
12 return baseDuration + (complexSteps * 5);
13}
38 permissions.add("network_access");
39 break;
40 case "database_operation":
41 permissions.add("database_access");
42 break;
43 case "collect_user_input":
63 dependencies.add("http_client");
64 }
65 if (step.type === "database_operation") {
66 dependencies.add("database_driver");
67 }
68 });

untitled-5696htmlTemplate.ts1 match

@tallesjp•Updated 2 months ago
507 input: { label: "Entrada", icon: "šŸ“", color: "#9C27B0", subtypes: ["Texto", "NĆŗmero", "Arquivo", "Seleção"] },
508 output: { label: "SaĆ­da", icon: "šŸ“¤", color: "#FF5722", subtypes: ["Exibir", "Arquivo", "Notificação", "Resposta API"] },
509 api: { label: "API", icon: "🌐", color: "#673AB7", subtypes: ["REST API", "GraphQL", "Webhook", "Database"] },
510 end: { label: "Fim", icon: "ā¹ļø", color: "#F4436", subtypes: [] },
511 };

untitled-5696flowchart-editor-valtown.ts5 matches

@tallesjp•Updated 2 months ago
5function calculateEstimatedDuration(steps) {
6 const baseDuration = steps.length * 2;
7 const complexSteps = steps.filter(s => ["api_call", "database_operation"].includes(s.action)).length;
8 return baseDuration + (complexSteps * 5);
9}
24 permissions.add("network_access");
25 break;
26 case "database_operation":
27 permissions.add("database_access");
28 break;
29 case "collect_user_input":
44 dependencies.add("http_client");
45 }
46 if (step.action === "database_operation") {
47 dependencies.add("database_driver");
48 }
49 });

untitled-5696README.md2 matches

@tallesjp•Updated 2 months ago
48| **Entrada** | šŸ“ | Coletar dados | Texto, NĆŗmero, Arquivo, Seleção |
49| **SaĆ­da** | šŸ“¤ | Exibir resultados | Exibir, Arquivo, Notificação, Resposta API |
50| **API** | 🌐 | Chamadas externas | REST API, GraphQL, Webhook, Database |
51| **Fim** | ā¹ļø | Ponto de tĆ©rmino | - |
52
121- `display_output`: Exibição de resultados
122- `make_api_call`: Chamadas para APIs
123- `database_operation`: OperaƧƵes de banco de dados
124- `iterate`: Loops e iteraƧƵes
125- `terminate_agent`: Finalização do agente

untitled-5696aiConverter.ts3 matches

@tallesjp•Updated 2 months ago
32 'output': 'system_output',
33 'api': 'api_call',
34 'database': 'data_operation',
35 'loop': 'iteration'
36 };
127 break;
128
129 case 'database':
130 step.action = "database_operation";
131 step.parameters = {
132 operation: node.operation || "select",

untitled-5696client.ts1 match

@tallesjp•Updated 2 months ago
507 input: { label: "Entrada", icon: "šŸ“", color: "#9C27B0", subtypes: ["Texto", "NĆŗmero", "Arquivo", "Seleção"] },
508 output: { label: "SaĆ­da", icon: "šŸ“¤", color: "#FF5722", subtypes: ["Exibir", "Arquivo", "Notificação", "Resposta API"] },
509 api: { label: "API", icon: "🌐", color: "#673AB7", subtypes: ["REST API", "GraphQL", "Webhook", "Database"] },
510 end: { label: "Fim", icon: "ā¹ļø", color: "#F4436", subtypes: [] },
511 };

customer-database-setup2 file matches

@stevenvapi•Updated 2 months ago

prDatabase

@pdw•Updated 2 months ago