How to use the aiochclient.client.QueryTypes function in aiochclient

To help you get started, we’ve selected a few aiochclient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maximdanilchenko / aiochclient / aiochclient / client.py View on Github external
def query_type(cls, query: str) -> QueryTypes:
        check = query.lstrip()[:8].upper()
        if any(
            [
                check.startswith("SELECT"),
                check.startswith("SHOW"),
                check.startswith("DESCRIBE"),
                check.startswith("EXISTS"),
            ]
        ):
            return QueryTypes.FETCH
        if check.startswith("INSERT"):
            return QueryTypes.INSERT
        return QueryTypes.OTHER