ActiveRecord added this support recently, and I think it's a worthwhile extension to have.
… exception for ==('') Personally, I think such an object is broken, but there exist examples of brokenness in ruby's stdlib, so it's best to support this.
…do eager loading This behavior has been requested by multiple people over the years. I've always been against changing having all call a method other than each for eager loading. I just recently thought of this approach, which doesn't require any changes to the core of Sequel.
…PostgreSQL There were multiple bugs here. The first bug is that because a mutation method was used for the join, but not for the where/select_more, the where/select_more was skipped. The second bug is that the where code used an implicit alias instead of an implicit qualifier. The third bug was that when the schema was used, an error would be raised because it would try to call the output identifier method with a qualified identifier. Fix these bugs and add a spec for the behavior.
…ent postgres code These have not been needed since 3.35.0.
Turns out that SQLite only has a setter PRAGMA for case sensitive like, not a getter PRAGMA, so the previous getter always returned false. Note that the setter method is still there, so you can still change the setting, you just can't easily check for whether the setting is enabled or not.
This method hasn't been used for some time. I think at one point, it was used by Dataset#single_value. As I don't think users should be calling it directly, it's probably best to remove it. This breaks backwards compatibility, users who need similar functionality should switch to using Dataset#single_value. While here, remove the handling of an options hash for the private defined_columns_for method in the shared adapter. This was used at one point, but hasn't been any longer. Also while here, add some specs for the case sensistive like setter.
Before, if you passed nil or false, it ignored the argument and used the block. And if you didn't provide a block, it acted like select_all. Change it to use a default argument that can tell whether an argument was provided. This could potentially affect backwards compatibility, but I think the previous behavior was broken.
…stance options The current behavior of the json_serializer plugin when the :root option is given to the class or dataset to_json method is a bit redundant, since it wraps both the collection and instances in hashes. I think changing the behavior is too risky in terms of backwards compatibility, so I added additional options so that users can pick the behavior they want. I expect most users will want :root=>:collection, and at some point in the future that will probably become the default.
While here, change the threshold to 100%, so that files with 100% coverage aren't shown. Sequel is now back to 100% code coverage for core, model, plugins, and extensions. The core/model specs don't show 100% code coverage because there are a few branches that are based on the ruby version or engine.
The MySQL bug that cause this to fail starting in 5.5.12 has been fixed starting in 5.5.23
Instead, have the mock connection execute method not log sql.
This removes the other files from the output, since they are just noise.
While here, fix the RDoc for tactical eager loading. The original implementation used the identity_map, but I'm pretty sure I made it not require the identity_map before adding it to Sequel.
This attempts to load the ActiveSupport inflector first, before the Sequel inflector, since the Sequel inflector should then override the ActiveSupport inflector. Remove the check for the ActiveSupport inflector in the inflector spec, since it should never take affect. You'll know if the ActiveSupport inflector is still in place if the inflector specs start failing.
Since 3.35.0, this method is no longer called, since all inserts use RETURNING now.
This is modeled on the pg_hstore and pg_array extensions, using the same DelegateClass approach. It does not currently support plain numbers or strings in a json column, which PostgreSQL supports. Support for that could be added later if there is demand, just be adding custom parsers and more DelegateClasses. However, I think PostgreSQL is wrong in the this case and it shouldn't be accepting those values, which is why the extension doesn't currently support it. Another reason is that typecasting from a string would then be ambiguous, since you wouldn't know whether it was literal JSON that should be parsed, or represented a plain string that should be wrapped in a DelegateClass.
…d save work correctly Before, since instance filters were only cleared after a successful save, if you rescued the error raised by save, refreshed and then saved, it would add the lock column filter twice, once with the old value and one with the new value. The simplest way to fix this is just to make refreshing clear the instance filters, since saving will add the correct one back. Note that this potentially could skip the instance filter if you refreshed your model in a before_update after the instance filter was added. I doubt anyone would do that.