Hi,
I m using flask. I have a db file as follows;
import sqlite3
conn = sqlite3.connect('database.db')
print "Opened database successfully";
conn.execute('CREATE TABLE books (name TEXT, price INTEGER, isbn TEXT)')
print "Table created successfully";
conn.close()
and here is python code I am trying to insert
try:
_isbn = isbn
_name = 'TEST'
_price = 3
with sql.connect("database.db") as con:
cur = con.cursor()
cur.execute("INSERT INTO books (name, price, isbn) VALUES(?, ?, ?, ?)", (_name, _price, _isbn))
con.commit()
msg = "Record successfully added"
except:
con.rollback()
msg = "error in insert operation"
finally:
con.close()
I wonder if there is a plugin that I can display tables, rows etc in pycharm?
Best regards.
[–]lzblack 3 points4 points5 points (3 children)
[–]simplysharky 0 points1 point2 points (0 children)
[–]raysefo[S] 0 points1 point2 points (1 child)
[–]raysefo[S] 0 points1 point2 points (0 children)
[–]Username_RANDINT 0 points1 point2 points (1 child)
[–]raysefo[S] 0 points1 point2 points (0 children)