Re: [sqlalchemy] Efficient dev workflow for keeping test database in sync with dev database?

2015-01-08 Thread AM
db and run migrations against it. HTH AM On 1/8/15 2:50 PM, alchemy1 wrote: On Postgres, I run tests against a database which require that the tables already exist. The table definitions in the test db need to be identical to the table definitions in the dev db (in the test db they should

Re: [sqlalchemy] Re: can someone tell me how to reset Alembic back to the state of my DB

2014-12-30 Thread AM
Blow away the alembic versions table from the database and the folder with the versions file and patches files on disk and you should be good to go. HTH AM On 12/30/2014 06:01 PM, dewey wrote: Ok, I went ahead and just copied all the data into the clean new schema. So now my actual DB

Re: [sqlalchemy] Is my DB schema optimal?

2014-12-24 Thread AM
. In a large percentage of the cases, for the loads that are demanded of db backed applications, IME one almost never needs to change the original schema. What would help more is to focus on the 'kind' of queries you are going to have and make sure you index the appropriate fields. HTH AM On 12/24

Re: [sqlalchemy] Handling big Python objects

2014-12-03 Thread AM
I would recommend just storing them on disk and let the OS VMM deal with caching for speed. If you are not constrained for space I would recommend not zlib-ing it either. AM On 12/3/14 1:18 PM, Andrea Gavana wrote: Hello list, sorry for the possibly noob question, I've googled around

Re: [sqlalchemy] Handling big Python objects

2014-12-03 Thread AM
if this is OK. To use compression or not depends on your needs. If the difference in time consumed is so stark, I would highly recommend compression. HTH AM Thank you again for your interest. Andrea. -- You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] hybrid_properties and literals

2014-06-19 Thread AM
Hi. I am having some trouble understanding how to use native python data types with hybrid properties. I have the following model. I am using flask-sqlalchemy however I run into the same issue in straight sqlalchemy too. class SystemModel(BaseModel): __tablename__ = 'system

Re: [sqlalchemy] hybrid_properties and literals

2014-06-19 Thread AM
On 06/19/2014 06:13 AM, Mike Bayer wrote: On 6/19/14, 2:05 AM, AM wrote: Hi. I am having some trouble understanding how to use native python data types with hybrid properties. I have the following model. I am using flask-sqlalchemy however I run into the same issue in straight sqlalchemy too

Re: [sqlalchemy] hybrid_properties and literals

2014-06-19 Thread AM
On 06/19/2014 10:24 AM, Mike Bayer wrote: On 6/19/14, 1:05 PM, AM wrote: What I am storing is things like string versions of lists, tuples and dicts, for e.g.: str([1, 2, 3]) str({'a':1} and so on. ast.literal_eval will only parse those and return those, it does not evaluate expressions

Re: [sqlalchemy] metadata.create_all with postgres 9.3.3 on AWS RDS

2014-06-09 Thread AM
On 06/09/2014 03:30 PM, Michael Bayer wrote: On Jun 9, 2014, at 4:32 PM, AM ams@gmail.com wrote: Hi all. In my app I have a bootstrap method that calls: metadata.create_all(checkfirst) against a postgres RDS instance. The tables already exist however the query emitted seems

Re: [sqlalchemy] Advice for Method to consistently import XML into SQLAlchemy

2014-05-15 Thread AM
On 05/14/2014 04:23 AM, Sayth Renshaw wrote: Hi Looking for some guidance and advice on using xml as an update source for my to be data web project. If I am consistently going to be updating data into the database from XML files what is a good method? Should I be creating a Sax parser

Re: [sqlalchemy] a [probably] stupid query question

2014-03-19 Thread AM
HTH AM -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com

Re: [sqlalchemy] a [probably] stupid query question

2014-03-19 Thread AM
On 03/19/2014 04:44 PM, Richard Gerd Kuesters wrote: thanks AM! i know that a join have the same effect (that's why i already told it's probably stupid question), but i was wondering if the select ... from tbl1, tbl2 is possible using SA. that's all :) cheers, richard. Em 2014-03-19 20

Re: [sqlalchemy] Database locker error with sqlite in multi-process environment

2013-12-19 Thread AM
On 12/19/2013 01:39 PM, Michael Bayer wrote: SQLite doesn’t work great for concurrent access. Or is the database file just stuck in a locked state? try copying it to a different file. On Dec 19, 2013, at 12:51 AM, AM ams@gmail.com wrote: PS: The only thing I can think

[sqlalchemy] Database locker error with sqlite in multi-process environment

2013-12-18 Thread AM
piece of code. When the application tries to insert a record in the database I get the following error: OperationalError: (OperationalError) database is locked I am fairly certain I had this working previously quite some time back but for the life of me cannot remember how. Any help would

[sqlalchemy] Re: Database locker error with sqlite in multi-process environment

2013-12-18 Thread AM
PS: The only thing I can think of that is not quite usual is that I have a save method on my models and that calls flush() on the session object. and the session is created using: DB = scoped_session(sessionmaker(extension=ZopeTransactionExtension())) Thanks. AM On 12/18/2013 09:35 PM

Re: [sqlalchemy] Re: keyword search

2013-12-17 Thread AM
up the index. Take a look at whoosh-alchemy https://pypi.python.org/pypi/WhooshAlchemy which might make things easier. HTH AM On 12/17/2013 02:03 AM, lars van gemerden wrote: PS: a search over all fields would be great too! On Tuesday, December 17, 2013 11:01:51 AM UTC+1, lars van gemerden

Re: [sqlalchemy] [wishlist] ORM/engine Feature Request - comment()

2013-11-18 Thread AM
On 11/18/2013 04:06 PM, Jonathan Vanasco wrote: Something that I realized would be very useful, is to enable comments on query compilation. That would make it SO much easier to understand logs. Yes this sounds slightly silly. Yes I am 100% serious. I've been working all day on optimizing

Re: [sqlalchemy] Code organization with declarative models

2013-08-12 Thread AM
as I am concerned they are not aware of any 'business' logic and only deal with CRUD operations and perhaps complex CRUD if the need arises. I usually have another abstraction which is generally a factory that delegates db tasks to the model and deals with all business logicky stuff, sessions

Re: [sqlalchemy] Adding properties of wrapped object to association proxy

2013-08-05 Thread AM
Exactly what I was looking for! Thanks a ton, I did not realize I could actually do that and went spelunking down hybrid properties. Thanks again. AM On 08/04/2013 07:34 AM, Michael Bayer wrote: you want to flatten the scalar attributes to combine the namespace of OrgModel and OrgMemberModel

Re: [sqlalchemy] Adding properties of wrapped object to association proxy

2013-08-04 Thread AM
On 08/03/2013 09:38 AM, Michael Bayer wrote: On Aug 2, 2013, at 2:32 PM, Ams Fwd ams@gmail.com wrote: Hi All. Is there any way to transparently add the properties of the associated object to the association proxy? For e.g. if I have the following setup class UserModel(Base): name

Re: [sqlalchemy] Bulk creation of columns

2011-09-21 Thread AM
On Sep 21, 2011, at 6:30 AM, pravin battula wrote: Hi, How can i create columns in bulk? I tried as below but doesn't work. migrate_engine = create_engine('mysql://root:root@localhost/ payroll', echo=False) metadata = MetaData(bind = migrate_engine) metadata.reflect(bind