1. c = con.cursor()
2. По стандарту вернёстся не словарь, а список. В вашем случае порядковый номер надо использовать
link = c.execute("SELECT codeLink FROM codes WHERE code == ?", (code,)).fetchone()[0]
name = c.execute("SELECT codeName FROM codes WHERE code == ?", (code,)).fetchone()[1]
3. В mySql:
import mysql.connector
cnx = mysql.connector.connect(user='root', password='',host='127.0.0.1',database='test1')
cursor = cnx.cursor(dictionary=True)
sql= ("SELECT * FROM `users` WHERE id>0")
cursor.execute(sql)
results = cursor.fetchall()
print(results)
4. В любом случае можно преобразовать:
import sqlite3
con = sqlite3.connect("my.db")
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
con.row_factory = dict_factory
cur = con.cursor()
cur.execute("DROP TABLE movie")
cur.execute("CREATE TABLE movie(name, year, score)")
cur.execute("INSERT INTO movie(name, year, score) VALUES ('123', '123', '123')")
res = cur.execute("SELECT name FROM movie").fetchone()
print(res)