Py学习  »  pycharm

如何使用pycharm查看SQLite数据库中的哪些数据?[关闭]

Ken • 5 年前 • 1063 次点击  

我是Python的初学者,现在我使用flask和sqlacalchemy创建简单的数据库,如下所示:

..import all the stuff here

Base = declarative_base()


class Restaurant(Base):
    __tablename__ = 'restaurant'

    id = Column(Integer, primary_key=True)
    name = Column(String(250), nullable=False)


class MenuItem(Base):
    __tablename__ = 'menu_item'
    name = Column(String(250), nullable=False)
    id = Column(Integer, primary_key=True)
    description = Column(String(250))
    price = Column(String(8))
    course = Column(String(250))
    restaurant_id = Column(Integer, ForeignKey("restaurant.id"))
    restaurant = relationship(Restaurant)

engine = create_engine('sqlite:///restaurant.db')
Base.metadata.create_all(engine)

我来自php和mysql背景,所以我的问题是:

我正在使用Pycharm IDE。我听说Pycharm有一个内置的功能来检查数据库。如何在pycharm中查看数据库的内容,以便可以直观地检查数据库的内容,而不是在控制台中运行查询?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/30790
 
1063 次点击  
文章 [ 1 ]  |  最新文章 5 年前
Joran Beasley
Reply   •   1 楼
Joran Beasley    5 年前

5张图片中的一个故事,显然不算作文本,但实际上价值1000字。

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here