What do you mean by a model? If you are talking about an instance of a
mapped class, you could try something like this (untested):
def model_to_dict(instance):
model_dict = {}
for propname in instance.mapper.props:
model_dict[propname] = getattr(instance, propname)
return
Hi,
How can I place some initialization code for each connection in the pool?
Currently I do something like this:
engine.execute(SET collation_connection=utf8_general_ci)
engine.execute(SET names utf8)
engine.execute(SET character_set_client=utf8)
engine.execute(SET
Hi,
The mssql database does not provide a Time or a Date type, but
only datetime and smalldatetime.
In SQLAlchemy, the smalldatetime is used to implement the generic type
Date, but the Time type is not implemented.
Is there a particular reason for that ? could it inherit the DateTime
type, with
Hi Christophe,
No particular reason, just no-one has needed it yet, and the unit tests
don't cover it.
If you want to have a go at a patch, that'd be great. Otherwise I'll
take a look at this in the next few days.
Paul
Christophe de VIENNE wrote:
Hi,
The mssql database does not provide a
Hi,
I am migrating an Access database to MSSQL server. I have coded up basic
Access support for SQLAlchemy, which I'll be commiting to the 0.4 branch
shortly.
Using autocode, I now have a set of SQLAlchemy table definitions. My
question is: what's a good way to move all the data across?
Hi Paul,
Thanks, I will give it a try. Stay tuned :-)
Christophe
2007/7/24, Paul Johnston [EMAIL PROTECTED]:
Hi Christophe,
No particular reason, just no-one has needed it yet, and the unit tests
don't cover it.
If you want to have a go at a patch, that'd be great. Otherwise I'll
take
Hi,
Is there any special condition for the unittests to run on mssql ?
A few... you really need to be running on Windows and using PyODBC. And
then append ?text_as_varchar=1 to your DBURI.
Looking at your command line, it looks like you're running from Unix.
You can use PyMSSQL from Unix,
2007/7/24, Paul Johnston [EMAIL PROTECTED]:
Hi,
Is there any special condition for the unittests to run on mssql ?
A few... you really need to be running on Windows and using PyODBC. And
then append ?text_as_varchar=1 to your DBURI.
I'll try that :-)
Looking at your command line, it
Hi,
I'm in the same process, and very interested in the answer !
One idea I had is to define an universal dump format, (based for
example on pytables), which could be used to backup and restore datas
from/to various databases.
If this way is a good one and a good implementation proposed, it
Hey,
I believe there is a common approach to the situation, but I just dont
know it.
Let say, I have some tables created in the DB using SQLAlchemy. Then I
modify Python code, which describes the table (add a column, remove
another column,...). What is the common way to handle this situation?
I
On Tuesday 24 July 2007 16:22:43 Anton V. Belyaev wrote:
Hey,
I believe there is a common approach to the situation, but I just
dont know it.
Let say, I have some tables created in the DB using SQLAlchemy.
Then I modify Python code, which describes the table (add a column,
remove another
I need to do a cumulative select on postgres, and I got it to work
with some extreme SQL query, but I was wondering if it could be done
more easily without having to drop to SQL but with SQLAlchemy
statements.
Let's say I have a table with stock transactions like this:
Transaction
id
On Tue, 24 Jul 2007 15:14:52 +0200
Christophe de VIENNE [EMAIL PROTECTED] wrote:
Hi,
I'm in the same process, and very interested in the answer !
One idea I had is to define an universal dump format, (based for
example on pytables), which could be used to backup and restore datas
On 24 июл, 17:34, svilen [EMAIL PROTECTED] wrote:
On Tuesday 24 July 2007 16:22:43 Anton V. Belyaev wrote:
Hey,
I believe there is a common approach to the situation, but I just
dont know it.
Let say, I have some tables created in the DB using SQLAlchemy.
Then I modify Python
On Jul 24, 2007, at 9:59 AM, Anton V. Belyaev wrote:
Of course db modification is hard. It cant be done completely
automatically. For now I would like SQLAlchemy just to signal somehow
when its definitions are different from already existing db tables.
When I do create_all() it checks
theres multiple levels of issues with this.
one is, its not very clean to move objects between databases using
sessions. to do so, you have to remove the _instance_key of the
object and save it into the other session:
f = Foo()
sess1.save(f)
sess1.flush()
sess1.expunge(f)
del
On Tuesday 24 July 2007 17:30:27 Michael Bayer wrote:
such a feature would make usage of table reflection, and then a
comparison operation, along the lines of :
...
assert t.compare(t2)
yes i was hoping for such method (:-)
And the best will be if it can produce a list/ hierarchy of
Hi
2007/7/24, michael [EMAIL PROTECTED]:
On Tue, 24 Jul 2007 15:14:52 +0200
Christophe de VIENNE [EMAIL PROTECTED] wrote:
Hi,
I'm in the same process, and very interested in the answer !
One idea I had is to define an universal dump format, (based for
example on pytables),
On Jul 24, 2007, at 11:07 AM, svilen wrote:
On Tuesday 24 July 2007 17:30:27 Michael Bayer wrote:
such a feature would make usage of table reflection, and then a
comparison operation, along the lines of :
...
assert t.compare(t2)
yes i was hoping for such method (:-)
And the best
On Jul 24, 2007, at 12:09 PM, alex.schenkman wrote:
class Session(object):
def __init__(self, name):
self.db = create_engine( 'sqlite:///%s' % name )
self.db.echo = False
self.metadata = BoundMetaData(self.db)
self.session = create_session()
On Tue, 24 Jul 2007 17:52:55 +0200
Christophe de VIENNE [EMAIL PROTECTED] wrote:
Hi
2007/7/24, michael [EMAIL PROTECTED]:
On Tue, 24 Jul 2007 15:14:52 +0200
Christophe de VIENNE [EMAIL PROTECTED] wrote:
Hi,
I'm in the same process, and very interested in the answer !
assert t.compare(t2)
yes i was hoping for such method (:-)
And the best will be if it can produce a list/ hierarchy of
differences, which then programaticaly can be iterated - and
checked and resolved or raised higher.
but why not just use autoload=True across the board in the
I had to put one little trick in here to make the subquery -
something work, which is something i should look into; otherwise it
went straight in.
from sqlalchemy import *
transaction = table('transaction',
column('id'),
column('id_product'),
column('price'),
And again you made my day...
On Jul 24, 7:17 pm, Michael Bayer [EMAIL PROTECTED] wrote:
I had to put one little trick in here to make the subquery -
something work, which is something i should look into; otherwise it
went straight in.
from sqlalchemy import *
transaction =
The list is useful only for a hacker on the MSSQL module, not for general
users, but FWIW, I've added it to
http://www.sqlalchemy.org/trac/wiki/DatabaseNotes
I generally try to respond directly to help encourage anyone willing to
offer a hand on the MSSQL module, as I don't have the time these
On Tuesday 24 July 2007 23:29:52 Rick Morrison wrote:
The list is useful only for a hacker on the MSSQL module, not for
general users, but FWIW, I've added it to
http://www.sqlalchemy.org/trac/wiki/DatabaseNotes
thanks
I generally try to respond directly to help encourage anyone
willing to
26 matches
Mail list logo