This adds a Sequel::Dataset#to_dot method. The to_dot method returns a string that can be processed by graphviz's dot program in order to get a visualization of the dataset. Basically, it shows a version of the dataset's abstract syntax tree. Idea stolen from Aaron Patterson's similar method in ARel 2.
…3 Sequel plugin
This is based on the sequel_tree plugin originally part of sequel_plus. It provides similar features to rcte_tree, but works on databases that don't support recursive common table expressions. Additionally, it offers features not previously supported by rcte_tree, such as tree roots and siblings. rcte_tree now loads the tree plugin, so you have all of the advantages of the tree plugin when using rcte_tree. Because of ruby's method lookup process, a separate module is used for the rcte_tree methods, as when they were loaded in the standard way, the tree plugin instance methods overrode the rcte_plugin association methods.
sequel_orderable was based on ActiveRecord's acts_as_list, and the list plugin offers similar features of finding other items in the list and modifying the position of items in the list, which requires shifting the position of other items in the list.
…s to/from XML This is similar to the JsonSerializer plugin committed a few days ago, but for XML instead of JSON. See the plugin RDoc for details.
This uses the json library to convert Sequel::Model objects to JSON. See the module documentation for JsonSerializer for usage.
…n_pks= methods for *_to_many associations These methods allow you to get the primary keys for all associated objects, and to modify which objects are associated by passing an array of keys to the setter. The setter will add entries from the array that are not already associated, and remove already associated entries that are not in the array. This is a fairly low level plugin that operates at the dataset level and does not instantiate model objects. This is faster but it means that callbacks will not be called. Also, this only works with single primary keys, not composite primary keys.
…ey of a model object This plugin just caches a copy of the primary key values when the object is loaded from the database, and uses the cached copy until after the object is saved, so that if you modify the primary key value, it will use the previous value in the UPDATE WHERE clause, and the new value in the SET clause. This causes a substantial performance hit when loading model objects, though the model load time is is generally small compared to time spent in the lower levels of the stack.
… model objects
… to model attributes
…tions and Schema Modification guide
The sharding plugin makes Sequel::Model objects work well with Sequel's sharding support. It allows you to create objects on specific shards. It remembers which shard you used to retrieve an object, and saves it back to that shard. It also works with associations, so associated objects and association modification methods only deal with the same shard as the main object.