agentm / project-m36

Project: M36 Relational Algebra Engine
The Unlicense
876 stars 47 forks source link

Add Haskell types which map statically to tuples #80

Open agentm opened 7 years ago

agentm commented 7 years ago

As a sort of ORM-lite, it would be handy to be able to push lots of db client type errors to compile time from run time. A good example of how to accomplish this is via https://github.com/Gabriel439/Haskell-Bears-Library.

However, the approach there makes several assumptions about the relational algebra which do not necessarily hold. For example, all relvars have exactly one key; this the deprecated notion of a "primary" key.

Some Template Haskell may be involved here.

agentm commented 7 years ago

I should move this issue up in priority.

3noch commented 7 years ago

This would be very handy!

matchwood commented 6 years ago

Is this effectively a suggestion for adding a typed interface? I have started working on something similar myself, probably using generics-sop. I am coming to project-m36 from the context of acid-state, where every query I made was fully type-checked at compile time, and I not willing to drop type safety in order to use project-m36.

agentm commented 6 years ago

Yes, you can see more discussion about this in #42.

I certainly understand your hesitation coming from a statically-typed interface and we are examining the options to have our own such interface with some unique features such as schema validation (using a hash of the schema) and support for nested relations (hopefully).

matchwood commented 6 years ago

Ok, I will comment #42. Schema validation (if I understand you correctly) would be awesome!