[sqlalchemy] Getting default value from python object

2017-10-25 Thread sqlalchemy_mysql
I understand default value is used to emit Insert statement. Is there any way to have default value is accessible via python object. See below example >>> class User(Base): ... __tablename__ = 'users' ... id = Column(Integer, primary_key=True) ... name = Column(String) ... passwor

Re: [sqlalchemy] Is ARRAY supported in MySQL?

2017-10-20 Thread sqlalchemy_mysql
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

[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

Re: [sqlalchemy] custom type

2017-10-05 Thread sqlalchemy_mysql
Thanks Mike. It helps and solves the problem. I am still curious why process_result_value is called for rows that has null value for same objects but not for other rows. On Thursday, October 5, 2017 at 11:26:47 AM UTC-7, Mike Bayer wrote: > > On Thu, Oct 5, 2017 at 1:43 PM, sqlalchemy

Re: [sqlalchemy] custom type

2017-10-05 Thread sqlalchemy_mysql
y row has null value for the column. I hope it is expected functionality, no? If yes, is there other hook that is invoked when objects/rows are fetched from cache? On Wednesday, October 4, 2017 at 9:39:49 PM UTC-7, Mike Bayer wrote: > > On Wed, Oct 4, 2017 at 10:47 PM, sqlalchemy_mys

[sqlalchemy] custom type

2017-10-04 Thread sqlalchemy_mysql
When query with specific column loads properly and I can see 'result_processor' and/or 'process_result_value' is invoked with correct value but when query directly on Model (no explicit column is specified but all columns are queried in this case by default) invokes those methods with None valu

[sqlalchemy] Creat table with IF NOT EXISTS caulse in MySQL

2017-09-12 Thread sqlalchemy_mysql
Noticed that generated 'create table' is missing 'IF NOT EXISTS' clause so when the code is run in parallel. It throws OperationalError 1050 Table already exists. We call metadata.create_all method, checkfirst is set to True as it is default. is there any workaround or fix for this issue? --