Compare commits
2 Commits
v0.2.3-bet
...
master
Author | SHA1 | Date | |
---|---|---|---|
ad4963e5a0 | |||
fbd5f28d54 |
@ -74,7 +74,7 @@ func (s *Syncer) Process(ctx context.Context) error {
|
|||||||
|
|
||||||
kvRows, err := pgx.CollectRows(rows, func(row pgx.CollectableRow) (KVRow, error) {
|
kvRows, err := pgx.CollectRows(rows, func(row pgx.CollectableRow) (KVRow, error) {
|
||||||
var kvRow KVRow
|
var kvRow KVRow
|
||||||
err := row.Scan(&kvRow.Key, &kvRow.Value, &kvRow.Updated)
|
err := row.Scan(&kvRow.ID, &kvRow.Key, &kvRow.Value, &kvRow.Updated)
|
||||||
return kvRow, err
|
return kvRow, err
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
--name: extract-entries
|
--name: extract-entries
|
||||||
SELECT key, value, updated FROM kv_vise
|
SELECT id, key, value, updated FROM kv_vise
|
||||||
WHERE updated > (SELECT last_sync FROM ussd_sync LIMIT 1)
|
WHERE updated > (SELECT last_sync FROM ussd_sync LIMIT 1)
|
||||||
ORDER BY updated DESC
|
ORDER BY updated DESC
|
||||||
|
|
||||||
--name: update-cursor
|
--name: update-cursor
|
||||||
-- $1: timestamp
|
-- $1: timestamp
|
||||||
UPDATE ussd_sync SET last_sync = ($1)
|
UPDATE ussd_sync SET last_sync = ($1)
|
||||||
|
|
||||||
|
-- 202b3235343732343934323039370013
|
||||||
|
-- 202b3235343731313030303132330013
|
Loading…
Reference in New Issue
Block a user