typhon-project / typhonql

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

Insertion of data in document database entities #30

Closed benatspo closed 4 years ago

benatspo commented 4 years ago

Hi,

When inserting data in a database entity (a collection in the mongo DB), there is no check for attributes names. Actually, it is possible to insert data, with different attributes names than the ones defined in the ML schema. It is not problematic for the insertion, but it will be problematic, when selecting those data (because the mapping is not possible between those data, and the ML schema attributes)

Thank you for your help

benatspo commented 4 years ago

The same problem when inserting values for a relation. For example, the 2 following queries are working (relationToOrder is the name of the real relation): insert User {id: 1, relationToOrder:#uuid} insert User {id: 1, whatEverTheNameOfTheRelation:#uuid}

If the user inserts a user with a different attribute, or relation name, the data will then be incoherent comparing to the ML schema, and select queries won't work anymore.

pinoval commented 4 years ago

We are aware of this issue. For now there is no semantic check whatsoever on the queries. The TyphonQL type checker -not yet implemented- will check the queries against the ML schema in order to prevent this kind of undefined behaviors.