jeremyevans/sequel
64.3
Adequate · 26 September 2026
67.3k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
This system is the Sequel ORM library, a Ruby-based tool for interacting with relational databases through a modular architecture of adapters, datasets, and models. It provides comprehensive database connectivity for various systems including PostgreSQL, MySQL, SQL Server, and DB2, featuring robust connection pooling, schema migration management, and association handling. The library also includes a command-line interface for database administration and a suite of extensions for validation and performance optimization.
How it got here
2007 — Core infrastructure and adapter expansion
10 changes.
This period focused on establishing the foundational architecture of the Sequel library, including the introduction of the Model subsystem, association handling, and a new command-line interface. Significant effort was directed toward expanding database connectivity by adding initial support for ADO, Amalgalite, IBMDB, and JDBC adapters, alongside restructuring the Dataset module for better maintainability. The work was complemented by comprehensive test coverage for these new components and existing adapters.
2008–2009 — Sequel 5 core refactoring and adapter expansion
14 changes.
This period focused on restructuring the Sequel core library for version 5, introducing a modular database architecture and dropping support for older Ruby versions. It also significantly expanded database compatibility by adding new adapters for Microsoft Access, ODBC subadapters, and modern drivers like Trilogy, while refactoring existing JDBC and MySQL internals for better performance and correctness.
2010–2014 — Connection pool refactoring and dependency updates
4 changes.
This period focused on a major restructuring of the connection pool subsystem to improve thread safety, performance, and support for sharded database setups. The project also updated its gemspec to require Ruby 2.0+, added comprehensive test fixtures for migration edge cases, and redesigned the website with new templates and updated documentation.
Features
Add Microsoft Access support to the ADO adapter
Introduces a new shared adapter for Microsoft Access, enabling the ADO adapter to handle schema reflection, table creation (via SELECT INTO emulation), and basic data operations. This change brings foundational support for Access databases, including handling of auto-incrementing primary keys and constraint violation detection, within the Sequel ORM.
lib/sequel/adapters/shared · high confidence
Add ODBC subadapters for DB2, Oracle, and Microsoft SQL Server
The ODBC adapter now includes dedicated subadapters for DB2, Oracle, and Microsoft SQL Server, allowing users to connect to these databases via ODBC with database-specific optimizations. The Microsoft SQL Server subadapter improves timestamp handling by using ODBC format with millisecond precision and correctly handles NULL values from SCOPE\_IDENTITY() during insert operations. The DB2 and Oracle subadapters extend the base ODBC adapter with their respective database methods and dataset behaviors.
lib/sequel/adapters/odbc · high confidence
Add accessed\_columns plugin to track model column usage
The new accessed\_columns plugin records which columns have been accessed on a model instance, allowing developers to identify unused columns and optimize SELECT queries by removing them. This helps improve performance by enabling more efficient data retrieval, though it should be used cautiously in production as it introduces a performance overhead.
lib/sequel/plugins · high confidence
Add constraint\_validations extension for database constraint enforcement
The new constraint\_validations extension allows Sequel to validate database constraints (such as foreign keys and check constraints) before applying schema changes, ensuring data integrity during migrations. It also provides a plugin for models to enforce these constraints at the application level before saving records.
lib/sequel/extensions · high confidence
Initial library structure and model loading
The library now includes a main entry point that enables the use of the model subsystem via a single require statement. This change also enforces strict string literal immutability across the codebase to improve performance and safety.
lib · high confidence
Initial release of ADO, Amalgalite, IBMDB, and JDBC adapters
This change introduces the initial implementation of four database adapters for the Sequel library: the ADO adapter for Windows-based ADO databases (including Microsoft Access and SQL Server), the Amalgalite adapter for SQLite via the Amalgalite gem, the IBMDB adapter for IBM DB2, and the JDBC adapter for connecting to databases via Java Database Connectivity on JRuby. These adapters provide the foundational connectivity layer for their respective database systems, including connection handling, type conversion, and basic dataset execution.
lib/sequel/adapters · high confidence
Introduction of Sequel::Model associations and base model infrastructure
The lib/sequel/model directory now includes the core associations module and base model class, establishing the foundation for defining and managing relationships between model classes. This change introduces the AssociationReflection class to handle association metadata and provides the initial implementation for model class methods, including dataset handling, primary key management, and plugin integration.
lib/sequel/model · high confidence
Introduction of the \`bin/sequel\` command-line interface
The \bin/sequel\ executable is now available, providing a command-line tool to interact with databases via URI or YAML configuration files. Users can run code snippets with \-c\, load models from directories with \-L\, manage migrations with \-m\ and \-M\, dump schema or migration SQL with \-d\/\-D\ and \-S\, copy databases between adapters with \-C\, and enable SQL logging to files with \-l\. The tool supports multiple loggers, respects environment-specific YAML configs, and includes options to disable connection testing (\-N\) or show full backtraces (\-t\).
bin · high confidence
New ASTTransformer and connection pool infrastructure
Sequel introduces a new ASTTransformer class to handle and modify the internal abstract syntax trees used for SQL generation, along with a new Qualifier subclass for qualifying unqualified columns. Additionally, a new base ConnectionPool class is added, establishing the foundation for connection pool management and introducing support for sharded connection pools via a configurable pool class map.
lib/sequel · high confidence
Architecture
Dataset code reorganized into modular files
The lib/sequel/dataset directory has been restructured to improve maintainability. Dataset methods are now split into dedicated files: actions.rb (execution methods like insert, delete, each), dataset\_module.rb (helper methods for extending datasets), deprecated\_singleton\_class\_methods.rb (backwards compatibility for extensions), features.rb (capability detection methods like supports\_cte?), and graph.rb (graphing and join logic). This change does not alter the public API but improves code organization and separation of concerns within the Dataset class.
lib/sequel/dataset · high confidence
Behavioural changes
Archive previous changelog and introduce new documentation structure
The previous changelog history has been moved to doc/CHANGELOG.old to clear the main changelog for current releases. Additionally, the documentation has been reorganized into a new structure, introducing dedicated guides for association basics, advanced associations, dataset filtering, and code ordering, alongside updates to the bin/sequel usage guide and cheat sheet.
doc · high confidence
Improved ADO adapter support for Access and MSSQL
The ADO adapter for Access now supports returning auto-incremented primary keys on insert, lists views, and handles compound foreign key relationships. For MSSQL, the adapter can now return the number of rows affected by updates and deletes when an explicit provider is configured, and it supports returning the last inserted identity value. Transaction support is also enabled for MSSQL when a specific provider is used.
lib/sequel/adapters/ado · high confidence
Major refactoring of connection pool implementations
The connection pool subsystem has been significantly restructured to improve thread safety, performance, and clarity. The default threaded pool now uses a queue-based connection handling strategy by default, which reduces the chance of stale connections and improves performance on Ruby 1.9+. A new single-threaded connection pool implementation has been introduced for non-concurrent use cases, offering a lighter-weight alternative. Sharded connection pools (single, threaded, and timed queue) have been rewritten to support dynamic server addition/removal at runtime and to handle disconnections more robustly. Additionally, a new timed-queue-based connection pool is available for Ruby 3.2+, leveraging native Queue semantics for better concurrency control. These changes collectively enhance reliability in multi-threaded environments and provide more flexible configuration options for sharded database setups.
_lib/sequel/connection\pool · high confidence
Refactored JDBC adapter subadapters to use shared code and modernized type handling
The JDBC adapter subadapters (DB2, Derby, H2, HSQLDB, MySQL, Oracle, PostgreSQL, SQL Anywhere, SQLite, SQL Server, and JTDS) have been refactored to share common transaction logic and type conversion patterns. CLOB columns are now treated as strings instead of blobs across most databases, and type conversion performance has been significantly improved. The adapters now support prepared transactions, savepoints, and better handling of specific database quirks like H2 version 2+ and PostgreSQL array types.
lib/sequel/adapters/jdbc · high confidence
Refactored offset emulation and MySQL prepared statement handling into shared utility modules
The offset emulation logic for databases lacking native support has been reorganized into dedicated utility modules (EmulateOffsetWithReverseAndCount and EmulateOffsetWithRowNumber) to improve correctness and maintainability, including fixes for empty? checks and explicit ordering. Additionally, MySQL and MySQL2 adapter internals have been split into separate utility files (MysqlMysql2 and MysqlPreparedStatements) to better handle prepared statement reuse and disconnect error recognition, while other utilities like Replace and SplitAlterTable are introduced to support specific database features and schema migration robustness.
lib/sequel/adapters/utils · high confidence
Sequel 5 core refactoring: new modular Database structure and adapter additions
The Sequel core library has been restructured for version 5, moving the \Sequel::Database\ implementation into a modular layout under \lib/sequel/database/\ (e.g., \connecting.rb\, \dataset.rb\, \features.rb\, \logging.rb\, \misc.rb\, \query.rb\, \schema\_generator.rb\). This refactoring introduces several behavioral changes: CLOB columns are now treated as strings instead of blobs, and datasets are frozen by default. New adapters have been added for Trilogy, TinyTDS, CUBRID, and FoundationDB SQL Layer, while support for Ruby 1.8.7 and older adapters (DB2, DBI, Firebird, Informix) has been dropped. The transaction API has been enhanced with \:rollback=\>:always\ and \:retry\_on\ options, and schema parsing now includes \:max\_length\ for strings and \:min\_value\/\:max\_value\ for integers and decimals.
lib/sequel/database · high confidence
Website redesign with new layout and build scripts
The Sequel website has been redesigned with a new HTML layout template (layout.html.erb) featuring a modern navigation bar, integrated site-specific search, and a comprehensive footer. To support this new structure, new Ruby build scripts (make\_www.rb and make\_guides.rb) have been added to generate static pages from ERB templates and format RDoc guides, ensuring consistent styling and relative link handling across the documentation.
www · high confidence
Website redesign with new page templates and updated content
The website has been redesigned, introducing new \.html.erb\ templates for the front page, documentation, development, links, and plugins pages. This update includes a fresh layout for the plugins page with a sidebar navigation, adds a new Development page directing users to GitHub Discussions for support, and updates the documentation index to reflect current guides and release notes. The front page now features an updated code example and lists the Trilogy adapter alongside existing database support.
www/pages · high confidence
Website visual redesign and new assets
The public website has been redesigned with a new visual style, introducing a cohesive CSS architecture in \www/public/css/application.css\ that defines design tokens (such as \--ivory\, \--graphite\, and \--red-primary\) and responsive layout rules for the header, navigation, and main content areas. This new theme is applied across specific site sections via dedicated stylesheets (\index.css\, \documentation.css\, \guide.css\, \plugins.css\, \links.css\, \development.css\), featuring updated typography, card-based layouts with shadows, and responsive grid systems. The update also includes new static assets, specifically a monocrome and a colored version of the Sequel logo (\ruby-sequel-monocrome.svg\, \ruby-sequel.svg\) and a transparent background pattern (\transparent-background.svg\) used for asset listings.
www/public · high confidence
Test coverage
Add comprehensive test suite for bin/sequel and core extensions; Add connection pool specs; Add integration test suite for Sequel against real databases; Added adapter specs for DB2 and MSSQL; Added test fixtures for migration edge cases and unused associations plugin; Extensive test suite updates for plugins and extensions; Refactored model specs into separate files to mirror lib/sequel/model structure.
Dependencies
Sequel ORM version bump to 5.107.0
The Sequel ORM library has been updated to version 5.107.0. This release includes numerous bug fixes, performance optimizations, and new features across various adapters and plugins, such as support for PostgreSQL 19+ features, improved handling of frozen datasets, and updates to the schema dumper and migration tools.
(repo-wide) · high confidence
Sequel gemspec restructured with new dependencies and metadata
The Sequel gem specification has been updated to require Ruby 2.0 or higher and now explicitly lists 'bigdecimal' as a runtime dependency. Development dependencies have been added for testing and tooling, including minitest (version 5.7.0 or higher), minitest-hooks, minitest-global\_expectations, tzinfo, activemodel, and nokogiri. The gem also now includes project metadata such as bug tracker and documentation URIs, and the license file has been renamed to MIT-LICENSE.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 40 → 64 (+24.5)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 93 → 88 (-4.6)
- Architecture 94 → 88 (-6.6)
- Maturity 33 → 64 (+30.9)
- Readiness 20 → 57 (+37.2)
- Security 71 → 80 (+8.7)
- Accessibility 69 (new)
Resolved (15)
- Coverage not measured — test suite did not build
- Dimension evaluation failed
- Duplicated block (10 lines × 2) (lib/sequel/plugins/association_multi_add_remove.rb)
- Duplicated block (7 lines × 2) (lib/sequel/plugins/rcte_tree.rb)
- Duplicated block (8 lines × 2) (lib/sequel/plugins/pg_array_associations.rb)
- Duplicated block (9 lines × 2) (lib/sequel/plugins/rcte_tree.rb)
- High: security finding (details withheld)
- High: security finding (details withheld)
- LLM evaluation failed
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- No exposed public API
- No tests found
- Test reliability not included
New (264)
- ASTTransformer.v (cognitive 17) (lib/sequel/ast_transformer.rb)
- ASTTransformer.v (cyclomatic 29) (lib/sequel/ast_transformer.rb)
- AssociationReflection.eager_load_results (cognitive 43) (lib/sequel/model/associations.rb)
- AssociationReflection.eager_load_results (cyclomatic 25) (lib/sequel/model/associations.rb)
- AutoParameterizeDuplicateQueryDetection.detect_duplicate_queries (cognitive 17) (lib/sequel/extensions/pg_auto_parameterize_duplicate_query_detection.rb)
- AutoParameterizeInArray._bound_variable_type_for_array (cognitive 16) (lib/sequel/extensions/pg_auto_parameterize_in_array.rb)
- AutoParameterizeInArray._bound_variable_type_for_array (cyclomatic 16) (lib/sequel/extensions/pg_auto_parameterize_in_array.rb)
- CachedDatasetMethods.as_hash (cognitive 21) (lib/sequel/plugins/subset_static_cache.rb)
- CachedDatasetMethods.to_hash_groups (cognitive 16) (lib/sequel/plugins/subset_static_cache.rb)
- ClassMethods._check_pk_lookup_value (cognitive 36) (lib/sequel/plugins/primary_key_lookup_check_values.rb)
- ClassMethods._check_pk_lookup_value (cyclomatic 21) (lib/sequel/plugins/primary_key_lookup_check_values.rb)
- ClassMethods.as_hash (cognitive 21) (lib/sequel/plugins/static_cache.rb)
- ClassMethods.associate (cognitive 31) (lib/sequel/model/associations.rb)
- ClassMethods.associate (cyclomatic 31) (lib/sequel/model/associations.rb)
- ClassMethods.composition (cognitive 22) (lib/sequel/plugins/composition.rb)
- ClassMethods.connection_pool_class (cognitive 24) (lib/sequel/connection_pool.rb)
- ClassMethods.constraint_validation_array (cyclomatic 21) (lib/sequel/plugins/constraint_validations.rb)
- ClassMethods.def_many_through_many (cognitive 56) (lib/sequel/plugins/many_through_many.rb)
- ClassMethods.def_many_through_many (cyclomatic 34) (lib/sequel/plugins/many_through_many.rb)
- ClassMethods.def_many_to_many (cognitive 23) (lib/sequel/plugins/association_pks.rb)
- …and 244 more
Changes since last survey
- 64 commits — 59 feature/other, 5 fixes
By area
- (root) — 32 commits
- lib/sequel — 20 commits
- spec/extensions — 3 commits
- doc/opening_databases.rdoc — 2 commits
- .github/workflows — 1 commit
- doc/mass_assignment.rdoc — 1 commit
- doc/postgresql.rdoc — 1 commit
- spec/adapters — 1 commit
- spec/core — 1 commit
- spec/integration — 1 commit
- www/layout.html.erb — 1 commit
Notable commits
- fix: Fix JRUBY_VERSION checks to handle JRuby 10+
- fix: Make create_table with :temp and :as options create temporary table on Microsoft SQL Server (Fixes #2393)
- fix: Revert PostgreSQL UPDATE/DELETE FOR PORTION OF support
- fix: Revert the PostgreSQL property graph support
- fix: Update CHANGELOG for GROUP BY ALL revert
- change: Add :port to Sequel.connect general options doc
- change: Add more SEQUEL6 notes
- change: Add ndims, position, positions, prepend, sample, shuffle, and trim to pg_array_ops extension
- change: Add select_on_skipped_update plugin for running SELECT query to check for object existance if an UPDATE statement is skipped
- change: Add spec for cache_key in caching plugin with partial composite primary key
- change: Add validate_associated_context plugin
- change: Allow a few more natural join types
- change: Allow the caching plugin to support composite primary keys where multiple columns can contain "," by adding composite_cache_key class method
- change: Avoid verbose warnings in validate_associated_context spec
- change: Bump version to 5.108.0
- change: Change the optimistic prevent lock column increase to a plugin option or keyword argument
- change: Clear instance filters if Model#save_changes skips update due to the object being unmodified
- change: Clear parameters after prepared statement execution in jdbc and sqlite adapters
- change: Convert database exception class to Sequel exception class for failures in Database#copy_table query
- change: Correctly parse offset of timestamptz value in jdbc/postgresql adapter
- …and 44 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
jeremyevans/sequel was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 26 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 3acf523e8accb7a745e364b4db3bb51b172162b3 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-7c1cb6328e11.