diff options
| author | eltrac <hi@eltr.ac> | 2026-10-16 08:44:26 +0200 |
|---|---|---|
| committer | Eltrac <hi@eltr.ac> | 2026-10-16 08:44:26 +0200 |
| commit | 1db02376cd50e604973d17fd4a04f6e1969fc53c (patch) | |
| tree | c9a7b3832e8dd7b89966b70aeaf991ce56ac098a /resources | |
| parent | c2823e5191c2c5634a512df83d5d895eaba4356f (diff) | |
Implement SQLite storage #7 (#73)
- new config `:storage-type` (default `:edn`, also support `:sqlite`)
- `LICENSE` change: add exceptions to `next.jdbc` (which uses EPL)
Reviewed-on: https://codeberg.org/eltrac/weepinbell/pulls/73
Diffstat (limited to 'resources')
| -rw-r--r-- | resources/config.edn | 1 | ||||
| -rw-r--r-- | resources/sql/sqlite_init.sql | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/resources/config.edn b/resources/config.edn index e45eb8a..f73758a 100644 --- a/resources/config.edn +++ b/resources/config.edn @@ -2,6 +2,7 @@ :base-url "http://localhost:3000" :endpoint "/endpoint" :allowed-target-domains ["example.com"] + :storage-type :edn :data-path "data/webmention.edn" :webhook {:on-receive [] :on-create [] diff --git a/resources/sql/sqlite_init.sql b/resources/sql/sqlite_init.sql new file mode 100644 index 0000000..012e9c6 --- /dev/null +++ b/resources/sql/sqlite_init.sql @@ -0,0 +1,32 @@ +create table if not exists webmention ( + id integer primary key autoincrement, + hash text not null unique, + wm_source text not null, + wm_target text not null, + wm_source_domain text not null, + wm_target_domain text not null, + wm_source_path text not null, + wm_target_path text not null, + lastmod integer not null +); + +create table if not exists microformats ( + id integer primary key autoincrement, + wm_id integer not null, + mf_type text not null, + mf_data text not null, /* schema on read, store EDN string here */ + + FOREIGN KEY (wm_id) + references webmention(id) + on delete cascade +); + +create table if not exists proxied_photo ( + id integer primary key autoincrement, + wm_id integer not null, + url text not null, + + FOREIGN KEY (wm_id) + references webmention(id) + on delete cascade +); |
