54 return { error: "already exists!" };
55 }
56 await users.push(user); // Assume insertion into a database
57 return { ok: true, users };
58 }
9## Contributing
10
11Forking this repo should mostly work, except for the sqlite database. You'll need to create the table & populate it with some data. [This script](https://www.val.town/v/stevekrouse/dateme_sqlite) *should* do it, but I think it has a couple bugs. If you're interested in contributing to this project contact me or comment on this val and I'll get it working for ya!
12
13## Todos
14
15- [ ] Make the SQLite database forkable and build a widget/workflow for that, ie fix @stevekrouse/dateme_sqlite
16- [ ] Require an email (that isn't shared publicly)
17 - [ ] Verify the email address with a "magic link"
33}
34
35// DATABASE
36const kv = new DenoSyntheticKV("passkeys_example");
37
2import {
3 convertSqliteType,
4 DatabaseHeader,
5 DatabaseResultSet,
6 DatabaseRow,
7 SqliteLikeBaseDriver,
8} from "https://esm.sh/@libsqlstudio/gui/driver";
9
10export function transformRawResult(raw: ResultSet): DatabaseResultSet {
11 const headerSet = new Set();
12
13 const headers: DatabaseHeader[] = raw.columns.map((colName, colIdx) => {
14 const colType = raw.columnTypes[colIdx];
15 let renameColName = colName;
34 a[b.name] = r[idx];
35 return a;
36 }, {} as DatabaseRow)
37 );
38
60 }
61
62 async transaction(stmts: InStatement[]): Promise<DatabaseResultSet[]> {
63 const r = await fetch(`/api/batch`, {
64 method: "POST",
80 }
81
82 async query(stmt: InStatement): Promise<DatabaseResultSet> {
83 const r = await fetch(`/api/execute`, {
84 method: "POST",
33}
34
35// DATABASE
36const kv = new DenoSyntheticKV("passkeys_example");
37
4import humanizeDuration from "npm:humanize-duration";
5
6// Initialize the SQLite database and create the waterings table
7sqlite.execute(`
8 CREATE TABLE IF NOT EXISTS waterings (
9## Contributing
10
11Forking this repo should mostly work, except for the sqlite database. You'll need to create the table & populate it with some data. [This script](https://www.val.town/v/stevekrouse/dateme_sqlite) *should* do it, but I think it has a couple bugs. If you're interested in contributing to this project contact me or comment on this val and I'll get it working for ya!
12
13## Todos
14
15- [ ] Make the SQLite database forkable and build a widget/workflow for that, ie fix @stevekrouse/dateme_sqlite
16- [ ] Require an email (that isn't shared publicly)
17 - [ ] Verify the email address with a "magic link"
9## Contributing
10
11Forking this repo should mostly work, except for the sqlite database. You'll need to create the table & populate it with some data. [This script](https://www.val.town/v/stevekrouse/dateme_sqlite) *should* do it, but I think it has a couple bugs. If you're interested in contributing to this project contact me or comment on this val and I'll get it working for ya!
12
13## Todos
14
15- [ ] Make the SQLite database forkable and build a widget/workflow for that, ie fix @stevekrouse/dateme_sqlite
16- [ ] Require an email (that isn't shared publicly)
17 - [ ] Verify the email address with a "magic link"
115. Rename the new table to the original table name
12
13This script shows me adding a primary key constraint to the `Profile` column of my `DateMeDocs` database. I would console and comment out various parts of it as I went. You can see everything I did in the version history. The main tricky part for me was removing the duplicate primary key entries before doing the migration step, which is a useful thing anyways, from a data cleaning perspective.
14
15Migrated from folder: Archive/sqlite_clone_migrate_table
7
8- [val.town](https://www.val.town/) - Infrastructure
9- [SQLite](https://www.sqlite.org/index.html) - Database
10- [Deno](https://deno.com/) - Runtime
11- [Pushover](https://pushover.net/) - Notifications