typhon-project / typhonql

Typhon Query Language
Eclipse Public License 2.0
4 stars 1 forks source link

Create a relation between entities #28

Open benatspo opened 4 years ago

benatspo commented 4 years ago

Hi,

It is actually impossible to create a relation between two entities, except if those entities are both in a document database, or if the source entity is in a document database. Actually, the only solution to create a physical relation between two entities in a relational database, is to add the relation in the ML schema, and reset the databases.

Thank you for the correction

benatspo commented 4 years ago

Here is a complete example.

1) Source model before the creation of a new relation (relation name: "user", relation cardinality: "one", relation source entity: "Address"): see "source.log" attached file.

2) Uploaded model (containing the relation in the ML model) before the creation of a new relation: see "target.log" attached file.

3) QL queries to add the corresponding relation to the corresponding entity (add "user" relation to "Address" entity): create Address.user -> User[1..1]

-> This last query returns an error. Speaking with Davy, two problems:

Thank you for your help

benatspo commented 4 years ago

source.log target.log

DavyLandman commented 4 years ago

Hi @benatspo,

Am I correct that this is a bug in our DDL implementation?

benatspo commented 4 years ago

Hi Davy,

Yes, probably. My objective is just to create a relation between two relational database entities, dynamically, using the web service, with a "/api/update" query, plus a TQL query in body. Such a query returned an error.

Speaking with you previously, it could be a problem with the creation of the join table between those entities?

Thank you

DavyLandman commented 4 years ago

I'll put it as a bug, I'll ping you when we switch to new backend, to see if that fixes it.

benatspo commented 4 years ago

Ok thanks :)

tvdstorm commented 3 years ago

@benatspo is this still an issue?