282
283
284
285
286
287
288
289
290
291
292
293
294
295
....
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
|
actor_notice_enum = {
params = {uint64}, sql = [[
select (notice).* from pg_temp.parsavpg_notices
where rcpt = $1::bigint
]];
};
auth_sigtime_user_fetch = {
params = {uint64}, sql = [[
select authtime::bigint
from parsav_actors where id = $1::bigint
]];
};
................................................................................
end
return 0, false
end];
actor_conf_int_set = [terra(src: &lib.store.source, uid: uint64, key: rawstring, value: uint64): {}
queries.actor_conf_int_set.exec(src,uid,key,value) end];
actor_conf_int_reset = [terra(src: &lib.store.source, uid: uint64, key: rawstring): {}
queries.actor_conf_int_reset.exec(src,uid,key) end];
actor_auth_register_uid = nil; -- TODO better support non-view based auth
}
return b
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
....
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
|
actor_notice_enum = {
params = {uint64}, sql = [[
select (notice).* from pg_temp.parsavpg_notices
where rcpt = $1::bigint
]];
};
circle_search = {
params = {uint64,uint64}, sql = [[
select name, id, owner, array_length(members,1) from parsav_circles where
($1::bigint = 0 or $1::bigint = owner) and
($2::bigint = 0 or $2::bigint = id)
]];
};
circle_members_fetch_cid = {
params = {uint64, uint64}, sql = [[
select unnest(members) from parsav_circles where
($1::bigint = 0 or owner = $1::bigint) and
id = $2::bigint
]];
};
circle_members_fetch_name = {
params = {uint64, pstring}, sql = [[
select unnest(members) from parsav_circles where
($1::bigint = 0 or owner = $1::bigint) and
name = $2::text
]];
};
auth_sigtime_user_fetch = {
params = {uint64}, sql = [[
select authtime::bigint
from parsav_actors where id = $1::bigint
]];
};
................................................................................
end
return 0, false
end];
actor_conf_int_set = [terra(src: &lib.store.source, uid: uint64, key: rawstring, value: uint64): {}
queries.actor_conf_int_set.exec(src,uid,key,value) end];
actor_conf_int_reset = [terra(src: &lib.store.source, uid: uint64, key: rawstring): {}
queries.actor_conf_int_reset.exec(src,uid,key) end];
circle_search = [terra(
src: &lib.store.source,
pool:&lib.mem.pool,
uid: uint64,
cid: uint64
): lib.mem.ptr(lib.store.circle)
var res = queries.circle_search.exec(src, uid, cid)
if res.sz == 0 then return [lib.mem.ptr(lib.store.circle)].null() end
defer res:free()
var rt = pool:alloc(lib.store.circle, res.sz)
for i = 0, res.sz do
var name = res:_string(i,0)
rt(i) = lib.store.circle {
name = name:pdup(pool);
cid = res:int(uint64,i,1);
owner = res:int(uint64,i,2);
memcount = res:int(uint64,i,3);
}
end
return rt
end];
circle_members_fetch_cid = [terra(
src: &lib.store.source,
pool:&lib.mem.pool,
uid: uint64,
cid: uint64
): lib.mem.ptr(uint64)
var res = queries.circle_members_fetch_cid.exec(src,uid,cid)
if res.sz == 0 then return [lib.mem.ptr(uint64)].null() end
defer res:free()
var rt = pool:alloc(uint64, res.sz)
for i = 0, res.sz do rt(i) = res:int(uint64,i,0) end
return rt
end];
actor_auth_register_uid = nil; -- TODO better support non-view based auth
}
return b
|