support sqlite or postgresql when using backend-specific date functions