Database Returns <sqlite3.Row object at 0x0000019494A725F0> Instead of Data
20:44 28 May 2023

Whenever I collect data from my database, it is stored as instead of being the actual data within the database. I've tried multiple methods that worked for other people but doesn't for me(such as .fetchall()). I'm currently using Flask and I think that might have something to do with the error. This is my current python code:

@app.route('/signup', methods=["GET", "POST"])
def add_data():
    p = request.form['password']
    p2 = request.form['password_c']
    if p == p2:
        db = get_db()
        e = request.form['email']
        e2 = db.execute('SELECT Email FROM Users').fetchall()
        if e in e2:
            return render_template('Exist2.html', title="Login Page")
        else:
            if request.method == "POST":
                fname = request.form['fname']
                sname = request.form['sname']
                address = request.form['address']
                email = request.form['email']
                password = request.form['password']
                key = Fernet.generate_key()
                f = Fernet(key)
                encrypted_address = f.encrypt(bytes(address, 'utf-8'))
                encrypted_password = generate_password_hash(password)
                db = get_db()
                db.execute('INSERT INTO Users'
                           '(First_Name, Surname, Address, EKey, Password, Email)'
                           'VALUES (?, ?, ?, ?, ?, ?)',
                           (fname, sname, encrypted_address, key, encrypted_password, email))
                db.commit()
            return render_template('Success.html', title='Login Page', variable=e2)
    else:
        return render_template('False.html', title='Home Page')

And my html code is:

{% extends "base.html" %}

{% block content %}

Sign Up:
Enter your data:
First Name:
Surname:
Address:
Email:
Password:
Confirm Password:

{% block error_false %} {% endblock %} {% endblock %}

This code is for a sign up page and I'm trying to check if the email entered already exists in the database with e2 = db.execute('SELECT Email FROM Users').fetchall() which should give a list of all the Emails which I can then check with the entered email but instead I get given: [, , , ] Entering data into the database is fine it's just the collecting that's the problem.

I've tried .fetchall() which seems to work for others not using Flask but not for me. I also tried singular queries, but it still gave the same error.

EDIT: Thanks @Serg, that worked. Only issue, If I wanted to find what the variable was, I would only be able to try options until I find out. Is there a way I can find out without trial and error? I've tried sending the output to python console and the html page but neither worked.

EDIT 2: Also, I'm trying to use hashing and check if the database entered hash is the same as the entered password but using this method is impossible because of random additions when hashing making them unable to cracked using Rainbow Table Attacks. Could I instead convert sqlite3.Row objects into plaintext?

python html sql sqlite flask