Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement