Skip to content

Instantly share code, notes, and snippets.

@NadiaaOliverr
Created February 20, 2025 22:09
Show Gist options
  • Select an option

  • Save NadiaaOliverr/39d42c91ffd2981b80651ec416ed5a1b to your computer and use it in GitHub Desktop.

Select an option

Save NadiaaOliverr/39d42c91ffd2981b80651ec416ed5a1b to your computer and use it in GitHub Desktop.
Gist para o artigo de SQLAlchemy em Python
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