All Questions
228 questions
4
votes
0
answers
379
views
SqlAlchemy extending an existing query with additional select columns from raw sql
I'm quite new to SQLAlchemy and Python, and have to fix some bugs in a legacy environment so please bear with me..
Environment:
Python 2.7.18
Bottle: 0.12.7
SQLAlchemy: 1.3.24
MySQL: 5.7
Scenario: I ...
0
votes
0
answers
122
views
Why SQLAlchemy ignore timezone while filtering?
Hi I have an issue with filtering datetime field in SQLAlchemy. My local time is GMT -4 and I need to get all records for today (but according to UTC time)
Here is my code:
start_time = datetime.now()
...
0
votes
0
answers
426
views
ImportError: cannot import name DefaultEngineStrategy
I'm trying to run a python game source I made, but everytime I do "python Login.py" I get this whole traceback:
Traceback (most recent call last):
File "Login.py", line 1, in <...
1
vote
1
answer
796
views
Get primary key of inserted row after session.execute has run in python
I have a MS SQL table called reports with following structure. I want to get the row_id of the row that was just inserted:
r_id int NOT NULL IDENTITY,
report_type int,
report_source varchar,
...
0
votes
1
answer
338
views
How to run a script when ever there is a new entry in database using SQLalchemy in python?
I am new to SQL Alchemy and need a way to run a script whenever a new entry is added to a table. I am currently using the following method to get the task done but I am sure there has to be a more ...
0
votes
0
answers
398
views
CKAN-Datapusher HTTP500 error due to "Error - <class 'sqlalchemy.exc.TimeoutError'>: QueuePool size 5 overflow 10 reached, connection timedout" out"
I'm using CKAN v2.7.2(docker). And getting "Error - <class 'sqlalchemy.exc.TimeoutError'>: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30" error due to ...
0
votes
0
answers
537
views
I get ImportError: No module named pyodbc when I try to connect to the sybase database
I am trying to connect to the sybase database using sqlalchemy. I am doing my development in Linux environment. I am also using python 2.7
I have the following code in which I am just trying to ...
3
votes
1
answer
1k
views
How to increment multiple rows using SqlAlchemy
How to update multiple records with incrementing some field (in my case id)?
I missed one record and the whole table shifted.
How to do that in one transaction or one query? Or what is the fastest way ...
0
votes
2
answers
4k
views
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: mytable
I build a dashboard to track my orders, revenue etc. I created a database that includes all related data. I download a Flask dashboard template and editing it. I can collect all my order data and use ...
1
vote
0
answers
435
views
SQLAlchemy keeps the DB connection open
I have an issue with in my Flask app concerning SQLAlchemy and MySQL.
In one of my file: connection.py I have a function that creates a DB connection and set it as a global variable:
db = None
def ...
0
votes
1
answer
630
views
Print compiled sqlalchemy query
Is there a way I can print a query created by sqlalchemy
emp = session.query(Employee).filter(*empfilters).order_by(Employee.Name).all()
I've tried doing str(emp), emp.statement.compile(dialect=...
0
votes
2
answers
1k
views
Python - Postgres query using sqlalchemy returns "Empty Dataframe"
I try to query some data from a postgres database and add the results into an excel with the below Python code (I am connecting to the server through ssh tunnel and connecting to database using ...
1
vote
0
answers
319
views
Apache Airflow : airflow initdb command throws = (_mysql_exceptions.OperationalError) (1292, "Incorrect datetime value:)
I was following this article for installing Apache-airflow with mysql DB on Ubuntu.
Apache Airflow with MYSQL
File "/usr/local/bin/airflow", line 37, in <module>
args.func(args)
File "/...
0
votes
1
answer
153
views
search data based on date in sqlalchemy
i have a column(scheduledStartDateTime) in database which is of type datetime and i have to search previous row of data based on user entered datetime .
my query is like this:
order = self....
3
votes
0
answers
926
views
Delete multiple records with composite key in sqlalchemy [duplicate]
I have a table with a composite primary key.
ReportsTable:
id1,id2,data,...
I want to delete multiple rows based on the composite key list.
Eg. [(1,0),(1,1),(2,0),(3,0),(3,1),(3,2),(3,3)]
How to ...