Glorp Changes
I feel sure somehow that
I had written about some of the moderately recent changes in Glorp,
but someone asked me about it, and I can't seem to find anything.
So here's a very high level description of the possibly interesting
changes from 0.3.138 to the present, in no particular order.
- Support for proxy actions. You can give a proxy a block that it will execute when it's instantiated.
- Some APIs are simplified. For example, read: instead of returningManyOf:. Or you no longer need to implement constructAllClasses, it'll figure out from the descriptor methods if they're there.
- GlorpActiveRecord - the ability to have automatic mappings for things that are relatively simple, and to gracefully scale up when they get more complicated. I talked about this in my user conference presentation, and the code is in the public repository.
- The ability to have expressions in mappings. This means that you could make a direct mapping that didn't go to a field, but to a function of a field. Or to a subselect. Such mappings would likely have to be read-only, but this is still very valuable.
- Support for a variety of trickier mappings in general, including a number of improvements for situations when the primary keys aren't themselves mapped, but are used as part of a relationship mapping.
- Better support for generated values of different types, generalizing from just generated primary keys or optimistic locking versions to allowing things like timestamps for last modification and more complex generated values.
- Support for reading database metdata using INFORMATION SCHEMA. This lets us avoid putting in the tables ourselves for the GlorpActiveRecord above. Currently works only for Oracle and Postgresql, though it should be fairly easy to adapt. Done in a nicely recursive way. We have descriptors that map from Glorp's objects to the INFORMATION SCHEMA tables.
- Glorp now properly handles the case where you delete and re-insert the same object in the same unit of work.
- Added the ability to have exclusive relationships. These will delete the target of the relationship when the source is deleted or the reference to the target goes away.
- Added some tools (in the GlorpAnalysis package) for performance analysis, keeping track of which sorts of queries were executed, and how long they took.
- A lot of improvements to the dictionary mapping. It still doesn't do everything desirable, but, and here is the essential point, it is better than it was.
- A DirectToManyMapping for collections of simple types.
- A variety of additional functions and things you can do in expressions. This includes the ability to use includes:, select:, intersect:, count:where:, copyFrom:to: to generate substring expressions,.
- The ability to specify an encoding and have it used for reading/writing string data.
- Efficient queries for horizontal inheritance, reading all of the subclasses in one (really messy) query. See here
- Basic support for groupBy:
- A lot of fixups related to types, validation and better error messages, generation of values, performance, and others, too small to mention.