def METHOD_NAME(ds1, ds2, layer_type='postgres'):
    """
    Compare postgis/sqlite datasource bosed on dbname, host and table name
    :param ds1: qgis db datasoruce string from compare
    :param ds2: qgis db datasource string to compare
    :return: Boolean
    """
    from .structure import datasource2dict
    try:
        # split ds
        ds1 = datasource2dict(ds1)
        ds2 = datasource2dict(ds2)
        # compare only dbname and table if host is not present like for SQlite db:
        if layer_type == 'spatialite':
            return ds1['dbname'] == ds2['dbname'] and ds1['table'] == ds2['table']
        else:
            return ds1['dbname'] == ds2['dbname'] and ds1['host'] == ds2['host'] and ds1['table'] == ds2['table']
    except:
        # For very complex QueryLayer
        logger.warning(f"Postgres datasource very complex,  DS1: {ds1} | DS2: {ds2}")
        return ds1 == ds2