Colin-b/layabase

Allow table Joins

Opened this issue · 5 comments

Allow table Joins

SQLAlchemy allows it already, what do you need precisely? I am currently working on a branch allowing to generate a model containing more fields but you should be able to work it out with current version. What is the issue ?

When I need to write a join inside the customize_query of a table A, which looks like that

return (query.join(B, A.id==B.id).filter(B.name== "Test") )

table B should be inspected as SQLAlchemy Model

So you should be able to do it via SQLAlchemy relationships, take a look at the ongoing branch changes and you should see an example of relationship in a test case. Or you can check SQLAlchemy documentation for more details on all available options to achieve what you want

Yes that should be possible to achieve with the upcoming release. Any idea when this version will be released? Thank you

I don't think there is a blocking point for you, it will be easier to achieve if you use the provided Flask RestPlus models but you can always override them to fit your needs. As I said SQLAlchemy already provide everything you need, layabase is a layer on top to ease your querying but you should have access to everything SQLAlchemy provides. Unless you encountered an issue ?