- match sth#fetch1 () with
- [ `String canonical_hostname;
- `Bool has_css;
- (`Null | `Int _) as page_count; (`Null | `Int _) as total_count;
- (`Null | `Timestamp _) as last_modified_date;
- (`Null | `Timestamp _) as creation_date ] ->
- let page_count = match page_count with
- `Null -> 0
- | `Int n -> n in
- let total_count = match total_count with
- `Null -> 0
- | `Int n -> n in
- let last_modified_date = match last_modified_date with
- `Null -> ""
- | `Timestamp t -> printable_date t in
- let creation_date = match creation_date with
- `Null -> ""
- | `Timestamp t -> printable_date t in
- canonical_hostname, has_css, page_count, total_count,
- last_modified_date, creation_date
- | _ -> assert false in
+ match rows with
+ | [ canonical_hostname, Some has_css,
+ page_count,
+ total_count,
+ last_modified_date, creation_date ] ->
+ let page_count = match page_count with
+ | None -> 0L
+ | Some n -> n in
+ let total_count = match total_count with
+ | None -> 0L
+ | Some n -> n in
+ let last_modified_date = match last_modified_date with
+ | None -> ""
+ | Some t -> printable_date t in
+ let creation_date = match creation_date with
+ | None -> ""
+ | Some t -> printable_date t in
+ canonical_hostname, has_css, page_count, total_count,
+ last_modified_date, creation_date
+ | _ -> assert false in