databaseRunnermain.tsx20 matches
6import pg from "npm:pg";
78type DatabaseType = "postgres" | "mysql" | "duckdb";
910interface QueryRequest {
11databaseType: DatabaseType;
12url?: string;
13query?: string;
33}
3435const { databaseType, url, query, introspect, gzip = false } = requestBody;
36console.log(`Database type: ${databaseType}`);
37console.log(`Query: ${query}`);
38console.log(`Introspect: ${introspect}`);
39console.log(`Gzip: ${gzip}`);
4041if (!databaseType) {
42console.error("Missing database type");
43return new Response("databaseType is required", { status: 400 });
44}
4549}
5051if (databaseType !== "duckdb" && !url) {
52console.error("Missing URL for non-DuckDB query");
53return new Response("URL is required for postgres and mysql", { status: 400 });
57try {
58if (introspect) {
59console.log(`Introspecting ${databaseType} schema`);
60if (databaseType === "postgres") {
61results = await introspectPostgresSchema(url!);
62} else if (databaseType === "mysql") {
63results = await introspectMysqlSchema(url!);
64} else {
65console.error(`Introspection not supported for ${databaseType}`);
66return new Response(`Introspection not supported for ${databaseType}`, { status: 400 });
67}
68} else {
69console.log(`Executing ${databaseType} query`);
70if (databaseType === "postgres") {
71results = await executePostgresQuery(url!, query!);
72} else if (databaseType === "mysql") {
73results = await executeMysqlQuery(url!, query!);
74} else if (databaseType === "duckdb") {
75console.log("DuckDB is not supported");
76return new Response("DuckDB is not supported", { status: 400 });
77} else {
78console.error(`Invalid database type: ${databaseType}`);
79return new Response("Invalid databaseType", { status: 400 });
80}
81}
118if (error.code === "ETIMEDOUT") {
119throw new Error(
120"Connection to PostgreSQL timed out. Please check your database URL and ensure the database is accessible.",
121);
122}
sqliteExplorerAppREADME.md1 match
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
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
38todo("Inserting and Querying Data"),
39todo("Running Migrations"),
40todo("SQLite as a KV Database"),
41todo("Drizzle in Val Town"),
42],
38todo("Inserting and Querying Data"),
39todo("Running Migrations"),
40todo("SQLite as a KV Database"),
41todo("Drizzle in Val Town"),
42],
sqliteExplorerAppREADME.md1 match
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
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
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
45This val fetches your recent playtime history from valve's API and stores it in a database every day !
67The project uses multiple vals to work:
sqliteExplorerAppREADME.md1 match
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
34const app = createApp({
5url: Deno.env.get("TURSO_DATABASE_URL")!,
6authToken: Deno.env.get("TURSO_AUTH_TOKEN")!,
7});