src/dirbs/api/common/catalog.py
def _build_sql_query_filters(**kwargs: dict) -> Tuple[list, list]:
    """
    Function to build list of filters to apply to SQL query.

    Arguments:
        kwargs: parameters and values of SQL
    Returns:
        filters: formed SQL filters
        filter_params: parameters for filters
    """
    filters = []
    filter_params = []

    for param, param_value in kwargs.items():
        if param not in ['order', 'offset', 'limit']:
            if param in ['modified_time', 'last_seen']:
                operator = '>='
            else:
                operator = '='
            filters.append(sql.SQL('{0} {1} {2}').format(sql.Identifier(param), sql.SQL(operator), sql.Placeholder()))
            filter_params.append(param_value)
    return filters, filter_params

    Function to build list of filters to apply to SQL query.

    Arguments:
        kwargs: parameters and values of SQL
    Returns:
        filters: formed SQL filters
        filter_params: parameters for filters
    
Function to build list of filters to apply to SQL query.
Function to build list of filters to apply to SQL query .
def _build_sql_query_filters(**kwargs: dict) -> Tuple[list, list]:
    filters = []
    filter_params = []
    for param, param_value in kwargs.items():
        if param not in ['order', 'offset', 'limit']:
            if param in ['modified_time', 'last_seen']:
                operator = '>='
            else:
                operator = '='
            filters.append(sql.SQL('{0} {1} {2}').format(sql.Identifier(param), sql.SQL(operator), sql.Placeholder()))
            filter_params.append(param_value)
    return filters, filter_params
def _build_sql_query_filters ( ** kwargs : dict ) -> Tuple [ list , list ] : filters = [ ] filter_params = [ ] for param , param_value in kwargs . items ( ) : if param not in [ 'order' , 'offset' , 'limit' ] : if param in [ 'modified_time' , 'last_seen' ] : operator = '>=' else : operator = '=' filters . append ( sql . SQL ( '{0} {1} {2}' ) . format ( sql . Identifier ( param ) , sql . SQL ( operator ) , sql . Placeholder ( ) ) ) filter_params . append ( param_value ) return filters , filter_params
Function to build list of filters to apply to SQL query.
Function to build list of filters to apply to SQL query .
"""
    Function to build list of filters to apply to SQL query.

    Arguments:
        kwargs: parameters and values of SQL
    Returns:
        filters: formed SQL filters
        filter_params: parameters for filters
    """
formed SQL filters
filter_params: parameters for filters
formed SQL filters filter_params : parameters for filters
filters
kwargs
dict
parameters and values of SQL
parameters and values of SQL