Sequel::Model Plugins for v3.47.0
Sequel::Model has a standardized and very flexible plugin architecture, see the RDoc. Here is a list of plugins that members of the Sequel community have developed:
Plugins that ship with Sequel
- active_model: Makes Sequel::Model objects compliant to the ActiveModel::Lint specs, so they should work correctly in Rails 3.
- association_autoreloading: Automatically clears the association cache for many_to_one associations when the related foreign key value is modified.
- association_dependencies: Allows easy deleting, destroying, or nullifying associated objects when destroying a model object.
- association_pks: Adds the association_pks and association_pks= to *_to_many associations.
- association_proxies: Changes the *_to_many association method to return a proxy instead of an array of objects.
- auto_validations: Automatically add presence, not_string, and unique validations.
- boolean_readers: Adds attribute? methods for all boolean columns.
- caching: Supports caching primary key lookups of model objects to any object that supports the Ruby-Memcache API.
- class_table_inheritance: Supports inheritance in the database by using a single database table for each class in a class hierarchy.
- composition: Supports defining getters/setters for objects with data backed by the model's columns.
- constraint_validations: Setup automatic validations for constraints added via the constraint_validations extension.
- dataset_associations: Adds association methods to datasets that return datasets of associated objects.
- dirty: Allows you get get initial values of columns after changing the values.
- defaults_setter: Set default values when initializing models.
- eager_each: Makes each on an eagerly loaded dataset do eager loading.
- error_splitter: Splits multi-column errors entries into separate errors, one per column.
- force_encoding: Forces the all model column string values to a given encoding.
- hook_class_methods: Adds backwards compatiblity for the legacy class-level hook methods (e.g. before_save :do_something).
- identity_map: Allows you to create temporary identity maps which ensure a 1-1 correspondence of model objects to database rows.
- input_transformer: Automatically transform input to model column setters.
- instance_filters: Allows you to add per instance filters that are used when updating or destroying the instance.
- instance_hooks: Allows you to add hooks to specific model instances.
- json_serializer: Allows you to serialize/deserialize model objects to/from JSON.
- lazy_attributes: Allows you to set some attributes that should not be loaded by default, but only loaded when an object requests them.
- list: Allows you to treat model objects as being part of a list, so you can move them up/down and get next/previous entries.
- many_through_many: Allows you to create an association to multiple objects through multiple join tables.
- many_to_one_pk_lookup: Uses optimized simple primary key lookups for most many_to_one associations (great if associated class uses caching).
- nested_attributes: Allows you to modified associated objects directly through a model object, similar to ActiveRecord's Nested Attributes.
- optimistic_locking: Adds a database-independent locking mechanism to models to prevent concurrent updates overwriting changes.
- pg_row: Allows Sequel::Model classes to implement PostgreSQL row-valued/composite types.
- pg_typecast_on_load: Handles typecasting of PostgreSQL array/hstore/composite types when loading model objects via jdbc, do, or swift adapters.
- prepared_statements: Makes models use prepared statements for deletes, inserts, updates, and lookups by primary key.
- prepared_statements_associations: Makes models use prepared statements for regular loading of associations.
- prepared_statements_safe: Makes use of prepared_statements plugin more safe by setting explicit defaults for model columns when inserting and saving whole rows instead of changed columns.
- prepared_statements_with_pk: Makes model datasets's #with_pk method use prepared statements.
- rcte_tree: Supports retrieving all ancestors and descendants for tree structured data using recursive common table expressions.
- schema: Adds backwards compatibility for Model.set_schema and Model.create_table.
- serialization: Supports serializing column values and storing them as either marshal, yaml, or json in the database.
- serialization_modification_detection: Allows you to detect changes to serialized columns.
- sharding: Allows model objects work well with Sequel's sharding support.
- single_table_inheritance: Supports inheritance in the database by using a single table for all classes in a class hierarchy.
- skip_create_refresh: Allows you to skip the refresh when saving new model objects.
- static_cache: Caches all model instances, improving performance for static models.
- string_stripper: Strips strings assigned to model attributes.
- subclasses: Allows easy access all model subclasses and descendent classes, without using ObjectSpace.
- tactical_eager_loading: Allows you to eagerly load an association for all objects retreived from the same dataset when calling the association method on any of the objects in the dataset.
- timestamps: Creates hooks for automatically setting create and update timestamps.
- touch: Allows easily updating timestamps via Model#touch, as well as touching associations when model instances are updated or destroyed.
- tree: Allows you to treat model objects as being part of a tree, finding ancestors, descendants, siblings, and tree roots.
- typecast_on_load: Fixes bad database typecasting when loading model objects.
- unlimited_update: Works around MySQL warnings when using replication due to LIMIT clause use when updating model instances.
- update_primary_key: Allows you to safely update the primary key of a model object.
- validation_class_methods: Adds backwards compatibility for the legacy class-level validation methods (e.g. validates_presence_of :column).
- validation_helpers: The preferred default validations plugin, which uses instance-level methods.
- xml_serializer: Allows you to serialize/deserialize model objects to/from XML.
External Plugins
- forme: HTML forms library for ruby that integrates with Sequel::Model for easy form creation.
- sequel_bulk_attributes: Provides bulk assignment functionality for one_to_many associations.
- sequel-bit_fields: Allows treating an integer column as a bitfield of many boolean settings.
- sequel_container: Contained documents (i.e. attachments) for models.
- sequel_crushyform: Builds forms for you
- sequel_mappable: Provides geocoding functionality to model & dataset.
- sequel_nested_set: Nested set implementation, ported from the Awesome Nested Set Active Record plugin.
- sequel_notnaughty: Port of the NotNaughty validation framework.
- sequel_paperclip: Provides attachment functionality for models, including post processing (thumbnail generation, etc).
- sequel_polymorphic: Lets you easily create polymorphic associations.
- sequel_proc_error_handling: Lets you add procs that automatically rescue and fix model errors.
- sequel_sexy_validations: Provides sexy validations (like those in rails 3) for models.
- sequel_simple_callbacks: Enables ActiveRecord-compatible class-level before and after filter declarations for models with support for conditional execution.
- sequel_sluggable: Easy slug behaviour for any model.
- sequel_taggable: Allows easily adding tags to any model.
- sequel_validation_helpers_block: Allows easy determination of which validation rules apply to a given column, at the expense of increased verbosity.
Sequel Extensions
Extensions are modifications or additions to Sequel that affect core Sequel, not just Sequel::Model.
Extensions that ship with Sequel
- arbitrary_servers: Adds ability to connection to arbitrary servers (instead of just preconfigured ones) in the sharding support.
- blank: Adds blank? instance methods to all objects.
- core_extensions: Extends the Array, Hash, String, and Symbol classes with methods that return Sequel expression objects (loaded by default).
- core_refinements: Adds refinement versions of Sequel's core extensions.
- columns_introspection: Attemps to skip database queries by introspecting the selected columns if possible.
- connection_validator: Automatically validates connections on pool checkout and handles disconnections transparently.
- constraint_validations: Creates database constraints when creating/altering tables, with metadata for automatic model validations via the constraint_validations plugin.
- date_arithmetic: Allows for database-independent date calculations (adding/subtracting an interval to/from a date/timestamp).
- eval_inspect: Makes inspect on Sequel's expression objects attempt to return a string suitable for eval.
- inflector: Adds instance-level inflection methods to String.
- looser_typecasting: Uses .to_f and .to_i instead of Kernel.Float and Kernel.Integer when typecasting floats and integers.
- meta_def: Adds meta_def method for defining methods to Database, Dataset, and Model classes and instances.
- migration: Adds Migration and Migrator classes for easily migrating the database schema forward or reverting to a previous version.
- named_timezones: Allows you to use named timezones instead of just :local and :utc (requires TZInfo).
- null_dataset: Adds Dataset#nullify to get a dataset that will never issue a query.
- pagination: Adds Dataset#paginate for easier pagination of datasets.
- pretty_table: Adds Dataset#print for printing a dataset as a simple plain-text table.
- query: Adds Dataset#query for a different interface to creating queries that doesn't use method chaining.
- query_literals: Automatically uses literal strings for regular strings in select, group, and order methods (similar to filter methods).
- pg_array: Adds support for string and numeric PostgreSQL arrays.
- pg_array_ops: Adds DSL support for calling PostgreSQL array operators and functions.
- pg_auto_parameterize: Automatically parameterizes queries when using the postgres adapter with the pg driver.
- pg_hstore: Adds support for the PostgreSQL hstore type.
- pg_hstore_ops: Adds DSL support for calling PostgreSQL hstore operators and functions.
- pg_inet: Adds support for the PostgreSQL inet and cidr types.
- pg_interval: Adds support for the PostgreSQL interval type.
- pg_json: Adds support for the PostgreSQL json type.
- pg_range: Adds support for PostgreSQL range types.
- pg_range_ops: Adds DSL support for calling PostgreSQL range operators and functions.
- pg_row: Adds support for PostgreSQL row-valued/composite types.
- pg_row_ops: Adds DSL support for dealing with PostgreSQL row-valued/composite types.
- pg_statement_cache: Automatically uses prepared statements for most queries when using postgres adapter with the pg driver.
- schema_caching: Speeds up loading a large number of models by caching database schema and loading it from a file.
- schema_dumper: Adds Database#dump_schema_migration and related methods for dumping the schema of the database as a migration that can be restored on other databases.
- select_remove: Adds Dataset#select_remove to remove selected columns from a dataset.
- server_block: Adds Database#with_server method that makes access inside the passed block use the specified shard by default.
- split_array_nil: Splits nils out of IN/NOT IN arrays into separate OR IS NULL or AND IS NOT NULL clauses.
- sql_expr: Adds sql_expr method to all objects, allowing easy use of Sequel's DSL.
- string_date_time: Adds instance methods to String for converting the string into a Date/Time/DateTime.
- thread_local_timezones: Allows for per-thread overrides of the global timezone settings.
- to_dot: Adds Dataset#to_dot method, which returns a string suitable for processing by graphviz's dot program to get a visualization of the dataset's abstract syntax tree.
External Extensions
- fixture_dependencies: YAML fixture loader that handles dependencies/associated objects, respecting foreign key constraints.
- i18n_backend_sequel: Allows Sequel to be a backend for i18n translations.
- merb_sequel: Merb plugin that provides support for Sequel models.
- rails_sequel: Rails 2 plugin that allows you to use Sequel instead of ActiveRecord.
- rspec_sequel_matchers: RSpec matchers for Sequel validations, associations, and columns.
- sequel_extjs: Generates JSON from datasets that is consumable by the ExtJS JsonStore.
- sequel-location: Easy setup and syntax for doing geolocation search on PostgreSQL.
- sequel_pg: Faster SELECTs when using Sequel with pg.
- sequel_plus: Collection of sequel extensions.
- sequel_postgresql_triggers: Database enforced timestamps, immutable columns, and counter/sum caches.
- sequel-rails: Rails 3 plugin that allows you to use Sequel instead of ActiveRecord.
- sequel_rails3: Another Rails 3 plugin that allows you to use Sequel instead of ActiveRecord.
- sequel_vectorized: Allows Sequel::Dataset to be exported as an Hash of Arrays and NArrays.
Submitting Your Plugin/Extension
If you have created a Sequel plugin/extension and would like to list it here, please submit a request to code AT jeremyevans DOT net, or send a pull request via github.
