if (options.limit !== -1) {
        sql += " limit " + options.limit.toString() +
            " offset " + (options.offset || 0).toString();
    }