mindplay-dk / sql

Database framework and query builder
Other
18 stars 6 forks source link

introduce support for Indexers #34

Closed mindplay-dk closed 7 years ago

mindplay-dk commented 7 years ago

This does not work well, and did not simplify the client-code, at all.

Should an indexer run before or after Mappers are applied?

If we run the indexer before Mappers, the type-conversions won't have been applied to the rows - you end up with raw SQL values.

If we run the indexer after the Mappers, other Mappers may have turned the rows into objects, and the array type-hint in the Indexer::index() method will fail.

Either way, this did not help simplifying client-code - in fact, it just made things more complicated and not very easy to understand.

Closing for now.

mindplay-dk commented 5 years ago

Support for yield $key => $value in now in master - it's the idiomatic way to solve this.