forked from
tangled.org/core
fork
Configure Feed
Select the types of activity you want to include in your feed.
Monorepo for Tangled
fork
Configure Feed
Select the types of activity you want to include in your feed.
1package db
2
3type DbWrapper struct {
4 Execer
5}
6
7func (db DbWrapper) SaveLastTimeUs(lastTimeUs int64) error {
8 _, err := db.Exec(`
9 insert into _jetstream (id, last_time_us)
10 values (1, ?)
11 on conflict(id) do update set last_time_us = excluded.last_time_us
12 `, lastTimeUs)
13 return err
14}
15
16func (db DbWrapper) GetLastTimeUs() (int64, error) {
17 var lastTimeUs int64
18 row := db.QueryRow(`select last_time_us from _jetstream where id = 1;`)
19 err := row.Scan(&lastTimeUs)
20 return lastTimeUs, err
21}