Turned getDownloads into a proper query.
This commit is contained in:
parent
f0b2b92c43
commit
d1b0a7d402
|
@ -25,12 +25,10 @@ module ExtensionQueries =
|
||||||
let getDownloads (ctx:ExtensionDbType) extid =
|
let getDownloads (ctx:ExtensionDbType) extid =
|
||||||
query {
|
query {
|
||||||
for order in ctx.Extensions.Extension do
|
for order in ctx.Extensions.Extension do
|
||||||
where (order.Extid = extid)
|
where (order.Extid = extid && order.Downloads.IsSome)
|
||||||
select (order.Date, order.Downloads)
|
select (order.Date, order.Downloads.Value)
|
||||||
} |> Seq.filter (fun (_, download) -> download.IsSome)
|
}
|
||||||
|> Seq.map (fun (date, download) -> (date,
|
|
||||||
download.Value))
|
|
||||||
|
|
||||||
let getAllExtIds (ctx:ExtensionDbType) =
|
let getAllExtIds (ctx:ExtensionDbType) =
|
||||||
query {
|
query {
|
||||||
for ext in ctx.Extensions.Extension do
|
for ext in ctx.Extensions.Extension do
|
||||||
|
|
Loading…
Reference in New Issue