Created
March 21, 2019 14:02
-
-
Save pilshchikov/b98ce5514209ef7009099b9c188398a6 to your computer and use it in GitHub Desktop.
VARBINARY cant parse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyignite import Client | |
client = Client() | |
client.connect('127.0.0.1', 10800) | |
client.sql('DROP TABLE test IF EXISTS') | |
client.sql('CREATE TABLE test(id int primary key, varbin VARBINARY)') | |
client.sql('INSERT INTO test(id, varbin) VALUES (?, ?)', query_args=(1, bytearray('Test message', 'UTF-8'))) | |
result = client.sql('SELECT * FROM test') | |
field_data = list(*result) | |
print(field_data) | |
# [1, [15, 12, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, 0, 0, 0, 0, 116, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 109, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment