Tagged Questions
6
votes
4answers
4k views
MySQL server has gone away - Disconnect handling via checkout event handler doesn't work
Update 3/4:
I've done some testing and proved that using checkout event handler to check disconnects works with Elixir. Beginning to think my problem has something to do with calling session.commit() ...
5
votes
1answer
545 views
How can I inform sqlalchemy to raise an error whenever MySQL throws a warning?
I want to modify sqlalchemy settings to raise an exception on warnings.
For example, when I insert a larger amount of data in a field than the defined column length, mysql will truncate the data, ...
3
votes
2answers
728 views
mysql_config not found when installing mysqldb python interface for mariadb 10 Ubuntu 13.10
After I installed Mariadb 10 the Mysql workbench and JPDB client both connect and work fine so next step was get programming with Python (using SQLAlchemy) which seems to require MySQL-python so I ...
2
votes
1answer
2k views
SQL Alchemy performance if used only for raw sql?
I intend to use very simple raw SQL in a Django project.
example:
SELECT name,doc_id,doc_content,creation_date from doc_table where uid = 'xxx' limit 1 ;
Primary requirements:
Ease of doing SQL ...
2
votes
1answer
1k views
Sqlalchemy.exc.UnboundExecutionError: Could not locate a bind configured on mapper Mapper|SellsTable|sellers or this Session
I create a class for working with SQLAlchemy :
class DbAbsLayer(object):
def __init__(self):
self.setConnectionURI();
def setConnectionURI(self):
self.dbDriver = "mysql";
...
2
votes
0answers
168 views
Create link or change python-mysql socket location [duplicate]
While testing SQLalchemy in Python I came over a similar problem to what I earlier also had experienced. This time, however, I could not easily add the mysql-socket path to the MySQLdb connection ...
1
vote
2answers
2k views
UnicodeEncodeError:'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)
i am a newer in python.Today when I write some search function I met an error.well, I use sqlalchemy orm to do that, in my function,I input a chinese word as the key word.The html page give me an ...
1
vote
1answer
306 views
Unable to store datetime.datetime.max using SQLAlchemy==0.8.1 with the mysql-python==1.2.4 driver
I've noticed a change in behavior for storing datetime.datetime.max via SQLAlchemy==SQLAlchemy==0.8.1 and going from mysql-python==1.2.3 to mysql-python==1.2.4. By only changing the driver from 1.2.3 ...
1
vote
1answer
263 views
SELECT UNCOMPRESS(text) FROM with sqlalchemy
I store the MySQL Compress function to insert compressed blob data to the database.
In a previous question I was instructed to to use
func.compress
( mysql Compress() with sqlalchemy )
The ...
1
vote
0answers
46 views
how to implement a flask sqlalchemy query using a query that is passed into a function
I'm trying to convert this mysql query into flask sqlalchemy:
SELECT * FROM (*results query*) AS someDocuments WHERE agency in (SELECT agency FROM document WHERE agency ='Comptroller');
i'm ...
1
vote
1answer
81 views
How to set client_flags of FOUND_ROWS in SQLAlchemy with mysqlconnector to return affected rows
I am trying to change the behavior of ResultProxy.rowcount attribute for SQLAlchemy.
The configuration is mysql+mysqlconnector.
I am setting connect_args = {'client_flags': [ClientFlag.FOUND_ROWS]} in ...
1
vote
0answers
288 views
ResourceClosedError with mysql, sqlalchemy and celery
I am using sqlalchemy in an app where celery tasks use a scoped session to interact with mysql.
db.py
engine = create_engine(
'mysql://root:pass@localhost/testdb?charset=utf8&use_unicode=0',
...
0
votes
1answer
106 views
SQLAlchemy Core Connection Context Manager
Can I use a context manager for SQLAlchemy Core connections? In other words, is
conn = engine.connect()
conn.execute('SELECT * FROM FOO')
conn.close()
the same as
with engine.connect() as conn:
...
0
votes
1answer
25 views
Getting a mysql thread id from sqlalchemy Session
I'm used to creating connections using MySQLdb directly so I'm not sure this is at all possible using sqlalchemy, but is there a way to get the mysql connection thread id from a mysql Session a la ...
0
votes
0answers
119 views
flask-sqlalchemy or sqlalchemy for a non-flask web application
Our web project (www.findstat.org) is based on a MoinMoin wiki (which handles the requests), is not using flask, and to which we added some macros.
Since I am not very familiar with web programming, ...
-1
votes
1answer
34 views
how to write query with joins
How I can make this query into single query? Can we use joins?
SELECT
id, parentID, name
FROM (
SELECT
GroupActivities.groupID AS "groupID",
max(GroupActivities.id) AS ...