Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of limit_to parameter #37

Open
rerb opened this issue Mar 15, 2018 · 0 comments
Open

Get rid of limit_to parameter #37

rerb opened this issue Mar 15, 2018 · 0 comments

Comments

@rerb
Copy link
Contributor

rerb commented Mar 15, 2018

Replace with something like:

def limit_query_to(query, limit):
    if "limit" in query.lower():
        return query
    else:
        return add_limit(query, limit)

def add_limit(query, limit):
    if query[-1] != ';':
        sub_query = query
    else:
        sub_query = query[0, -1]
    return "{sub_query} LIMIT {limit};".format(
        sub_query=sub_query, limit=limit)

#36 has background on why this change should be made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant