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
trackESMContentmain.tsx3 matches
15}
1617async function initializeDatabase() {
18await sqlite.execute(`
19CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
2728export default async function(interval: Interval) {
29await initializeDatabase();
3031for (const url of URLS) {
6566export async function getAllVersions() {
67await initializeDatabase();
68const versions = await sqlite.execute(`SELECT * FROM ${TABLE_NAME} ORDER BY timestamp DESC`);
69console.log(versions, TABLE_NAME);
passkeys_demomain.tsx1 match
33}
34console.log("huh?");
35// DATABASE
36const kv = new DenoSyntheticKV("passkeys_example");
37
5/**
6* Every Val Town account comes with its own private
7* [SQLite database](https://www.sqlite.org/) that
8* is accessible from any of your vals.
9* ([Docs ↗](https://docs.val.town/std/sqlite))
115116// adapted from
117// https://github.com/tursodatabase/libsql-client-ts/blob/17dd996b840c950dd22b871adfe4ba0eb4a5ead3/packages/libsql-client/src/sqlite3.ts#L314C1-L337C2
118function rowFromSql(
119sqlRow: Array<unknown>,
1# Get a DuckDB database
23This method sets up a [duckdb-wasm](https://github.com/duckdb/duckdb-wasm) database that you can then use to store and retrieve data.
notion2wallabagREADME.md1 match
1# Notion2Wallabag
23Intended to be run with Notion's webhooks. When fired, tries to save a Notion database item with a "Link" property to a Wallabag instance.
45Cannot be re-used for other workspaces, since it requires various Wallabag secrets and a Notion-specific token. Feel free to fork!
40<li>We extract email domains from your user list</li>
41<li>
42We 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">
44here
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>
226227export default async function server(request: Request): Promise<Response> {
228const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229const url = new URL(request.url);
230if (url.pathname === "/companies.json") {
iframeGridInfinitemain.tsx11 matches
1/**
2* This val creates an infinite grid of iframes with thick draggable borders.
3* It includes a welcome modal, fixes the drag state issue, and stores iframe URLs in a database.
4*/
565const [showModal, setShowModal] = useState(true);
66const [iframes, setIframes] = useState([]);
67const [urlDatabase, setUrlDatabase] = useState({});
68const [isLoading, setIsLoading] = useState(false);
69const gridRef = useRef(null);
86useEffect(() => {
87updateIframes();
88}, [position, windowSize, urlDatabase]);
8990useEffect(() => {
91loadUrlDatabase();
92}, []);
93131left,
132top,
133url: urlDatabase[key] || '',
134});
135}
150});
151if (!response.ok) throw new Error('Failed to submit URL');
152const updatedDatabase = await response.json();
153setUrlDatabase(updatedDatabase);
154} catch (error) {
155console.error('Error submitting URL:', error);
160};
161162const loadUrlDatabase = async () => {
163try {
164const response = await fetch('/api/load-urls');
165if (!response.ok) throw new Error('Failed to load URLs');
166const loadedUrls = await response.json();
167setUrlDatabase(loadedUrls);
168} catch (error) {
169console.error('Error loading URLs:', error);
229230const result = await sqlite.execute(`SELECT * FROM ${KEY}_urls`);
231const updatedDatabase = Object.fromEntries(result.rows.map(row => [row.key, row.url]));
232233return new Response(JSON.stringify(updatedDatabase), {
234headers: { 'Content-Type': 'application/json' },
235});
niceTodoListmain.tsx1 match
43}
4445// Fetch todos from the database
46const todos = await sqlite.execute(`SELECT * FROM ${KEY}_todos_${SCHEMA_VERSION} ORDER BY id DESC`);
47
1# SQLite - [Docs ↗](https://docs.val.town/std/sqlite)
23[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).
45Val Town SQLite is powered by [Turso](https://turso.tech/).
9* [ORMs](https://docs.val.town/std/sqlite/orms)
1011You may find these admin viewers helpful managing your database:
1213* [SQLite Explorer](https://www.val.town/v/nbbaier/sqliteExplorerApp) (built in Val Town)