Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

382
Vistas
BigInteger with fastapi and sqlmodel

I'm using FastAPI with SQLModel which is based on pydantic, SQLAlchemy and type hints. And I'm trying to create a BitInteger (int64 is enough) column. How do I do that?

My sql model declaration looks like that

class ItemBase(sqlmodel.SQLModel):
    name: str
    price: int  


class Item(ItemBase, table=True):
    id: int = sqlmodel.Field(default=None, primary_key=True)


class ItemCreate(ItemBase):
    pass

Thanks in advance!

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

From the issue documenting how to make BigIntegers work with SQLModel:

id: int = Field(default_factory=next_val, sa_column=Column(BigInteger(), primary_key=True, autoincrement=False))

You might need to adjust it slightly for your usage, but using a specific sqlalchemy column type seems to be the way.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda