Signed-off-by: dusk y.bera003.06@protonmail.com
+8
-1
appview/db/db.go
+8
-1
appview/db/db.go
···
1069
1069
// transfer data, constructing pull_at from pulls table
1070
1070
_, err = tx.Exec(`
1071
1071
insert into pull_submissions_new (id, pull_at, round_number, patch, created)
1072
-
select
1072
+
select
1073
1073
ps.id,
1074
1074
'at://' || p.owner_did || '/sh.tangled.repo.pull/' || p.rkey,
1075
1075
ps.round_number,
···
1170
1170
func FilterContains(key string, arg any) filter {
1171
1171
return newFilter(key, "like", fmt.Sprintf("%%%v%%", arg))
1172
1172
}
1173
+
func FilterBetween(key string, arg1, arg2 any) filter {
1174
+
return newFilter(key, "between", []any{arg1, arg2})
1175
+
}
1173
1176
1174
1177
func (f filter) Condition() string {
1175
1178
rv := reflect.ValueOf(f.arg)
1176
1179
kind := rv.Kind()
1177
1180
1181
+
if f.cmp == "between" {
1182
+
return fmt.Sprintf("%s %s ? and ?", f.key, f.cmp)
1183
+
}
1184
+
1178
1185
// if we have `FilterIn(k, [1, 2, 3])`, compile it down to `k in (?, ?, ?)`
1179
1186
if (kind == reflect.Slice && rv.Type().Elem().Kind() != reflect.Uint8) || kind == reflect.Array {
1180
1187
if rv.Len() == 0 {