A
A
alex03652021-03-08 11:24:23
Python
alex0365, 2021-03-08 11:24:23

Why does SQL convert everything to tuple?

I use SQLite3, it converts any data to tuple, which is terribly inconvenient, or rather, when I try to get data, it gives them out in tuple format.

cursor.execute("""CREATE TABLE IF NOT EXISTS test (
    something INT
)""")
cursor.execute("INSERT INTO test VALUES (1)")
cursor.execute("SELECT something FROM test WHERE something == 1").fetchone()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2021-03-08
@alex0365

Everything is convenient there, just learn how to work with it, or read the docs and get it in a dict, if necessary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question