Beispiel #1
0
def get_latest_feed_json(c, feed_url):
    return get_value(c, '''select rr.data

                             from rss_result rr,
                                  feed_result_last frl

                            where frl.feed_result_id = rr.feed_result_id
                              and rr.result_url = ? ''', (feed_url, ))
Beispiel #2
0
def main():
    databases = DatabasesZeroMqClient('localhost', 9090)

    with databases.connect('test') as conn:
        with conn.cursor() as cursor:
            assert 1 == get_value(cursor, '''select 1''')

            test_connection(cursor)
Beispiel #3
0
def main():
    databases = RemoteDatabasesClient(remote_connections(connections))

    with databases.connect('test') as conn:
        with conn.cursor() as cursor:
            result = get_value(cursor, '''select 1''')
            assert 1 == result
            test_connection(cursor)
Beispiel #4
0
def main():
    client = HttpServerRequests(('localhost', 8086))

    databases = DatabaseHttpClient(client)

    with databases.connect('test') as conn:
        with conn.cursor() as cursor:
            assert 1 == get_value(cursor, '''select 1''')
            test_connection(cursor)
Beispiel #5
0
def main():
    #Start server in servers/queue
    databases = RemoteDatabasesClient(queue_client(server_address=('127.0.0.1', 50000)))

    with databases.connect('test') as conn:
        with conn.cursor() as cursor:
            result = get_value(cursor, '''select 1''')
            assert 1 == result
            test_connection(cursor)
Beispiel #6
0
def main():
    pool = pool_manager_process(connections)
    connection = pool.connect('test')

    with closing(connection) as conn:
        cursor = conn.cursor()
        with closing(cursor) as cursor:
            assert 1 == get_value(cursor, '''select 1''')

            test_connection(cursor)
Beispiel #7
0
def main():
    pool = pool_client(server_address=('127.0.0.1', 50001))

    connection = pool.connect('test')

    with closing(connection) as conn:
        cursor = conn.cursor()
        with closing(cursor) as cursor:
            assert 1 == get_value(cursor, '''select 1''')

            test_connection(cursor)
Beispiel #8
0
def get_feed_entry_id(c, feed_id, url):
    return get_value(
        c, '''select id
                            from feed_entry
                           where feed_id = ?
                             and url = ? ''', (feed_id, url))
Beispiel #9
0
def get_feed_id(cursor, url):
    return get_value(cursor, '''select id
                                  from feed
                                 where url = ? ''', (url, ))
Beispiel #10
0
def get_feed_result_entry_id(c, feed_result_id, feed_entry_id):
    return get_value(c, '''select id
                             from feed_result_entry
                            where feed_result_id = ?
                              and feed_entry_id = ?''', (feed_result_id, feed_entry_id))
Beispiel #11
0
def get_feed_result_id(c, result_id, published):
    return get_value(c, '''select id
                             from feed_result
                            where result_id = ?
                              and published = ?''', (result_id, published))
Beispiel #12
0
def get_feed_result_location_id(c, feed_id, result_url):
    return get_value(c, '''select id
                             from feed_result_location
                            where feed_id = ?
                              and url = ? ''', (feed_id, result_url))
Beispiel #13
0
def get_feed_entry_id(c, feed_id, url):
    return get_value(c, '''select id
                            from feed_entry
                           where feed_id = ?
                             and url = ? ''', (feed_id, url))