Questions tagged [sqlalchemy]
SQLAlchemy is a Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.
I'm trying to connect mariadb using create_engine of sqlalchemy.
When I made connection like below, I sometimes got error that is "2006, MySQL server gone away".
from sqlalchemy import ...
__tablename__ = "Parent"
parent_id = Column(Integer, primary_key=True)
complete = Column(Boolean)
children = relationship("Child", ...
How do I find out if there are any row where field matches sha1 hash of SALT + string in PostgreSQL using SQLAlchemy
I'm having trouble with multiple join paths.
So I'm using Flask with
and sqlalchemy versioned_history https://docs.sqlalchemy.org/en/14/orm/examples.html#module-...
I have the following tables.
CREATE TABLE transformer (
id_transformer TEXT PRIMARY KEY,
/* MEASUREMENTS */
CREATE TABLE oil_quality (
New to Python, SQLAlchemy and alembic.
Been trying to define a mixin:
__abstract__ = True
col_mixin_1 = ...
col_mixin_2 = ...
Then, define a common base class:
I'm using Alembic autogenerate to migrate some model changes. I run alembic revision/upgrade once and it properly creates my table and adds an alembic_version table to my database. When I go ...
I am working on a short project that deals with simple MySQL-python functions and came with an error. Using sqlalchemy, I have tried connecting MySQL and python but an error keeps popping up.
I have tried passing it as a list of User objects and turning the list into json and passing it ...
I have two models:
class Room(Base, SerializerMixin):
__tablename__ = "rooms"
id = Column(String, primary_key=True)
last_updated = Column(Integer)
participants = ...
I'm using SQLAlchemy and SQLite for a standalone application (non-web) and I need to store numerical ranges in a database. I'm doing this by saving the start and end of each range in SQLite ...
Im working with 3 tables but failing when working with my third one, surf spot images. Im thinking it could be that Im missing a relationship?
The tables are:
towns: which have many surf spots,
I'd like to return the top ten score from the database but I get an empty list [,] in return instead.
from app.base.models import User, Description
CRUD application to add,show,delete records. I know the error is id = db.Column(db.Integer, primary_key = True).
If i change that to id = db.Column('student_id',db.Integer, primary_key = True) then ...
There's an issue with from sqlalchemy.orm import relationship, when I try to run my app with that import, ModuleNotFoundError is raised and it says No module named 'sqlalchemy'.
But when I delete the ...