Ok, since I’m using an enum it’s practically impossible to insert invalid data
anyways. Thanks a lot.
> Am 05.01.2017 um 15:47 schrieb mike bayer :
>
> the enum type should be doing that check client side at this point, which is
> usually good enough. I would not
the enum type should be doing that check client side at this point,
which is usually good enough. I would not have done the CHECK
constraint feature of enum/boolean by default if it were today it has
caused enormous problems.
On 01/05/2017 09:01 AM, Tim-Christian Mundt wrote:
That works,
That works, thanks.
There is no (easy) way to CHECK the elements of the array?
> Am 05.01.2017 um 14:53 schrieb mike bayer :
>
> you probably want to add create_constraint=False, see if that works
>
>
you probably want to add create_constraint=False, see if that works
http://docs.sqlalchemy.org/en/latest/core/type_basics.html?highlight=enum#sqlalchemy.types.Enum.params.create_constraint
On 01/05/2017 01:34 AM, Tim-Christian Mundt wrote:
Hi,
I've been using an array of enums with postgres
Hi,
I've been using an array of enums with postgres and SQLAlchemy successfully
over the past year like so:
class MyModel(BaseModel):
enum_field = Column(postgresql.ARRAY(EnumField(MyEnum, native_enum=False)))
The EnumField is from the sqlalchemy_enum34