Re: [sqlalchemy] SQLAlchemy 2. psycopg3 type adapt

2022-09-11 Thread Mike Bayer
oh, I though you were asking how to use psycopg's API. If you want to use SQLAlchemy techniques, you would use TypeDecorator: https://docs.sqlalchemy.org/en/14/core/custom_types.html#augmenting-existing-types your type would look just like

Re: [sqlalchemy] SQLAlchemy 2. psycopg3 type adapt

2022-09-11 Thread sector119
Thank You, Mike, I thought that I can adapt types with sqlalchemy, not with db adapter like psycopg, to make it not db adapter dependent solution. воскресенье, 11 сентября 2022 г. в 04:14:02 UTC+3, Mike Bayer: > maybe email on the psycopg2 list / github tracker > > On Sat, Sep 10, 2022, at

Re: [sqlalchemy] SQLAlchemy 2. psycopg3 type adapt

2022-09-10 Thread Mike Bayer
maybe email on the psycopg2 list / github tracker On Sat, Sep 10, 2022, at 4:15 PM, sector119 wrote: > Hello, > > I got exception when I try to insert numpy.int8 type data. > sqlalchemy.exc.ProgrammingError: (psycopg.ProgrammingError) cannot adapt type > 'int8' using placeholder '%s' (format:

[sqlalchemy] SQLAlchemy 2. psycopg3 type adapt

2022-09-10 Thread sector119
Hello, I got exception when I try to insert numpy.int8 type data. sqlalchemy.exc.ProgrammingError: (psycopg.ProgrammingError) cannot adapt type 'int8' using placeholder '%s' (format: AUTO) I'm trying to adapt it with code below, but it looks like a bit comprehensive. Maybe you can suggest