社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  pycharm

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

Ken • 6 年前 • 1917 次点击  

我是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
 
1917 次点击  
文章 [ 1 ]  |  最新文章 6 年前