AWS Athena - Python library for disinfecting SQL query parameters

In AWS Athena, there seems to be no good way to pass parameters to an SQL query. A typical way to execute is to call boto3,

response = client.start_query_execution(
    QueryString='string',
    ClientRequestToken='string',
    QueryExecutionContext={
        'Database': 'string'
    },
    ResultConfiguration={
        'OutputLocation': 'string',
        'EncryptionConfiguration': {
            'EncryptionOption': 'SSE_S3'|'SSE_KMS'|'CSE_KMS',
            'KmsKey': 'string'
        }
    }
)

If I need to pass parameters to a QueryString, I need to sanitize it to avoid injections.

How to clear the input? Any individual sanitation libraries?

+4
source share

Source: https://habr.com/ru/post/1693654/


All Articles