Tagged Questions
24
votes
3answers
3k views
How can I profile a SQLAlchemy powered application?
Does anyone have experience profiling a Python/SQLAlchemy app? And what are the best way to find bottlenecks and design flaws?
We have a Python application where the database layer is handled by ...
24
votes
3answers
4k views
Does SQLAlchemy have an equivalent of Django's get_or_create?
I want to get an object from the database if it already exists (based on provided parameters) or create it if it does not.
Django's get_or_create does this. Is there an equivalent shortcut in ...
9
votes
7answers
5k views
Sqlite / SQLAlchemy: how to enforce Foreign Keys?
The new version of SQLite has the ability to enforce Foreign Key constraints, but for the sake of backwards-compatibility, you have to turn it on for each database connection separately!
sqlite> ...
1
vote
4answers
628 views
How to disable SQLAlchemy caching?
I meet a cache problem when I use sqlalchemy. I use sqlalchemy insert a data into mysql database. I have the other application process this data then update this data directly. But my sqlalchemy ...
16
votes
4answers
7k views
SQLAlchemy and django, is it production ready?
Has anyone used SQLAlchemy in addition to Django's ORM?
I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins).
Is it ...
10
votes
2answers
3k views
Why is SQLAlchemy insert with sqlite 25 times slower than using sqlite3 directly?
Why is this simple test case inserting 100,000 rows 25 times slower with SQLAlchemy than it is using the sqlite3 driver directly? I have seen similar slowdowns in real-world applications. Am I doing ...
5
votes
3answers
1k views
Complex foreign key constraint in SQLAlchemy
I have two tables, SystemVariables and VariableOptions. SystemVariables should be self-explanatory, and VariableOptions contains all of the possible choices for all of the variables.
VariableOptions ...
4
votes
2answers
2k views
group by year, month, day in a sqlalchemy
I want "DBSession.query(Article).group_by(Article.created.month).all()"
But this query can't using
How do I do this using SQLAlchemy?
28
votes
4answers
20k views
Efficiently updating database using SQLAlchemy ORM
I'm starting a new application and looking at using an ORM -- in particular, SQLAlchemy.
Say I've got a column 'foo' in my database and I want to increment it. In straight sqlite, this is easy:
db ...
17
votes
2answers
5k views
I need a sample of python unit testing sqlalchemy model with nose
Can someone show me how to write unit tests for sqlalchemy model I created using nose.
I just need one simple example.
Thanks.
14
votes
2answers
3k views
memory-efficient built-in SqlAlchemy iterator/generator?
I have a ~10M record MySQL table that I interface with using SqlAlchemy. I have found that queries on large subsets of this table will consume too much memory even though I thought I was using a ...
8
votes
3answers
4k views
Scanning huge tables with SQLAlchemy using the ORM
I am currently playing around with SQLAlchemy a bit, which is really quite neat.
For testing I created a huge table containing my pictures archive, indexed by SHA1 hashes (to remove duplicates :-)). ...
13
votes
1answer
744 views
How to integrate SQLAlchemy and a subclassed Numpy.ndarray smoothly and in a pythonic way?
I would like to store numpy-arrays with annotations (like name) via SQLAlchemy within a relational database. To do so,
I seperate the numpy array from its data via an data transfere object ...
19
votes
3answers
4k views
Twisted + SQLAlchemy and the best way to do it
So I'm writing yet another Twisted based daemon. It'll have an xmlrpc interface as usual so I can easily communicate with it and have other processes interchange data with it as needed.
This daemon ...
11
votes
1answer
889 views
Multiple domains and subdomains on a single Pyramid instance
I'm looking to have multiple domains and subdomains on a single Pyramid instance. However, I can't seem to find any documentation on it. The last question referred to a glossary with very little ...