Created
February 20, 2025 22:09
-
-
Save NadiaaOliverr/39d42c91ffd2981b80651ec416ed5a1b to your computer and use it in GitHub Desktop.
Gist para o artigo de SQLAlchemy em Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sqlalchemy import Column, Integer, String, Float | |
| from sqlalchemy.ext.declarative import declarative_base | |
| Base = declarative_base() | |
| class Funcionario(Base): | |
| __tablename__ = 'funcionarios' | |
| id = Column(Integer, primary_key=True) | |
| nome = Column(String, nullable=False) | |
| cargo = Column(String, nullable=False) | |
| class Pedido(Base): | |
| __tablename__ = 'pedidos' | |
| id = Column(Integer, primary_key=True) | |
| data = Column(String, nullable=False) | |
| valor_total = Column(Float, nullable=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment