2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useCallback, useRef, useState } from "https://esm.sh/react@18.2.0";
4import { DATABASE_TABLENAME } from "./constants";
5
6function App() {
179 // const KEY = new URL(import.meta.url).pathname.split("/").at(-1);
180 await sqlite.execute(`
181 CREATE TABLE IF NOT EXISTS ${DATABASE_TABLENAME} (
182 id INTEGER PRIMARY KEY AUTOINCREMENT,
183 type TEXT NOT NULL,
203 // Save metadata to SQLite
204 await sqlite.execute(
205 `INSERT INTO ${DATABASE_TABLENAME} (type, path) VALUES (?, ?)`,
206 [imageType, filename],
207 );
1export const DATABASE_TABLENAME = "VALENTINES_DAY_CARD_IMGS";
1import { DB } from "https://esm.town/v/@std/sqlite";
2
3// Initialize SQLite database
4const db = new DB();
5db.execute(`
494 const KEY = new URL(import.meta.url).pathname.split("/").at(-1);
495
496 // Initialize database
497 await sqlite.execute(`
498 CREATE TABLE IF NOT EXISTS ${KEY}_project_state_${SCHEMA_VERSION} (
7export const countPath = (app) => {
8 app.get('/count', async (c) => {
9 const connectionString = Deno.env.get('DATABASE_URL')
10 const supabaseUrl = Deno.env.get('SUPABASE_URL')
11 const supabaseKey = Deno.env.get('SUPABASE_ANON_KEY')
15}
16
17async function initializeDatabase() {
18 await sqlite.execute(`
19 CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
27
28export default async function(interval: Interval) {
29 await initializeDatabase();
30
31 for (const url of URLS) {
65
66export async function getAllVersions() {
67 await initializeDatabase();
68 const versions = await sqlite.execute(`SELECT * FROM ${TABLE_NAME} ORDER BY timestamp DESC`);
69 console.log(versions, TABLE_NAME);
1import { createClient } from "jsr:@supabase/supabase-js@2";
2
3const connectionString = Deno.env.get('DATABASE_URL')
4const supabaseUrl = Deno.env.get('SUPABASE_URL')
5const supabaseKey = Deno.env.get('SUPABASE_ANON_KEY')
1### Example project with Supabase
2
3This is an example ValTown project that uses Supabase both as a database and an authorization service.
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
40 <li>We extract email domains from your user list</li>
41 <li>
42 We match these domains against our database of YC companies (sourced{" "}
43 <a href="https://docs.google.com/spreadsheets/d/181GQmXflgMCCI9awLbzK4Zf0uneQBKoh51wBjNTc8Us/edit?gid=0#gid=0">
44 here
45 </a>
46 , cached <a href="https://www.val.town/v/stevekrouse/yc_database">here</a>)
47 </li>
48 <li>You get a detailed report of matches, enriched with YC company data</li>
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);
230 if (url.pathname === "/companies.json") {