Re: [sqlalchemy] Is ARRAY supported in MySQL?

2017-10-20 Thread Mike Bayer
On Fri, Oct 20, 2017 at 1:35 PM, sqlalchemy_mysql  wrote:
> That's correct. MySQL doesn't support. I see people workaround by
> serializing it to string/text and store and retrieve so was wondering
> SQLAlchemy has some support like that. Seems like NO.

You use a TypeDecorator for that kind of thing:

http://docs.sqlalchemy.org/en/latest/core/custom_types.html?highlight=typedecorator#typedecorator-recipes




>
>
> On Friday, October 20, 2017 at 10:25:33 AM UTC-7, Mike Bayer wrote:
>>
>> On Thu, Oct 19, 2017 at 6:38 PM, sqlalchemy_mysql 
>> wrote:
>> > Sorry I don't see any references in doc. I tried using array type but
>> > got
>> > this error
>> >
>> > can't render element of type 
>> >
>> > Compiler > > 0x110949e90> can't render element of type > > 'sqlalchemy.sql.sqltypes.ARRAY'>
>> >
>> > Here is my column defintion
>> >
>> > sqla.Column(sqla_types.ARRAY(sqla_types.String), default=[],
>> > nullable=False)
>>
>> to my knowledge, MySQL has no ARRAY datatype available so this would
>> not work (a google search just now also doesn't turn up anything new).
>> If either MySQL or MariaDB implements ARRAY, SQLAlchemy's dialect
>> would require enhancements in order for this to be supported.
>>
>>
>> >
>> > --
>> > SQLAlchemy -
>> > The Python SQL Toolkit and Object Relational Mapper
>> >
>> > http://www.sqlalchemy.org/
>> >
>> > To post example code, please provide an MCVE: Minimal, Complete, and
>> > Verifiable Example. See http://stackoverflow.com/help/mcve for a full
>> > description.
>> > ---
>> > 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+...@googlegroups.com.
>> > To post to this group, send email to sqlal...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/sqlalchemy.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> 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.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Is ARRAY supported in MySQL?

2017-10-20 Thread sqlalchemy_mysql
That's correct. MySQL doesn't support. I see people workaround by 
serializing it to string/text and store and retrieve so was wondering 
SQLAlchemy has some support like that. Seems like NO.


On Friday, October 20, 2017 at 10:25:33 AM UTC-7, Mike Bayer wrote:
>
> On Thu, Oct 19, 2017 at 6:38 PM, sqlalchemy_mysql  > wrote: 
> > Sorry I don't see any references in doc. I tried using array type but 
> got 
> > this error 
> > 
> > can't render element of type  
> > 
> > Compiler  > 0x110949e90> can't render element of type  > 'sqlalchemy.sql.sqltypes.ARRAY'> 
> > 
> > Here is my column defintion 
> > 
> > sqla.Column(sqla_types.ARRAY(sqla_types.String), default=[], 
> nullable=False) 
>
> to my knowledge, MySQL has no ARRAY datatype available so this would 
> not work (a google search just now also doesn't turn up anything new). 
> If either MySQL or MariaDB implements ARRAY, SQLAlchemy's dialect 
> would require enhancements in order for this to be supported. 
>
>
> > 
> > -- 
> > SQLAlchemy - 
> > The Python SQL Toolkit and Object Relational Mapper 
> > 
> > http://www.sqlalchemy.org/ 
> > 
> > To post example code, please provide an MCVE: Minimal, Complete, and 
> > Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> > description. 
> > --- 
> > 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+...@googlegroups.com . 
> > To post to this group, send email to sqlal...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sqlalchemy. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Is ARRAY supported in MySQL?

2017-10-20 Thread Mike Bayer
On Thu, Oct 19, 2017 at 6:38 PM, sqlalchemy_mysql  wrote:
> Sorry I don't see any references in doc. I tried using array type but got
> this error
>
> can't render element of type 
>
> Compiler  0x110949e90> can't render element of type  'sqlalchemy.sql.sqltypes.ARRAY'>
>
> Here is my column defintion
>
> sqla.Column(sqla_types.ARRAY(sqla_types.String), default=[], nullable=False)

to my knowledge, MySQL has no ARRAY datatype available so this would
not work (a google search just now also doesn't turn up anything new).
If either MySQL or MariaDB implements ARRAY, SQLAlchemy's dialect
would require enhancements in order for this to be supported.


>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> 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.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] Is ARRAY supported in MySQL?

2017-10-19 Thread sqlalchemy_mysql
Sorry I don't see any references in doc. I tried using array type but got 
this error 

can't render element of type 

Compiler  can't render element of type 

Here is my column defintion

sqla.Column(sqla_types.ARRAY(sqla_types.String), default=[], nullable=False)

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.