[sqlalchemy] Re: PickleType too small

2007-01-24 Thread milena

I have tried simple examples with PickleType and modified MyPickle (as
suggested) and it works just fine. But, when I try it my segment of
code, where I read row in a simple way and than put it in another
structure, it didn't wanted to work (like unpickling wasn't working at
all). So I did explicit pickling and unpickling of my data and
everything works now.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: PickleType too small

2007-01-22 Thread milena

Now that I have succeeded to write in my Pickle type into a database I
have another problem. When I read it from the database how do I convert
it to my original data (since I get pickle-file-like data after reading
a row)?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: PickleType too small

2007-01-21 Thread milena

I have tried adding max_allowed_packet=16M to my.ini under [mysqld] but
it didn't work.
As far as I have seen BLOB type is used when mapping PickleType to
MySQL. I would like to use LONGBLOB, so I did:
class MyPickle(PickleType):
impl = mysql.MSLongBlob

and Column('data',MyPickle())

in a table specification, but I got error message: AttributeError:
'module' object has no attribute 'MSLongBlob'.

Any further suggestions?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: count(*) function

2007-01-20 Thread milena

It worked. Thanks!

On Jan 15, 11:37 am, Marco Mariani [EMAIL PROTECTED] wrote:
 milenawrote:

  I have tried

  select([func.count(*)], from_obj=[table_name]).execute()

  but it didn't workI suppore you're not using mappers, so this is the 
  fastest method:

 number_of_rows = table.count().execute().fetchone()[0]
 
 where table is the table object


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] PickleType too small

2007-01-20 Thread milena

Hi,

I am having trouble with PickleType used as column type
(Column('data',MyPickle)). I want to store a dictionary data type into
a database (mySQL), but the dictionary is to big. Can anyone tell me
how to enlarge PickleType so that it can hold up all my data.

Thanks in advance!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] count(*) function

2007-01-15 Thread milena


Hi,

does anyone know the syntax of

SELECT COUNT(*) FROM table_name;

for SQLAlchemy? Is there a list of functions (used in SELECT statement)
that exist in SQL that I can use in SQLAlchemy? btw, I am using MySQL.

I need to see if my table is empty (isemty function doesn't work).

Thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---