Unify log queries to only have SQLX code in the runtime and use it for both the log client and for tests