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=332&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 3476 results for "database"(579ms)

databaseRunnermain.tsx20 matches

@nicosuave•Updated 10 months ago
6import pg from "npm:pg";
7
8type DatabaseType = "postgres" | "mysql" | "duckdb";
9
10interface QueryRequest {
11 databaseType: DatabaseType;
12 url?: string;
13 query?: string;
33 }
34
35 const { databaseType, url, query, introspect, gzip = false } = requestBody;
36 console.log(`Database type: ${databaseType}`);
37 console.log(`Query: ${query}`);
38 console.log(`Introspect: ${introspect}`);
39 console.log(`Gzip: ${gzip}`);
40
41 if (!databaseType) {
42 console.error("Missing database type");
43 return new Response("databaseType is required", { status: 400 });
44 }
45
49 }
50
51 if (databaseType !== "duckdb" && !url) {
52 console.error("Missing URL for non-DuckDB query");
53 return new Response("URL is required for postgres and mysql", { status: 400 });
57 try {
58 if (introspect) {
59 console.log(`Introspecting ${databaseType} schema`);
60 if (databaseType === "postgres") {
61 results = await introspectPostgresSchema(url!);
62 } else if (databaseType === "mysql") {
63 results = await introspectMysqlSchema(url!);
64 } else {
65 console.error(`Introspection not supported for ${databaseType}`);
66 return new Response(`Introspection not supported for ${databaseType}`, { status: 400 });
67 }
68 } else {
69 console.log(`Executing ${databaseType} query`);
70 if (databaseType === "postgres") {
71 results = await executePostgresQuery(url!, query!);
72 } else if (databaseType === "mysql") {
73 results = await executeMysqlQuery(url!, query!);
74 } else if (databaseType === "duckdb") {
75 console.log("DuckDB is not supported");
76 return new Response("DuckDB is not supported", { status: 400 });
77 } else {
78 console.error(`Invalid database type: ${databaseType}`);
79 return new Response("Invalid databaseType", { status: 400 });
80 }
81 }
118 if (error.code === "ETIMEDOUT") {
119 throw new Error(
120 "Connection to PostgreSQL timed out. Please check your database URL and ensure the database is accessible.",
121 );
122 }

sqliteExplorerAppREADME.md1 match

@rupello•Updated 10 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

@amotivv•Updated 10 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

val_town_by_example_tocmain.tsx1 match

@pomdtr•Updated 10 months ago
38 todo("Inserting and Querying Data"),
39 todo("Running Migrations"),
40 todo("SQLite as a KV Database"),
41 todo("Drizzle in Val Town"),
42 ],

val_town_by_example_tocmain.tsx1 match

@iamseeley•Updated 10 months ago
38 todo("Inserting and Querying Data"),
39 todo("Running Migrations"),
40 todo("SQLite as a KV Database"),
41 todo("Drizzle in Val Town"),
42 ],

sqliteExplorerAppREADME.md1 match

@hlobil•Updated 10 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

@burcs•Updated 10 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

ownedGamesToSqliteREADME.md1 match

@alvi•Updated 10 months ago
3I wanted to log this data so I can analyse which days do I game the most ? which periods do I log the most hours in my confort game (Dead By Daylight) ? And so on. I think the data viz possibilities are super interesting, just like when Valve releases the "Steam in review" at the end of the year
4
5This val fetches your recent playtime history from valve's API and stores it in a database every day !
6
7The project uses multiple vals to work:

sqliteExplorerAppREADME.md1 match

@rchasman•Updated 10 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

libsqlstudiomain.tsx1 match

@iamseeley•Updated 10 months ago
3
4const app = createApp({
5 url: Deno.env.get("TURSO_DATABASE_URL")!,
6 authToken: Deno.env.get("TURSO_AUTH_TOKEN")!,
7});

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago