TortugaResearch / Tortuga.Chain

A fluent ORM for .NET
Other
335 stars 22 forks source link

Default Sorting for WithLimits #440

Closed Grauenwolf closed 2 years ago

Grauenwolf commented 2 years ago

If you use WithLimits without a sort order, then it will act non-deterministically. This is because the database could sort the results in any random order if not constrained.

The fix is to default to sorting with primary key when using WithLimits. If there are no primary keys and no explicit sorting, then an exception should be thrown.

Make sure to update the documentation to note this.