plausible / analytics

Simple, open source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.
https://plausible.io
GNU Affero General Public License v3.0
18.98k stars 1.02k forks source link

APIv2: macros, SQL cleanup #4286

Closed macobo closed 1 day ago

macobo commented 1 week ago

Cleanup PR.

QueryBuilder requires selected fields to be aliased via both field names passed to select_merge as well as setting selected_as. This PR introduces utility macros to reduce this sort of boilerplate.

It also moves more code under Plausible.Stats.SQL