MightyOrm / Mighty

A new, small, dynamic micro-ORM. Highly compatible with Massive, but with many essential new features.
BSD 3-Clause "New" or "Revised" License
101 stars 20 forks source link

Are composite/compound keys supported? #34

Closed seth-jacobson closed 3 years ago

seth-jacobson commented 3 years ago

If a table uses a composite or compound key, what is the syntax for the primaryKeys parameter when creating a new MightyOrm object? Does Mighty even support composite or compound keys?

mikebeaton commented 3 years ago

The IntelliSense if you hover over the primaryKeys param should be showing: Either single primary key member name, or comma separated list of names for compound PK.

Is IntelliSense working for you? I did have a problem with it not working, but I thought that was fixed a few versions ago: https://github.com/MightyOrm/Mighty/commit/66f010624fa2606d0cc43f5a748138dd583bced3

By the way, if you are using column name to member name remapping then you should put member names not column names here, as at least hinted at by the IntelliSense. If you're not using mapping these are the same so it doesn't matter.

seth-jacobson commented 3 years ago

My IntelliSense often fails - thus the source of my confusion. Thank you for the response, this is most helpful.