-
Notifications
You must be signed in to change notification settings - Fork 1
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.74.0 to 5.75.0 #547
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bumps [sequel](https://github.com/jeremyevans/sequel) from 5.74.0 to 5.75.0. - [Changelog](https://github.com/jeremyevans/sequel/blob/master/CHANGELOG) - [Commits](jeremyevans/sequel@5.74.0...5.75.0) --- updated-dependencies: - dependency-name: sequel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
gem compare sequel 5.74.0 5.75.0 Compared versions: ["5.74.0", "5.75.0"]
DIFFERENT date:
5.74.0: 2023-11-01 00:00:00 UTC
5.75.0: 2023-12-01 00:00:00 UTC
DIFFERENT version:
5.74.0: 5.74.0
5.75.0: 5.75.0
DIFFERENT files:
5.74.0->5.75.0:
* Added:
doc/release_notes/5.75.0.txt +35/-0
* Changed:
CHANGELOG +12/-0
lib/sequel/adapters/postgres.rb +4/-3
lib/sequel/adapters/shared/mysql.rb +21/-1
lib/sequel/adapters/shared/postgres.rb +54/-0
lib/sequel/extensions/any_not_empty.rb +2/-2
lib/sequel/extensions/migration.rb +34/-8
lib/sequel/plugins/column_encryption.rb +1/-1
lib/sequel/version.rb +1/-1
DIFFERENT extra_rdoc_files:
5.74.0->5.75.0:
* Added:
doc/release_notes/5.75.0.txt +35/-0
* Changed:
CHANGELOG +12/-0 |
gem compare --diff sequel 5.74.0 5.75.0 Compared versions: ["5.74.0", "5.75.0"]
DIFFERENT files:
5.74.0->5.75.0:
* Added:
doc/release_notes/5.75.0.txt
--- /tmp/20231204-2431-1jspu9 2023-12-04 03:53:19.103879735 +0000
+++ /tmp/d20231204-2431-7dq0bf/sequel-5.75.0/doc/release_notes/5.75.0.txt 2023-12-04 03:53:18.959879687 +0000
@@ -0,0 +1,35 @@
+= New Features
+
+* Database#{defer,immediate}_constraints methods have been added on
+ PostgreSQL for changing handling of deferrable constraints inside
+ a transaction. defer_constraints sets deferrable constraints to
+ be deferred (not checked until transaction commit), and
+ immediate_constraints sets deferrable constraints to be checked
+ as part of the related query, and any already deferred constraint
+ checks to be applied immediately. You can pass the :constraints
+ option to only apply the changes to specific constraints.
+
+* TimestampMigrator.run_single has been added, to migrate a single
+ migration up or down.
+
+= Other Improvements
+
+* INSERT RETURNING is now supported on MariaDB 10.5+, and used
+ automatically when saving new model objects. Note that this
+ is not supported when using the jdbc adapter, because the
+ jdbc-mysql driver doesn't support it. A jdbc/mariadb adapter
+ could be added, as it's likely recent versions of the
+ jdbc-mariadb driver would support it, but the jdbc-mariadb gem
+ hasn't been updated in over 4 years. Talk to the jdbc-mariadb
+ gem maintainers if you want to use this feature with the jdbc
+ adapter.
+
+* The Dataset#paged_each optimization in the postgres adapter
+ now respects the :skip_transaction option, making it the
+ same as the :hold option. Note that this has effects beyond
+ just skipping the transaction, but non-HOLD cursors are only
+ supported inside transactions.
+
+* The any_not_empty? extension's Dataset#any? method now supports
+ an argument, passing it to Enumerable#any? (which has supported
+ an argument since Ruby 2.5).
* Changed:
CHANGELOG
--- /tmp/d20231204-2431-7dq0bf/sequel-5.74.0/CHANGELOG 2023-12-04 03:53:18.827879643 +0000
+++ /tmp/d20231204-2431-7dq0bf/sequel-5.75.0/CHANGELOG 2023-12-04 03:53:18.943879682 +0000
@@ -0,0 +1,12 @@
+=== 5.75.0 (2023-12-01)
+
+* Make any_not_empty? extension support passing pattern argument to any? (jeremyevans) (#2100)
+
+* Respect :skip_transaction option in PostgreSQL Dataset#paged_each (jeremyevans) (#2097)
+
+* Add TimestampMigrator.run_single to run a single migration file up or down (opya, jeremyevans) (#2093)
+
+* Support INSERT RETURNING on MariaDB 10.5+, and use it when saving new model objects (jeremyevans)
+
+* Add Database#{defer,immediate}_constraints on PostgreSQL for changing handling of deferrable constraints in a transaction (jeremyevans)
+
lib/sequel/adapters/postgres.rb
--- /tmp/d20231204-2431-7dq0bf/sequel-5.74.0/lib/sequel/adapters/postgres.rb 2023-12-04 03:53:18.847879650 +0000
+++ /tmp/d20231204-2431-7dq0bf/sequel-5.75.0/lib/sequel/adapters/postgres.rb 2023-12-04 03:53:18.963879688 +0000
@@ -674,0 +675 @@
+ # :skip_transaction :: Same as :hold, but :hold takes priority.
@@ -767 +767,0 @@
- server_opts = {:server=>@opts[:server] || :read_only}
@@ -769 +769,2 @@
- hold = cursor[:hold]
+ hold = cursor.fetch(:hold){cursor[:skip_transaction]}
+ server_opts = {:server=>@opts[:server] || :read_only, :skip_transaction=>hold}
@@ -773 +774 @@
- db.public_send(*(hold ? [:synchronize, server_opts[:server]] : [:transaction, server_opts])) do
+ db.transaction(server_opts) do
lib/sequel/adapters/shared/mysql.rb
--- /tmp/d20231204-2431-7dq0bf/sequel-5.74.0/lib/sequel/adapters/shared/mysql.rb 2023-12-04 03:53:18.851879651 +0000
+++ /tmp/d20231204-2431-7dq0bf/sequel-5.75.0/lib/sequel/adapters/shared/mysql.rb 2023-12-04 03:53:18.987879696 +0000
@@ -649 +649 @@
- Dataset.def_sql_method(self, :insert, %w'insert ignore into columns values on_duplicate_key_update')
+ Dataset.def_sql_method(self, :insert, %w'insert ignore into columns values on_duplicate_key_update returning')
@@ -776,0 +777,15 @@
+ # Support insert select for associations, so that the model code can use
+ # returning instead of a separate query.
+ def insert_select(*values)
+ return unless supports_insert_select?
+ # Handle case where query does not return a row
+ server?(:default).with_sql_first(insert_select_sql(*values)) || false
+ end
+
+ # The SQL to use for an insert_select, adds a RETURNING clause to the insert
+ # unless the RETURNING clause is already present.
+ def insert_select_sql(*values)
+ ds = opts[:returning] ? self : returning
+ ds.insert_sql(*values)
+ end
+
@@ -871,0 +887,5 @@
+ end
+
+ # MariaDB 10.5.0 supports INSERT RETURNING.
+ def supports_returning?(type)
+ (type == :insert && db.mariadb? && db.adapter_scheme != :jdbc) ? (db.server_version >= 100500) : false
lib/sequel/adapters/shared/postgres.rb
--- /tmp/d20231204-2431-7dq0bf/sequel-5.74.0/lib/sequel/adapters/shared/postgres.rb 2023-12-04 03:53:18.851879651 +0000
+++ /tmp/d20231204-2431-7dq0bf/sequel-5.75.0/lib/sequel/adapters/shared/postgres.rb 2023-12-04 03:53:18.995879699 +0000
@@ -500,0 +501,19 @@
+ # For constraints that are deferrable, defer constraints until
+ # transaction commit. Options:
+ #
+ # :constraints :: An identifier of the constraint, or an array of
+ # identifiers for constraints, to apply this
+ # change to specific constraints.
+ # :server :: The server/shard on which to run the query.
+ #
+ # Examples:
+ #
+ # DB.defer_constraints
+ # # SET CONSTRAINTS ALL DEFERRED
+ #
+ # DB.defer_constraints(constraints: [:c1, Sequel[:sc][:c2]])
+ # # SET CONSTRAINTS "c1", "sc"."s2" DEFERRED
+ def defer_constraints(opts=OPTS)
+ _set_constraints(' DEFERRED', opts)
+ end
+
@@ -613,0 +633,18 @@
+ # Immediately apply deferrable constraints.
+ #
+ # :constraints :: An identifier of the constraint, or an array of
+ # identifiers for constraints, to apply this
+ # change to specific constraints.
+ # :server :: The server/shard on which to run the query.
+ #
+ # Examples:
+ #
+ # DB.immediate_constraints
+ # # SET CONSTRAINTS ALL IMMEDIATE
+ #
+ # DB.immediate_constraints(constraints: [:c1, Sequel[:sc][:c2]])
+ # # SET CONSTRAINTS "c1", "sc"."s2" IMMEDIATE
+ def immediate_constraints(opts=OPTS)
+ _set_constraints(' IMMEDIATE', opts)
+ end
+
@@ -1038,0 +1076,17 @@
+ end
+
+ # Internals of defer_constraints/immediate_constraints
+ def _set_constraints(type, opts)
+ execute_ddl(_set_constraints_sql(type, opts), opts)
+ end
+
+ # SQL to use for SET CONSTRAINTS
+ def _set_constraints_sql(type, opts)
+ sql = String.new
+ sql << "SET CONSTRAINTS "
+ if constraints = opts[:constraints]
+ dataset.send(:source_list_append, sql, Array(constraints))
+ else
+ sql << "ALL"
+ end
+ sql << type
lib/sequel/extensions/any_not_empty.rb
--- /tmp/d20231204-2431-7dq0bf/sequel-5.74.0/lib/sequel/extensions/any_not_empty.rb 2023-12-04 03:53:18.859879654 +0000
+++ /tmp/d20231204-2431-7dq0bf/sequel-5.75.0/lib/sequel/extensions/any_not_empty.rb 2023-12-04 03:53:19.071879724 +0000
@@ -35,2 +35,2 @@
- def any?
- if defined?(yield)
+ def any?(*a)
+ if !a.empty? || defined?(yield)
lib/sequel/extensions/migration.rb
--- /tmp/d20231204-2431-7dq0bf/sequel-5.74.0/lib/sequel/extensions/migration.rb 2023-12-04 03:53:18.915879673 +0000
+++ /tmp/d20231204-2431-7dq0bf/sequel-5.75.0/lib/sequel/extensions/migration.rb 2023-12-04 03:53:19.075879726 +0000
@@ -695,0 +696,7 @@
+ # Apply the migration in the given file path. See Migrator.run for the
+ # available options. Additionally, this method supports the :direction
+ # option for whether to run the migration up (default) or down.
+ def self.run_single(db, path, opts=OPTS)
+ new(db, File.dirname(path), opts).run_single(path, opts[:direction] || :up)
+ end
+
@@ -705,8 +712 @@
- t = Time.now
- db.log_info("Begin applying migration #{f}, direction: #{direction}")
- checked_transaction(m) do
- m.apply(db, direction)
- fi = f.downcase
- direction == :up ? ds.insert(column=>fi) : ds.where(column=>fi).delete
- end
- db.log_info("Finished applying migration #{f}, direction: #{direction}, took #{sprintf('%0.6f', Time.now - t)} seconds")
+ apply_migration(m, f, direction)
@@ -716,0 +717,13 @@
+ # Apply single migration tuple at the given path with the given direction
+ # on the database.
+ def run_single(path, direction)
+ migration = load_migration_file(path)
+ file_name = File.basename(path)
+ already_applied = applied_migrations.include?(file_name.downcase)
+
+ return if direction == :up ? already_applied : !already_applied
+
+ apply_migration(migration, file_name, direction)
+ nil
+ end
+
@@ -717,0 +731,13 @@
+
+ # Apply a single migration with the given filename in the given direction.
+ def apply_migration(migration, file_name, direction)
+ fi = file_name.downcase
+ t = Time.now
+
+ db.log_info("Begin applying migration #{file_name}, direction: #{direction}")
+ checked_transaction(migration) do
+ migration.apply(db, direction)
+ direction == :up ? ds.insert(column=>fi) : ds.where(column=>fi).delete
+ end
+ db.log_info("Finished applying migration #{file_name}, direction: #{direction}, took #{sprintf('%0.6f', Time.now - t)} seconds")
+ end
lib/sequel/plugins/column_encryption.rb
--- /tmp/d20231204-2431-7dq0bf/sequel-5.74.0/lib/sequel/plugins/column_encryption.rb 2023-12-04 03:53:18.927879677 +0000
+++ /tmp/d20231204-2431-7dq0bf/sequel-5.75.0/lib/sequel/plugins/column_encryption.rb 2023-12-04 03:53:19.091879731 +0000
@@ -328 +328 @@
- # octet_length(decode(regexp_replace(regexp_replace(c, '_', '/', 'g'), '-', '+', 'g'), 'base64')) >= 65}
+ # octet_length(decode(regexp_replace(regexp_replace(c, '_', '/', 'g'), '-', '+', 'g'), 'base64')) >= 65
lib/sequel/version.rb
--- /tmp/d20231204-2431-7dq0bf/sequel-5.74.0/lib/sequel/version.rb 2023-12-04 03:53:18.943879682 +0000
+++ /tmp/d20231204-2431-7dq0bf/sequel-5.75.0/lib/sequel/version.rb 2023-12-04 03:53:19.103879735 +0000
@@ -9 +9 @@
- MINOR = 74
+ MINOR = 75 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bumps sequel from 5.74.0 to 5.75.0.
Changelog
Sourced from sequel's changelog.
Commits
5b78ac7
Bump version to 5.75.0e728617
Make any_not_empty? extension support passing pattern argument to any?9099201
Fix Ruby syntax in column encryption constraint example0239207
Respect :skip_transaction option in PostgreSQL Dataset#paged_each (Fixes #2097)4637356
Minor refactors and add documentation for TimestampMigrator.run_single422f160
Added run_single method to run migration by version and direction730970e
Remove unused Rake tasks0d509ad
Support INSERT RETURNING on MariaDB 10.5+, and use it when saving new model o...5e5f703
Add Database#{defer,immediate}_constraints on PostgreSQL for changing handlin...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)