[sqlalchemy] Re: join on array column

2020-05-08 Thread Brian Rayburn
oo actually I think I found my solution. Was specifically looking for way 
to do this in ORM relationship. Think I found my solution in the Custom 
Operators based on SQL function section of 
https://docs.sqlalchemy.org/en/13/orm/join_conditions.html

On Thursday, May 7, 2020 at 4:12:40 PM UTC-4, Brian Rayburn wrote:
>
> Hey all,
>
> In postgresql you can do this:
> ```
> SELECT t.*FROM unnest(ARRAY[1,2,3,2,3,5]) item_idLEFT JOIN items t on 
> t.id=item_id
> ```
>
> Is there support for this sort of join on an array of id's in sqlalchemy?
>
> Best wishes,
> Brian
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/789f8031-a736-44b8-9103-eb977e57ea1d%40googlegroups.com.


[sqlalchemy] join on array column

2020-05-07 Thread Brian Rayburn


Hey all,

In postgresql you can do this:
```
SELECT t.*FROM unnest(ARRAY[1,2,3,2,3,5]) item_idLEFT JOIN items t on 
t.id=item_id
```

Is there support for this sort of join on an array of id's in sqlalchemy?

Best wishes,
Brian

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/0935b393-0508-4299-ab39-375531daa545%40googlegroups.com.