Questions tagged [sqlalchemy]
Use this tag for the eponymous Python SQL toolkit and Object Relational Mapper.
16
questions with no upvoted or accepted answers
3
votes
0
answers
1k
views
SELECT query blocking writes in postgresql
We have a web application that sends emails with a queue worker. Before an email is sent we write to a table:
INSERT INTO user_email (user_id, email_key, sent_at) VALUES (
175413579283955991,
...
1
vote
0
answers
2k
views
SQL connection error in python webapp: "pandas.io.sql.DatabaseError: Execution failed on sql"
I have built a Webapp with python flask, that reads and writes to SQL tables.
Typically in the morning, I receive an error regarding SQL query execution that looks like this (see logs snippet below). ...
1
vote
0
answers
4k
views
UUID default value on PSQL
I'm creating my database tables inside a flask application via SQLAlchemy.
According to this answer, my code should look like this:
id = db.Column(db.CHAR(36), primary_key=True, server_default=str("...
1
vote
0
answers
415
views
Multiple many-to-many database relations
SO told me to ask here, so this is just copy-pasted from over there
We're making a database of anime. Every anime can be listed as having been made by an arbitrary number of studios, and every studio ...
0
votes
0
answers
16
views
One to one Modeling?
What do you guys think of this model?
Catalog -< Catalog Items | - | Products
and
Catalog -< Catalog Items | - | Services
That is, a Catalog Item, can be one and only one type: Product or ...
0
votes
0
answers
131
views
Too many connections issue with postgres and multiprocessing
I am trying to read and write to a db in the following way:
with open("argument_file.txt", "r") as f:
arguments = f.read().split("\n")
engine = create_engine('...
0
votes
0
answers
250
views
Sudden momentary dips in aws rds free storage space available
I have been experiencing some sudden momentary dips in the available aws rds free storage space available. Once the free space dips it goes into the storage optimization mode.
I have a postgres table ...
0
votes
0
answers
148
views
Unable to connect to sql server on Ubuntu after MySQLAlchemy connection
Context:
I have installed mysql-server on Ubuntu and was able to setup password for root account and also created a few accounts with all privileges. I was able to connect to any user or the root user ...
0
votes
0
answers
97
views
Is there a cross join in these CTEs?
I have a query that is constructed from several CTEs (in order to organize the query). I constructed it in my SQL workbench and was happy with the test results on a smaller dataset, so I converted it ...
0
votes
1
answer
168
views
Using Indexing When Performing JOINs on Part of a Composite Key
I have a table in my database (hosted on MariaDB) that looks like this (I have given the definition in SQLAlchemy),
class Address(Base):
__tablename__ = 'address'
__table_args__ = {'schema': DB_NAME}
...
0
votes
0
answers
170
views
Python / AWS RDS - 300 insert statements taking 10 minutes to complete
I'm using Python 3.7 with SQLAlchemy on Ubuntu 18.04. I have two MySQL Databases - a local instance hosted on bare metal and an Amazon RDS instance. Both are accessible from MySQL Workbench on my ...
0
votes
2
answers
1k
views
SQLAlchemy: table version already exists. pgAdmin4 fails on Linux Mint 20 and 20.1
I already found the solution, I just want to share it in case someone has the same problem.
Situation
Install pgAdmin4 version 4.30 on Linux Mint 20 (Ulyana) and Linux Mint 20.1 (Ulyssa) inside ...
0
votes
0
answers
616
views
Migrating from MariaDB to Mysql - Duplicate Constraint Name
I am attempting to migrate from MariaDB to MySQL by doing a mysqldump from MariaDB and then restoring it to MySQL (mysql:latest docker container).
I am getting the following error when importing into ...
0
votes
1
answer
482
views
Ram consumed by single query in Postgres using SqlAlchemy
I have a list of 36 queries ranging from low complexity(No joins) to high complexity(joins with subquery). I want to find the RAM Consumed by each query.
This is required for performance testing for ...
0
votes
2
answers
132
views
Database design question: Tags with values(duration) linked to them
I am creating a database that takes in daily inputs such as:
Date
Events in that date (e.g. project foo: 5 hours, bar: 2 hours, etc...)
Rating of the date
There's more but these are probably the ...
0
votes
1
answer
2k
views
I get the error "(psycopg2.OperationalError) FATAL: role "wsb" does not exist", but the user does exits
I am trying connect to my postgress database using SQLAlchemy. I was working fine yesterday (01/27/22). Now I get the following error:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) ...