Skip to content

Commit

Permalink
Fix export when collecting browsers/systems is disabled
Browse files Browse the repository at this point in the history
Would end up as NULL.

Aside: these columns pronably should be NULL in hits; no reason to store
it as "0". Same with location column.
  • Loading branch information
arp242 committed Aug 25, 2024
1 parent 2efd1fd commit 279ca00
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: 'test backend'
on:
push:
paths: ['**.go', 'go.mod', '.github/workflows/*']
pull_request:
paths: ['**.go', 'go.mod', '.github/workflows/*']
on: ['push', 'pull_request']

jobs:
# Uncomment to get a debug shell.
Expand Down
6 changes: 3 additions & 3 deletions export.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,15 @@ func (h *ExportRows) Export(ctx context.Context, limit, paginate int64) (int64,
paths.title,
paths.event,
browsers.name || ' ' || browsers.version as browser,
systems.name || ' ' || systems.version as system,
coalesce(browsers.name || ' ' || browsers.version, '') as browser,
coalesce(systems.name || ' ' || systems.version, '') as system,
hits.session,
hits.bot,
coalesce(refs.ref, '') as ref,
coalesce(refs.ref_scheme, '') as ref_s,
coalesce(sizes.size, '') as size,
hits.location as loc,
coalesce(hits.location, '') as loc,
hits.first_visit as first,
hits.created_at
from hits
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ require (
zgo.at/errors v1.3.0
zgo.at/follow v0.0.0-20240522232612-673fb184d32f
zgo.at/gadget v1.0.0
zgo.at/guru v1.1.0
zgo.at/guru v1.2.0
zgo.at/isbot v1.0.0
zgo.at/json v0.0.0-20221020004326-fe4f75bb278e
zgo.at/termtext v1.5.0
zgo.at/tz v0.0.0-20240819050900-3c7bf6122612
zgo.at/z18n v0.0.0-20240522230155-4d5af439f8c4
zgo.at/zcache v1.2.0
zgo.at/zcache/v2 v2.1.0
zgo.at/zdb v0.0.0-20240818155550-1a862f98cab0
zgo.at/zdb v0.0.0-20240820041039-abefdffc704f
zgo.at/zhttp v0.0.0-20240819012318-b761c83c740e
zgo.at/zli v0.0.0-20240614180544-47534b1ce136
zgo.at/zlog v0.0.0-20211017235224-dd4772ddf860
Expand Down
8 changes: 4 additions & 4 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 279ca00

Please sign in to comment.