Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. from pyignite import Client
  2.  
  3. client = Client()
  4. client.connect('127.0.0.1', 10800)
  5.  
  6. client.sql('DROP TABLE test IF EXISTS')
  7. client.sql('CREATE TABLE test(id int primary key, varbin VARBINARY)')
  8. client.sql('INSERT INTO test(id, varbin) VALUES (?, ?)', query_args=(1, bytearray('Test message', 'UTF-8')))
  9. result = client.sql('SELECT * FROM test')
  10. field_data = list(*result)
  11. print(field_data)
  12.  
  13. # [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