Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump sequel from 5.85.0 to 5.86.0 #683

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 4, 2024

Bumps sequel from 5.85.0 to 5.86.0.

Changelog

Sourced from sequel's changelog.

=== 5.86.0 (2024-11-01)

  • Support the :disable_dqs Database option in the sqlite adapter to disable treating double quoted values as strings (jeremyevans) (#2233)

  • Have the subset_conditions plugin support where_all and where_any methods to combine existing subsets with AND or OR (jeremyevans)

  • Have the subset_conditions plugin add *_conditions methods for exclude method calls in addition to where and subset (jeremyevans)

  • Use Ruby module naming instead of Java package naming for access to Java libraries in the jdbc adapters (kalenp) (#2235, #2236)

  • Make schema_dumper extension format options similar to Hash#inspect on Ruby 3.4+ (jeremyevans)

  • Avoid deprecation warnings on Ruby 3.4.0-preview2 (jeremyevans)

  • Handle FROM tables that are SQL::DelayedEvaluation instances when trying to get primary key values after INSERT on PostgreSQL (tomasmiguez) (#2230, #2232)

Commits
  • 865d985 Bump version to 5.86.0
  • 8e5a8a9 Support the :disable_dqs Database option in the sqlite adapter to disable tre...
  • fe99976 Have the subset_conditions plugin support where_all and where_any methods to ...
  • e566408 Update CHANGELOG
  • bba3e40 Use nested module format for Java package names
  • 1176f61 Make schema_dumper extension format options similar to Hash#inspect on Ruby 3.4+
  • 4673918 Update CHANGELOG
  • 67de9f2 Support import on datasets with DelayedEvaluation as from
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [sequel](https://github.com/jeremyevans/sequel) from 5.85.0 to 5.86.0.
- [Changelog](https://github.com/jeremyevans/sequel/blob/master/CHANGELOG)
- [Commits](jeremyevans/sequel@5.85.0...5.86.0)

---
updated-dependencies:
- dependency-name: sequel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies ruby Pull requests that update Ruby code labels Nov 4, 2024
Copy link

github-actions bot commented Nov 4, 2024

Copy link

github-actions bot commented Nov 4, 2024

gem compare sequel 5.85.0 5.86.0

Compared versions: ["5.85.0", "5.86.0"]
  DIFFERENT date:
    5.85.0: 2024-10-01 00:00:00 UTC
    5.86.0: 2024-11-01 00:00:00 UTC
  DIFFERENT version:
    5.85.0: 5.85.0
    5.86.0: 5.86.0
  DIFFERENT files:
    5.85.0->5.86.0:
      * Changed:
            lib/sequel/adapters/jdbc.rb +6/-6
            lib/sequel/adapters/jdbc/db2.rb +2/-2
            lib/sequel/adapters/jdbc/derby.rb +2/-2
            lib/sequel/adapters/jdbc/h2.rb +2/-2
            lib/sequel/adapters/jdbc/hsqldb.rb +2/-2
            lib/sequel/adapters/jdbc/jtds.rb +2/-2
            lib/sequel/adapters/jdbc/mysql.rb +1/-1
            lib/sequel/adapters/jdbc/oracle.rb +5/-5
            lib/sequel/adapters/jdbc/postgresql.rb +5/-5
            lib/sequel/adapters/jdbc/sqlanywhere.rb +6/-6
            lib/sequel/adapters/jdbc/sqlite.rb +2/-2
            lib/sequel/adapters/jdbc/sqlserver.rb +2/-2
            lib/sequel/adapters/shared/postgres.rb +3/-0
            lib/sequel/adapters/sqlite.rb +4/-0
            lib/sequel/database/misc.rb +6/-1
            lib/sequel/extensions/schema_dumper.rb +15/-3
            lib/sequel/plugins/subset_conditions.rb +84/-5
            lib/sequel/version.rb +1/-1

Copy link

github-actions bot commented Nov 4, 2024

gem compare --diff sequel 5.85.0 5.86.0

Compared versions: ["5.85.0", "5.86.0"]
  DIFFERENT files:
    5.85.0->5.86.0:
      * Changed:
        lib/sequel/adapters/jdbc.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -23 +23 @@
                -    NativeException = java.lang.Exception
                +    NativeException = Java::JavaLang::Exception
                @@ -230 +230 @@
                -            props = java.util.Properties.new
                +            props = Java::JavaUtil::Properties.new
                @@ -509 +509 @@
                -        javax.naming.InitialContext.new.lookup(jndi_name).connection
                +        Java::JavaxNaming::InitialContext.new.lookup(jndi_name).connection
                @@ -533 +533 @@
                -        java.sql.Date.new(Time.local(date.year, date.month, date.day).to_i * 1000)
                +        Java::JavaSql::Date.new(Time.local(date.year, date.month, date.day).to_i * 1000)
                @@ -538 +538 @@
                -        ts = java.sql.Timestamp.new(Time.local(datetime.year, datetime.month, datetime.day, datetime.hour, datetime.min, datetime.sec).to_i * 1000)
                +        ts = Java::JavaSql::Timestamp.new(Time.local(datetime.year, datetime.month, datetime.day, datetime.hour, datetime.min, datetime.sec).to_i * 1000)
                @@ -545 +545 @@
                -        ts = java.sql.Timestamp.new(time.to_i * 1000)
                +        ts = Java::JavaSql::Timestamp.new(time.to_i * 1000)
        lib/sequel/adapters/jdbc/db2.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/db2.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/db2.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -3 +3 @@
                -Sequel::JDBC.load_driver('com.ibm.db2.jcc.DB2Driver')
                +Sequel::JDBC.load_driver('Java::ComIbmDb2Jcc::DB2Driver')
                @@ -28 +28 @@
                -        com.ibm.db2.jcc.DB2Driver
                +        Java::ComIbmDb2Jcc::DB2Driver
        lib/sequel/adapters/jdbc/derby.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/derby.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/derby.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -3 +3 @@
                -Sequel::JDBC.load_driver('org.apache.derby.jdbc.EmbeddedDriver', :Derby)
                +Sequel::JDBC.load_driver('Java::OrgApacheDerbyJdbc::EmbeddedDriver', :Derby)
                @@ -13 +13 @@
                -        org.apache.derby.jdbc.EmbeddedDriver
                +        Java::OrgApacheDerbyJdbc::EmbeddedDriver
        lib/sequel/adapters/jdbc/h2.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/h2.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/h2.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -3 +3 @@
                -Sequel::JDBC.load_driver('org.h2.Driver', :H2)
                +Sequel::JDBC.load_driver('Java::OrgH2::Driver', :H2)
                @@ -12 +12 @@
                -        org.h2.Driver
                +        Java::OrgH2::Driver
        lib/sequel/adapters/jdbc/hsqldb.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/hsqldb.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/hsqldb.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -3 +3 @@
                -Sequel::JDBC.load_driver('org.hsqldb.jdbcDriver', :HSQLDB)
                +Sequel::JDBC.load_driver('Java::OrgHsqldb::jdbcDriver', :HSQLDB)
                @@ -13 +13 @@
                -        org.hsqldb.jdbcDriver
                +        Java::OrgHsqldb::jdbcDriver
        lib/sequel/adapters/jdbc/jtds.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/jtds.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/jtds.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -3 +3 @@
                -Sequel::JDBC.load_driver('Java::net.sourceforge.jtds.jdbc.Driver', :JTDS)
                +Sequel::JDBC.load_driver('Java::NetSourceforgeJtdsJdbc::Driver', :JTDS)
                @@ -13 +13 @@
                -        Java::net.sourceforge.jtds.jdbc.Driver
                +        Java::NetSourceforgeJtdsJdbc::Driver
        lib/sequel/adapters/jdbc/mysql.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/mysql.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/mysql.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -5 +5 @@
                -    driver = Sequel::JDBC.load_driver(%w'com.mysql.cj.jdbc.Driver com.mysql.jdbc.Driver', :MySQL)
                +    driver = Sequel::JDBC.load_driver(%w'Java::ComMysqlCjJdbc::Driver Java::ComMysqlJdbc::Driver', :MySQL)
        lib/sequel/adapters/jdbc/oracle.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/oracle.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/oracle.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -3 +3 @@
                -Sequel::JDBC.load_driver('Java::oracle.jdbc.driver.OracleDriver')
                +Sequel::JDBC.load_driver('Java::OracleJdbcDriver::OracleDriver')
                @@ -13 +13 @@
                -        Java::oracle.jdbc.driver.OracleDriver
                +        Java::OracleJdbcDriver::OracleDriver
                @@ -18 +18 @@
                -      JAVA_BIG_DECIMAL_CONSTRUCTOR = java.math.BigDecimal.java_class.constructor(Java::long).method(:new_instance)
                +      JAVA_BIG_DECIMAL_CONSTRUCTOR = Java::JavaMath::BigDecimal.java_class.constructor(Java::long).method(:new_instance)
                @@ -79 +79 @@
                -              rescue java.sql.SQLException
                +              rescue Java::JavaSql::SQLException
                @@ -125 +125 @@
                -        TIMESTAMPTZ_TYPES = [Java::oracle.jdbc.OracleTypes::TIMESTAMPTZ, Java::oracle.jdbc.OracleTypes::TIMESTAMPLTZ].freeze
                +        TIMESTAMPTZ_TYPES = [Java::OracleJdbc::OracleTypes::TIMESTAMPTZ, Java::OracleJdbc::OracleTypes::TIMESTAMPLTZ].freeze
        lib/sequel/adapters/jdbc/postgresql.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/postgresql.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/postgresql.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -3 +3 @@
                -Sequel::JDBC.load_driver('org.postgresql.Driver', :Postgres)
                +Sequel::JDBC.load_driver('Java::OrgPostgresql::Driver', :Postgres)
                @@ -12 +12 @@
                -        org.postgresql.Driver
                +        Java::OrgPostgresql::Driver
                @@ -46 +46 @@
                -              copy_manager = org.postgresql.copy.CopyManager.new(conn)
                +              copy_manager = Java::OrgPostgresqlCopy::CopyManager.new(conn)
                @@ -77 +77 @@
                -            copy_manager = org.postgresql.copy.CopyManager.new(conn)
                +            copy_manager = Java::OrgPostgresqlCopy::CopyManager.new(conn)
                @@ -151 +151 @@
                -            obj = org.postgresql.util.PGobject.new
                +            obj = Java::OrgPostgresqlUtil::PGobject.new
        lib/sequel/adapters/jdbc/sqlanywhere.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/sqlanywhere.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/sqlanywhere.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -9,6 +9,6 @@
                -      lambda{Java::sybase.jdbc4.sqlanywhere.IDriver},
                -      lambda{Java::ianywhere.ml.jdbcodbc.jdbc4.IDriver},
                -      lambda{Java::sybase.jdbc.sqlanywhere.IDriver},
                -      lambda{Java::ianywhere.ml.jdbcodbc.jdbc.IDriver},
                -      lambda{Java::com.sybase.jdbc4.jdbc.Sybdriver},
                -      lambda{Java::com.sybase.jdbc3.jdbc.Sybdriver}
                +      lambda{Java::SybaseJdbc4Sqlanywhere::IDriver},
                +      lambda{Java::IanywhereMlJdbcodbcJdbc4::IDriver},
                +      lambda{Java::SybaseJdbcSqlanywhere::IDriver},
                +      lambda{Java::IanywhereMlJdbcodbcJdbc::IDriver},
                +      lambda{Java::ComSybaseJdbc4Jdbc::Sybdriver},
                +      lambda{Java::ComSybaseJdbc3Jdbc::Sybdriver}
        lib/sequel/adapters/jdbc/sqlite.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/sqlite.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/sqlite.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -3 +3 @@
                -Sequel::JDBC.load_driver('org.sqlite.JDBC', :SQLite3)
                +Sequel::JDBC.load_driver('Java::OrgSqlite::JDBC', :SQLite3)
                @@ -13 +13 @@
                -        org.sqlite.JDBC
                +        Java::OrgSqlite::JDBC
        lib/sequel/adapters/jdbc/sqlserver.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/jdbc/sqlserver.rb	2024-11-04 03:13:33.373701067 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/jdbc/sqlserver.rb	2024-11-04 03:13:33.521700113 +0000
                @@ -3 +3 @@
                -Sequel::JDBC.load_driver('com.microsoft.sqlserver.jdbc.SQLServerDriver')
                +Sequel::JDBC.load_driver('Java::ComMicrosoftSqlserverJdbc::SQLServerDriver')
                @@ -13 +13 @@
                -        com.microsoft.sqlserver.jdbc.SQLServerDriver
                +        Java::ComMicrosoftSqlserverJdbc::SQLServerDriver
        lib/sequel/adapters/shared/postgres.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/shared/postgres.rb	2024-11-04 03:13:33.377701041 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/shared/postgres.rb	2024-11-04 03:13:33.529700062 +0000
                @@ -2432,0 +2433,3 @@
                +
                +        t = t.call(self) if t.is_a? Sequel::SQL::DelayedEvaluation
                +
        lib/sequel/adapters/sqlite.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/adapters/sqlite.rb	2024-11-04 03:13:33.381701015 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/adapters/sqlite.rb	2024-11-04 03:13:33.529700062 +0000
                @@ -111,0 +112,2 @@
                +      # :disable_dqs :: disable double quoted strings in DDL and DML statements
                +      #                 (requires SQLite 3.29.0+ and sqlite3 gem version 1.4.3+).
                @@ -130,0 +133,2 @@
                +        # SEQUEL6: Make strict: true the default behavior
                +        sqlite3_opts[:strict] = typecast_value_boolean(opts[:disable_dqs]) if opts.has_key?(:disable_dqs)
        lib/sequel/database/misc.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/database/misc.rb	2024-11-04 03:13:33.385700990 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/database/misc.rb	2024-11-04 03:13:33.533700036 +0000
                @@ -28,0 +29,5 @@
                +    # :nocov:
                +    URI_PARSER = defined?(::URI::RFC2396_PARSER) ? ::URI::RFC2396_PARSER : ::URI::DEFAULT_PARSER
                +    # :nocov:
                +    private_constant :URI_PARSER
                +
                @@ -88 +93 @@
                -      uri_options.to_a.each{|k,v| uri_options[k] = URI::DEFAULT_PARSER.unescape(v) if v.is_a?(String)}
                +      uri_options.to_a.each{|k,v| uri_options[k] = URI_PARSER.unescape(v) if v.is_a?(String)}
        lib/sequel/extensions/schema_dumper.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/extensions/schema_dumper.rb	2024-11-04 03:13:33.493700293 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/extensions/schema_dumper.rb	2024-11-04 03:13:33.549699933 +0000
                @@ -29,0 +30,5 @@
                +    # :nocov:
                +    IGNORE_INDEX_ERRORS_KEY = RUBY_VERSION >= '3.4' ? 'ignore_index_errors: ' : ':ignore_index_errors=>'
                +    # :nocov:
                +    private_constant :IGNORE_INDEX_ERRORS_KEY
                +
                @@ -164 +169 @@
                -      "create_table(#{table.inspect}#{', :ignore_index_errors=>true' if !options[:same_db] && options[:indexes] != false && !gen.indexes.empty?}) do\n#{commands.gsub(/^/, '  ')}\nend"
                +      "create_table(#{table.inspect}#{", #{IGNORE_INDEX_ERRORS_KEY}true" if !options[:same_db] && options[:indexes] != false && !gen.indexes.empty?}) do\n#{commands.gsub(/^/, '  ')}\nend"
                @@ -427,0 +433,7 @@
                +      # :nocov:
                +      DEFAULT_KEY = RUBY_VERSION >= '3.4' ? 'default: ' : ':default=>'
                +      IGNORE_ERRORS_KEY = RUBY_VERSION >= '3.4' ? 'ignore_errors: ' : ':ignore_errors=>'
                +      # :nocov:
                +      private_constant :DEFAULT_KEY
                +      private_constant :IGNORE_ERRORS_KEY
                +
                @@ -511 +523 @@
                -            "#{options[:drop_index] ? 'drop' : 'add'}_index #{table.inspect}, #{cols.inspect}#{', :ignore_errors=>true' if options[:ignore_errors]}#{opts_inspect(c)}"
                +            "#{options[:drop_index] ? 'drop' : 'add'}_index #{table.inspect}, #{cols.inspect}#{", #{IGNORE_ERRORS_KEY}true" if options[:ignore_errors]}#{opts_inspect(c)}"
                @@ -529 +541 @@
                -          ", :default=>#{de}#{", #{opts.inspect[1...-1]}" if opts.length > 0}"
                +          ", #{DEFAULT_KEY}#{de}#{", #{opts.inspect[1...-1]}" if opts.length > 0}"
        lib/sequel/plugins/subset_conditions.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/plugins/subset_conditions.rb	2024-11-04 03:13:33.513700165 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/plugins/subset_conditions.rb	2024-11-04 03:13:33.585699701 +0000
                @@ -6,3 +6,5 @@
                -    # for every subset created, which returns the filter conditions the subset
                -    # uses.  This can be useful if you want to use the conditions for a separate
                -    # filter or combine them with OR.
                +    # for every `subset`, `where`, and `exclude` method call in a dataset_module
                +    # block. This method returns the filter conditions, which can be useful if
                +    # you want to use the conditions for a separate filter or combine them with OR.
                +    # It also supports where_all and where_any dataset_module methods for
                +    # combining multiple dataset method filters with AND or OR.
                @@ -15 +16,0 @@
                -    #   # This will now create a published_conditions method
                @@ -17 +18,13 @@
                -    #     subset :published, published: true
                +    #     # This will now create a published_conditions method
                +    #     where :published, published: true
                +    #
                +    #     # This will now create a not_bad_conditions method
                +    #     exclude :not_bad, :bad
                +    #
                +    #     # This will create good_and_available and
                +    #     # good_and_available_conditions methods
                +    #     where_all :good_and_available, :published, :not_bad
                +    #
                +    #     # This will create good_or_available and
                +    #     # good_or_available_conditions methods
                +    #     where_any :good_or_available, :published, :not_bad
                @@ -27,0 +41,6 @@
                +    #
                +    #   Album.good_and_available.sql
                +    #   SELECT * FROM albums WHERE ((published IS TRUE) AND NOT bad)
                +    #
                +    #   Album.good_or_available.sql
                +    #   SELECT * FROM albums WHERE ((published IS TRUE) OR NOT bad)
                @@ -43,0 +63,60 @@
                +        end
                +
                +        # Also create a method that returns the conditions the filter uses.
                +        def exclude(name, *args, &block)
                +          super
                +          cond = args
                +          cond = cond.first if cond.size == 1
                +          define_method(:"#{name}_conditions"){Sequel.~(filter_expr(cond, &block))}
                +        end
                +
                +        # Create a method that combines filters from already registered
                +        # dataset methods, and filters for rows where all of the conditions
                +        # are satisfied.
                +        #
                +        #   Employee.dataset_module do
                +        #     where :active, active: true
                +        #     where :started, Sequel::CURRENT_DATE <= :start_date
                +        #     where_all(:active_and_started, :active, :started)
                +        #   end
                +        #
                +        #   Employee.active_and_started.sql
                +        #   # SELECT * FROM employees WHERE ((active IS TRUE) AND (CURRENT_DATE <= start_date))
                +        def where_all(name, *args)
                +          _where_any_all(:&, name, args)
                +        end
                +
                +        # Create a method that combines filters from already registered
                +        # dataset methods, and filters for rows where any of the conditions
                +        # are satisfied.
                +        #
                +        #   Employee.dataset_module do
                +        #     where :active, active: true
                +        #     where :started, Sequel::CURRENT_DATE <= :start_date
                +        #     where_any(:active_or_started, :active, :started)
                +        #   end
                +        #
                +        #   Employee.active_or_started.sql
                +        #   # SELECT * FROM employees WHERE ((active IS TRUE) OR (CURRENT_DATE <= start_date))
                +        def where_any(name, *args)
                +          _where_any_all(:|, name, args)
                +        end
                +
                +        private
                +
                +        if RUBY_VERSION >= '2'
                +          # Backbone of #where_any and #where_all
                +          def _where_any_all(meth, name, args)
                +            ds = model.dataset
                +            # #bind used here because the dataset module may not yet be included in the model's dataset
                +            where(name, Sequel.send(meth, *args.map{|a| self.instance_method(:"#{a}_conditions").bind(ds).call}))
                +          end
                +        else
                +          # Cannot bind module method to arbitrary objects in Ruby 1.9.
                +          # :nocov:
                +          def _where_any_all(meth, name, args)
                +            ds = model.dataset.clone
                +            ds.extend(self)
                +            where(name, Sequel.send(meth, *args.map{|a| ds.send(:"#{a}_conditions")}))
                +          end
                +          # :nocov:
        lib/sequel/version.rb
                --- /tmp/d20241104-2997-79q9dv/sequel-5.85.0/lib/sequel/version.rb	2024-11-04 03:13:33.517700139 +0000
                +++ /tmp/d20241104-2997-79q9dv/sequel-5.86.0/lib/sequel/version.rb	2024-11-04 03:13:33.589699675 +0000
                @@ -9 +9 @@
                -  MINOR = 85
                +  MINOR = 86

@dentarg dentarg merged commit 200f679 into main Nov 5, 2024
12 checks passed
@dentarg dentarg deleted the dependabot/bundler/sequel-5.86.0 branch November 5, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant