Questions tagged [sqlalchemy]

Use this tag for the eponymous Python SQL toolkit and Object Relational Mapper.

8 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
336 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
0answers
623 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
0answers
143 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
0answers
11 views

SqlAlchemy on conflict returning id

I need to convert a PostgreSQL raw query to SQLAlchemy ORM. base = declarative_base() class table_name(base): __tablename__ = "table_name" id= Column(Integer, primary_key=True, autoincrement=...
0
votes
2answers
26 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
0answers
17 views

PostgreSQL & Pandas DF: is it possible to update a selection of data of a PostgreSQL db with a DF w/o impacting other entries?

I have a PostgreSQL database, which I interact with using SQLAlchemy in Python. The database contains daily price data (including non-working days), starting from Jan-2005; the date column is the ...
0
votes
0answers
52 views

How to “lock” a table for select

I have a table called assignments. A user will request an assignment from an API endpoint. I need to ensure that an assignment can only be handed to one user. There will be multiple users requesting ...
0
votes
1answer
239 views

Use of MySQL trigger to insert row's week number

I have a table of orders in a MariaDB database that currently has a datetime column. For the dashboard I am building for this database, I have a statistic I would like to display which is "Orders This ...