def TEST_SQL_NUMPY():
    sqldb_fname = 'temp_test_sql_numpy.sqlite3'
    sqldb_dpath = utool.util_cplat.get_app_resource_dir('ibeis', 'testfiles')
    utool.ensuredir(sqldb_dpath)
    utool.util_path.remove_file(join(sqldb_dpath, sqldb_fname), dryrun=False)
    db = sqldbc.SQLDatabaseController(sqldb_dpath=sqldb_dpath, sqldb_fname=sqldb_fname)
    db.add_table('temp', [('temp_id', 'INTEGER PRIMARY KEY'), ('temp_hash', 'NUMPY')])
    tt = utool.tic()
    feats_list = grab_numpy_testdata(shape=(3000.0, 128), dtype=np.uint8)
    print((' * numpy.new time=%r sec' % utool.toc(tt)))
    print('[TEST] insert numpy arrays')
    tt = utool.tic()
    feats_iter = ((feats,) for feats in feats_list)
    db.executemany(operation='\n        INSERT\n        INTO temp\n        (\n            temp_hash\n        )\n        VALUES (?)\n        ', params_iter=feats_iter)
    print((' * execute insert time=%r sec' % utool.toc(tt)))
    print('[TEST] save sql database')
    tt = utool.tic()
    db.connection.commit()
    print((' * commit time=%r sec' % utool.toc(tt)))
    print('[TEST] read from sql database')
    tt = utool.tic()
    db.cur.execute('SELECT temp_hash FROM temp', [])
    print((' * execute select time=%r sec' % utool.toc(tt)))
    tt = utool.tic()
    result_list = _results_gen(db.cur)
    print((' * iter results time=%r sec' % utool.toc(tt)))
    print((' * memory(result_list) = %s' % utool.byte_str2(utool.get_object_size(result_list))))
    del result_list
    print('[TEST] dump sql database')
    tt = utool.tic()
    db.dump('temp.dump.txt')
    print((' * dump time=%r sec' % utool.toc(tt)))
    return locals()
def TEST_SQL_NUMPY():
    sqldb_fname = 'temp_test_sql_numpy.sqlite3'
    sqldb_dpath = utool.util_cplat.get_app_resource_dir('ibeis', 'testfiles')
    utool.ensuredir(sqldb_dpath)
    utool.util_path.remove_file(join(sqldb_dpath, sqldb_fname), dryrun=False)
    db = sqldbc.SQLDatabaseController(sqldb_dpath=sqldb_dpath, sqldb_fname=sqldb_fname)
    db.add_table('temp', [('temp_id', 'INTEGER PRIMARY KEY'), ('temp_hash', 'NUMPY')])
    tt = utool.tic()
    feats_list = grab_numpy_testdata(shape=(3000.0, 128), dtype=np.uint8)
    print((' * numpy.new time=%r sec' % utool.toc(tt)))
    print('[TEST] insert numpy arrays')
    tt = utool.tic()
    feats_iter = ((feats,) for feats in feats_list)
    db.executemany(operation='\n        INSERT\n        INTO temp\n        (\n            temp_hash\n        )\n        VALUES (?)\n        ', params_iter=feats_iter)
    print((' * execute insert time=%r sec' % utool.toc(tt)))
    print('[TEST] save sql database')
    tt = utool.tic()
    db.connection.commit()
    print((' * commit time=%r sec' % utool.toc(tt)))
    print('[TEST] read from sql database')
    tt = utool.tic()
    db.cur.execute('SELECT temp_hash FROM temp', [])
    print((' * execute select time=%r sec' % utool.toc(tt)))
    tt = utool.tic()
    result_list = _results_gen(db.cur)
    print((' * iter results time=%r sec' % utool.toc(tt)))
    print((' * memory(result_list) = %s' % utool.byte_str2(utool.get_object_size(result_list))))
    del result_list
    print('[TEST] dump sql database')
    tt = utool.tic()
    db.dump('temp.dump.txt')
    print((' * dump time=%r sec' % utool.toc(tt)))
    return locals()