Skip to content

Instantly share code, notes, and snippets.

@pilshchikov
Created March 21, 2019 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pilshchikov/b98ce5514209ef7009099b9c188398a6 to your computer and use it in GitHub Desktop.
Save pilshchikov/b98ce5514209ef7009099b9c188398a6 to your computer and use it in GitHub Desktop.
VARBINARY cant parse
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