Python Driver for Phoenix

    1. import phoenixdb
    2. import phoenixdb.cursor
    3. database_url = 'http://localhost:8765/'
    4. conn = phoenixdb.connect(database_url, autocommit=True)
    5.  
    6. cursor = conn.cursor()
    7. cursor.execute("CREATE TABLE users (id INTEGER PRIMARY KEY, username VARCHAR)")
    8. cursor.execute("UPSERT INTO users VALUES (?, ?)", (1, 'admin'))
    9. print(cursor.fetchall())
    10.  
    11. cursor = conn.cursor(cursor_factory=phoenixdb.cursor.DictCursor)
    12. cursor.execute("SELECT * FROM users WHERE id=1")
    13. print(cursor.fetchone()['USERNAME'])
    • The driver presently does not support Kerberos authentication PHOENIX-4688