all: Move DB helpers into pkg/postgres