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.83.1 to 5.84.0 #669

Merged
merged 4 commits into from
Oct 20, 2024
Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 2, 2024

Bumps sequel from 5.83.1 to 5.84.0.

Changelog

Sourced from sequel's changelog.

=== 5.84.0 (2024-09-01)

  • Support creating VIRTUAL tables on SQLite via the create_table :using option (jeremyevans)

  • Support json_{exists,value,query} on PostgreSQL 17+ in the pg_json_ops extension (jeremyevans)

  • Remove documentation from the gem to reduce gem size by 25% (jeremyevans)

Commits
  • 75ac94c Bump version to 5.84.0
  • 5c0e37b Support creating VIRTUAL tables on SQLite via the create_table :using option
  • 743bafb Fix typo in constant name
  • 97a9617 Support json_{exists,value,query} on PostgreSQL 17+ in the pg_json_ops extension
  • cf856e8 Reduce gem size by 25% by removing documentation
  • f851d1b Document that add_foreign_key is usually reversible
  • See full diff in compare view

Dependabot compatibility score

You can trigger a rebase of this PR 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)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies ruby Pull requests that update Ruby code labels Sep 2, 2024
Copy link

github-actions bot commented Sep 2, 2024

Copy link

github-actions bot commented Sep 2, 2024

gem compare sequel 5.83.1 5.84.0

Compared versions: ["5.83.1", "5.84.0"]
  DIFFERENT date:
    5.83.1: 2024-08-08 00:00:00 UTC
    5.84.0: 2024-09-01 00:00:00 UTC
  DIFFERENT version:
    5.83.1: 5.83.1
    5.84.0: 5.84.0
  DIFFERENT files:
    5.83.1->5.84.0:
      * Deleted:
            CHANGELOG
            README.rdoc
            doc/advanced_associations.rdoc
            doc/association_basics.rdoc
            doc/bin_sequel.rdoc
            doc/cheat_sheet.rdoc
            doc/code_order.rdoc
            doc/core_extensions.rdoc
            doc/dataset_basics.rdoc
            doc/dataset_filtering.rdoc
            doc/extensions.rdoc
            doc/fork_safety.rdoc
            doc/mass_assignment.rdoc
            doc/migration.rdoc
            doc/model_dataset_method_design.rdoc
            doc/model_hooks.rdoc
            doc/model_plugins.rdoc
            doc/mssql_stored_procedures.rdoc
            doc/object_model.rdoc
            doc/opening_databases.rdoc
            doc/postgresql.rdoc
            doc/prepared_statements.rdoc
            doc/querying.rdoc
            doc/reflection.rdoc
            doc/release_notes/5.0.0.txt
            doc/release_notes/5.1.0.txt
            doc/release_notes/5.10.0.txt
            doc/release_notes/5.11.0.txt
            doc/release_notes/5.12.0.txt
            doc/release_notes/5.13.0.txt
            doc/release_notes/5.14.0.txt
            doc/release_notes/5.15.0.txt
            doc/release_notes/5.16.0.txt
            doc/release_notes/5.17.0.txt
            doc/release_notes/5.18.0.txt
            doc/release_notes/5.19.0.txt
            doc/release_notes/5.2.0.txt
            doc/release_notes/5.20.0.txt
            doc/release_notes/5.21.0.txt
            doc/release_notes/5.22.0.txt
            doc/release_notes/5.23.0.txt
            doc/release_notes/5.24.0.txt
            doc/release_notes/5.25.0.txt
            doc/release_notes/5.26.0.txt
            doc/release_notes/5.27.0.txt
            doc/release_notes/5.28.0.txt
            doc/release_notes/5.29.0.txt
            doc/release_notes/5.3.0.txt
            doc/release_notes/5.30.0.txt
            doc/release_notes/5.31.0.txt
            doc/release_notes/5.32.0.txt
            doc/release_notes/5.33.0.txt
            doc/release_notes/5.34.0.txt
            doc/release_notes/5.35.0.txt
            doc/release_notes/5.36.0.txt
            doc/release_notes/5.37.0.txt
            doc/release_notes/5.38.0.txt
            doc/release_notes/5.39.0.txt
            doc/release_notes/5.4.0.txt
            doc/release_notes/5.40.0.txt
            doc/release_notes/5.41.0.txt
            doc/release_notes/5.42.0.txt
            doc/release_notes/5.43.0.txt
            doc/release_notes/5.44.0.txt
            doc/release_notes/5.45.0.txt
            doc/release_notes/5.46.0.txt
            doc/release_notes/5.47.0.txt
            doc/release_notes/5.48.0.txt
            doc/release_notes/5.49.0.txt
            doc/release_notes/5.5.0.txt
            doc/release_notes/5.50.0.txt
            doc/release_notes/5.51.0.txt
            doc/release_notes/5.52.0.txt
            doc/release_notes/5.53.0.txt
            doc/release_notes/5.54.0.txt
            doc/release_notes/5.55.0.txt
            doc/release_notes/5.56.0.txt
            doc/release_notes/5.57.0.txt
            doc/release_notes/5.58.0.txt
            doc/release_notes/5.59.0.txt
            doc/release_notes/5.6.0.txt
            doc/release_notes/5.60.0.txt
            doc/release_notes/5.61.0.txt
            doc/release_notes/5.62.0.txt
            doc/release_notes/5.63.0.txt
            doc/release_notes/5.64.0.txt
            doc/release_notes/5.65.0.txt
            doc/release_notes/5.66.0.txt
            doc/release_notes/5.67.0.txt
            doc/release_notes/5.68.0.txt
            doc/release_notes/5.69.0.txt
            doc/release_notes/5.7.0.txt
            doc/release_notes/5.70.0.txt
            doc/release_notes/5.71.0.txt
            doc/release_notes/5.72.0.txt
            doc/release_notes/5.73.0.txt
            doc/release_notes/5.74.0.txt
            doc/release_notes/5.75.0.txt
            doc/release_notes/5.76.0.txt
            doc/release_notes/5.77.0.txt
            doc/release_notes/5.78.0.txt
            doc/release_notes/5.79.0.txt
            doc/release_notes/5.8.0.txt
            doc/release_notes/5.80.0.txt
            doc/release_notes/5.81.0.txt
            doc/release_notes/5.82.0.txt
            doc/release_notes/5.83.0.txt
            doc/release_notes/5.9.0.txt
            doc/schema_modification.rdoc
            doc/security.rdoc
            doc/sharding.rdoc
            doc/sql.rdoc
            doc/testing.rdoc
            doc/thread_safety.rdoc
            doc/transactions.rdoc
            doc/validations.rdoc
            doc/virtual_rows.rdoc
      * Changed:
            lib/sequel/adapters/shared/sqlite.rb +3/-1
            lib/sequel/database/schema_methods.rb +2/-0
            lib/sequel/extensions/pg_json_ops.rb +328/-1
            lib/sequel/sql.rb +8/-5
            lib/sequel/version.rb +2/-2
  DIFFERENT extra_rdoc_files:
    5.83.1->5.84.0:
      * Deleted:
            README.rdoc
            CHANGELOG
            doc/advanced_associations.rdoc
            doc/association_basics.rdoc
            doc/bin_sequel.rdoc
            doc/cheat_sheet.rdoc
            doc/code_order.rdoc
            doc/core_extensions.rdoc
            doc/dataset_basics.rdoc
            doc/dataset_filtering.rdoc
            doc/extensions.rdoc
            doc/fork_safety.rdoc
            doc/mass_assignment.rdoc
            doc/migration.rdoc
            doc/model_dataset_method_design.rdoc
            doc/model_hooks.rdoc
            doc/model_plugins.rdoc
            doc/mssql_stored_procedures.rdoc
            doc/object_model.rdoc
            doc/opening_databases.rdoc
            doc/postgresql.rdoc
            doc/prepared_statements.rdoc
            doc/querying.rdoc
            doc/reflection.rdoc
            doc/schema_modification.rdoc
            doc/security.rdoc
            doc/sharding.rdoc
            doc/sql.rdoc
            doc/testing.rdoc
            doc/thread_safety.rdoc
            doc/transactions.rdoc
            doc/validations.rdoc
            doc/virtual_rows.rdoc
            doc/release_notes/5.0.0.txt
            doc/release_notes/5.1.0.txt
            doc/release_notes/5.10.0.txt
            doc/release_notes/5.11.0.txt
            doc/release_notes/5.12.0.txt
            doc/release_notes/5.13.0.txt
            doc/release_notes/5.14.0.txt
            doc/release_notes/5.15.0.txt
            doc/release_notes/5.16.0.txt
            doc/release_notes/5.17.0.txt
            doc/release_notes/5.18.0.txt
            doc/release_notes/5.19.0.txt
            doc/release_notes/5.2.0.txt
            doc/release_notes/5.20.0.txt
            doc/release_notes/5.21.0.txt
            doc/release_notes/5.22.0.txt
            doc/release_notes/5.23.0.txt
            doc/release_notes/5.24.0.txt
            doc/release_notes/5.25.0.txt
            doc/release_notes/5.26.0.txt
            doc/release_notes/5.27.0.txt
            doc/release_notes/5.28.0.txt
            doc/release_notes/5.29.0.txt
            doc/release_notes/5.3.0.txt
            doc/release_notes/5.30.0.txt
            doc/release_notes/5.31.0.txt
            doc/release_notes/5.32.0.txt
            doc/release_notes/5.33.0.txt
            doc/release_notes/5.34.0.txt
            doc/release_notes/5.35.0.txt
            doc/release_notes/5.36.0.txt
            doc/release_notes/5.37.0.txt
            doc/release_notes/5.38.0.txt
            doc/release_notes/5.39.0.txt
            doc/release_notes/5.4.0.txt
            doc/release_notes/5.40.0.txt
            doc/release_notes/5.41.0.txt
            doc/release_notes/5.42.0.txt
            doc/release_notes/5.43.0.txt
            doc/release_notes/5.44.0.txt
            doc/release_notes/5.45.0.txt
            doc/release_notes/5.46.0.txt
            doc/release_notes/5.47.0.txt
            doc/release_notes/5.48.0.txt
            doc/release_notes/5.49.0.txt
            doc/release_notes/5.5.0.txt
            doc/release_notes/5.50.0.txt
            doc/release_notes/5.51.0.txt
            doc/release_notes/5.52.0.txt
            doc/release_notes/5.53.0.txt
            doc/release_notes/5.54.0.txt
            doc/release_notes/5.55.0.txt
            doc/release_notes/5.56.0.txt
            doc/release_notes/5.57.0.txt
            doc/release_notes/5.58.0.txt
            doc/release_notes/5.59.0.txt
            doc/release_notes/5.6.0.txt
            doc/release_notes/5.60.0.txt
            doc/release_notes/5.61.0.txt
            doc/release_notes/5.62.0.txt
            doc/release_notes/5.63.0.txt
            doc/release_notes/5.64.0.txt
            doc/release_notes/5.65.0.txt
            doc/release_notes/5.66.0.txt
            doc/release_notes/5.67.0.txt
            doc/release_notes/5.68.0.txt
            doc/release_notes/5.69.0.txt
            doc/release_notes/5.7.0.txt
            doc/release_notes/5.70.0.txt
            doc/release_notes/5.71.0.txt
            doc/release_notes/5.72.0.txt
            doc/release_notes/5.73.0.txt
            doc/release_notes/5.74.0.txt
            doc/release_notes/5.75.0.txt
            doc/release_notes/5.76.0.txt
            doc/release_notes/5.77.0.txt
            doc/release_notes/5.78.0.txt
            doc/release_notes/5.79.0.txt
            doc/release_notes/5.8.0.txt
            doc/release_notes/5.80.0.txt
            doc/release_notes/5.81.0.txt
            doc/release_notes/5.82.0.txt
            doc/release_notes/5.83.0.txt
            doc/release_notes/5.9.0.txt

Copy link

github-actions bot commented Sep 2, 2024

gem compare --diff sequel 5.83.1 5.84.0

Compared versions: ["5.83.1", "5.84.0"]
  DIFFERENT files:
    5.83.1->5.84.0:
      * Deleted:
            CHANGELOG
            README.rdoc
            doc/advanced_associations.rdoc
            doc/association_basics.rdoc
            doc/bin_sequel.rdoc
            doc/cheat_sheet.rdoc
            doc/code_order.rdoc
            doc/core_extensions.rdoc
            doc/dataset_basics.rdoc
            doc/dataset_filtering.rdoc
            doc/extensions.rdoc
            doc/fork_safety.rdoc
            doc/mass_assignment.rdoc
            doc/migration.rdoc
            doc/model_dataset_method_design.rdoc
            doc/model_hooks.rdoc
            doc/model_plugins.rdoc
            doc/mssql_stored_procedures.rdoc
            doc/object_model.rdoc
            doc/opening_databases.rdoc
            doc/postgresql.rdoc
            doc/prepared_statements.rdoc
            doc/querying.rdoc
            doc/reflection.rdoc
            doc/release_notes/5.0.0.txt
            doc/release_notes/5.1.0.txt
            doc/release_notes/5.10.0.txt
            doc/release_notes/5.11.0.txt
            doc/release_notes/5.12.0.txt
            doc/release_notes/5.13.0.txt
            doc/release_notes/5.14.0.txt
            doc/release_notes/5.15.0.txt
            doc/release_notes/5.16.0.txt
            doc/release_notes/5.17.0.txt
            doc/release_notes/5.18.0.txt
            doc/release_notes/5.19.0.txt
            doc/release_notes/5.2.0.txt
            doc/release_notes/5.20.0.txt
            doc/release_notes/5.21.0.txt
            doc/release_notes/5.22.0.txt
            doc/release_notes/5.23.0.txt
            doc/release_notes/5.24.0.txt
            doc/release_notes/5.25.0.txt
            doc/release_notes/5.26.0.txt
            doc/release_notes/5.27.0.txt
            doc/release_notes/5.28.0.txt
            doc/release_notes/5.29.0.txt
            doc/release_notes/5.3.0.txt
            doc/release_notes/5.30.0.txt
            doc/release_notes/5.31.0.txt
            doc/release_notes/5.32.0.txt
            doc/release_notes/5.33.0.txt
            doc/release_notes/5.34.0.txt
            doc/release_notes/5.35.0.txt
            doc/release_notes/5.36.0.txt
            doc/release_notes/5.37.0.txt
            doc/release_notes/5.38.0.txt
            doc/release_notes/5.39.0.txt
            doc/release_notes/5.4.0.txt
            doc/release_notes/5.40.0.txt
            doc/release_notes/5.41.0.txt
            doc/release_notes/5.42.0.txt
            doc/release_notes/5.43.0.txt
            doc/release_notes/5.44.0.txt
            doc/release_notes/5.45.0.txt
            doc/release_notes/5.46.0.txt
            doc/release_notes/5.47.0.txt
            doc/release_notes/5.48.0.txt
            doc/release_notes/5.49.0.txt
            doc/release_notes/5.5.0.txt
            doc/release_notes/5.50.0.txt
            doc/release_notes/5.51.0.txt
            doc/release_notes/5.52.0.txt
            doc/release_notes/5.53.0.txt
            doc/release_notes/5.54.0.txt
            doc/release_notes/5.55.0.txt
            doc/release_notes/5.56.0.txt
            doc/release_notes/5.57.0.txt
            doc/release_notes/5.58.0.txt
            doc/release_notes/5.59.0.txt
            doc/release_notes/5.6.0.txt
            doc/release_notes/5.60.0.txt
            doc/release_notes/5.61.0.txt
            doc/release_notes/5.62.0.txt
            doc/release_notes/5.63.0.txt
            doc/release_notes/5.64.0.txt
            doc/release_notes/5.65.0.txt
            doc/release_notes/5.66.0.txt
            doc/release_notes/5.67.0.txt
            doc/release_notes/5.68.0.txt
            doc/release_notes/5.69.0.txt
            doc/release_notes/5.7.0.txt
            doc/release_notes/5.70.0.txt
            doc/release_notes/5.71.0.txt
            doc/release_notes/5.72.0.txt
            doc/release_notes/5.73.0.txt
            doc/release_notes/5.74.0.txt
            doc/release_notes/5.75.0.txt
            doc/release_notes/5.76.0.txt
            doc/release_notes/5.77.0.txt
            doc/release_notes/5.78.0.txt
            doc/release_notes/5.79.0.txt
            doc/release_notes/5.8.0.txt
            doc/release_notes/5.80.0.txt
            doc/release_notes/5.81.0.txt
            doc/release_notes/5.82.0.txt
            doc/release_notes/5.83.0.txt
            doc/release_notes/5.9.0.txt
            doc/schema_modification.rdoc
            doc/security.rdoc
            doc/sharding.rdoc
            doc/sql.rdoc
            doc/testing.rdoc
            doc/thread_safety.rdoc
            doc/transactions.rdoc
            doc/validations.rdoc
            doc/virtual_rows.rdoc
      * Changed:
        lib/sequel/adapters/shared/sqlite.rb
                --- /tmp/d20240902-2174-12qwj9/sequel-5.83.1/lib/sequel/adapters/shared/sqlite.rb	2024-09-02 02:26:29.279058183 +0000
                +++ /tmp/d20240902-2174-12qwj9/sequel-5.84.0/lib/sequel/adapters/shared/sqlite.rb	2024-09-02 02:26:29.383059643 +0000
                @@ -352 +352 @@
                -      # Support creating STRICT AND/OR WITHOUT ROWID tables via :strict and :without_rowid options
                +      # Support creating STRICT AND/OR WITHOUT ROWID tables via :strict and :without_rowid options, and VIRTUAL tables with :using option.
                @@ -359,0 +360,2 @@
                +        elsif options[:using]
                +          "CREATE VIRTUAL TABLE#{' IF NOT EXISTS' if options[:if_not_exists]} #{create_table_table_name_sql(name, options)} USING #{options[:using]}"
        lib/sequel/database/schema_methods.rb
                --- /tmp/d20240902-2174-12qwj9/sequel-5.83.1/lib/sequel/database/schema_methods.rb	2024-09-02 02:26:29.283058240 +0000
                +++ /tmp/d20240902-2174-12qwj9/sequel-5.84.0/lib/sequel/database/schema_methods.rb	2024-09-02 02:26:29.387059699 +0000
                @@ -193,0 +194,2 @@
                +    # :using :: Create a VIRTUAL table with the given USING clause. The value should be
                +    #           a string, as it is used directly in the SQL query.
        lib/sequel/extensions/pg_json_ops.rb
                --- /tmp/d20240902-2174-12qwj9/sequel-5.83.1/lib/sequel/extensions/pg_json_ops.rb	2024-09-02 02:26:29.295058408 +0000
                +++ /tmp/d20240902-2174-12qwj9/sequel-5.84.0/lib/sequel/extensions/pg_json_ops.rb	2024-09-02 02:26:29.399059867 +0000
                @@ -134,0 +135,11 @@
                +# On PostgreSQL 17+, the additional JSON functions are supported (see method documentation
                +# for additional options):
                +#
                +#   j.exists('$.foo')     # json_exists(jsonb_column, '$.foo')
                +#   j.value('$.foo')      # json_value(jsonb_column, '$.foo')
                +#   j.query('$.foo')      # json_query(jsonb_column, '$.foo')
                +#
                +#   j.exists('$.foo', passing: {a: 1}) # json_exists(jsonb_column, '$.foo' PASSING 1 AS a)
                +#   j.value('$.foo', returning: Time)  # json_value(jsonb_column, '$.foo' RETURNING timestamp)
                +#   j.query('$.foo', wrapper: true)    # json_query(jsonb_column, '$.foo' WITH WRAPPER)
                +#
                @@ -227 +238,19 @@
                -      # Returns a json value for the object at the given path.
                +      # Return whether the given JSON path yields any items in the receiver.
                +      # Options:
                +      #
                +      # :on_error :: How to handle errors when evaluating the JSON path expression.
                +      #              true :: Return true
                +      #              false :: Return false (default behavior)
                +      #              :null :: Return nil
                +      #              :error :: raise a DatabaseError
                +      # :passing :: Variables to pass to the JSON path expression.  Keys are variable
                +      #             names, values are the values of the variable.
                +      # 
                +      #   json_op.exists("$.a") # json_exists(json, '$.a')
                +      #   json_op.exists("$.a", passing: {a: 1}) # json_exists(json, '$.a' PASSING 1 AS a)
                +      #   json_op.exists("$.a", on_error: :error) # json_exists(json, '$.a' ERROR ON ERROR)
                +      def exists(path, opts=OPTS)
                +        Sequel::SQL::BooleanExpression.new(:NOOP, JSONExistsOp.new(self, path, opts))
                +      end
                +
                +      # Returns a JSON value for the object at the given path.
                @@ -301,0 +331,29 @@
                +      # Return the result of applying the JSON path expression to the receiver, by default
                +      # returning results as jsonb.  Options:
                +      #
                +      # :on_empty :: How to handle case where path expression yields an empty set.
                +      #              Uses same values as :on_error option.
                +      # :on_error :: How to handle errors when evaluating the JSON path expression:
                +      #              :null :: Return nil (default)
                +      #              :empty_array :: Return an empty array
                +      #              :empty_object :: Return an empty object
                +      #              :error :: raise a DatabaseError
                +      #              any other value :: used as default value
                +      # :passing :: Variables to pass to the JSON path expression.  Keys are variable
                +      #             names, values are the values of the variable.
                +      # :returning :: The data type to return (jsonb by default)
                +      # :wrapper :: How to wrap returned values:
                +      #             true, :unconditional :: Always wrap returning values in an array
                +      #             :conditional :: Only wrap multiple return values in an array
                +      #             :omit_quotes :: Do not wrap scalar strings in quotes
                +      # 
                +      #   json_op.query("$.a") # json_query(json, '$.a')
                +      #   json_op.query("$.a", passing: {a: 1}) # json_query(json, '$.a' PASSING 1 AS a)
                +      #   json_op.query("$.a", on_error: :empty_array) # json_query(json, '$.a' EMPTY ARRAY ON ERROR)
                +      #   json_op.query("$.a", returning: Time) # json_query(json, '$.a' RETURNING timestamp)
                +      #   json_op.query("$.a", on_empty: 2) # json_query(json, '$.a' DEFAULT 2 ON EMPTY)
                +      #   json_op.query("$.a", wrapper: true) # json_query(json, '$.a' WITH WRAPPER)
                +      def query(path, opts=OPTS)
                +        self.class.new(JSONQueryOp.new(self, path, opts))
                +      end
                +
                @@ -331,0 +390,28 @@
                +      # If called without arguments, operates as SQL::Wrapper#value.  Otherwise, 
                +      # return the result of applying the JSON path expression to the receiver, by default
                +      # returning results as text.  Options:
                +      #
                +      # :on_empty :: How to handle case where path expression yields an empty set.
                +      #              Uses same values as :on_error option.
                +      # :on_error :: How to handle errors when evaluating the JSON path expression.
                +      #              :null :: Return nil (default)
                +      #              :error :: raise a DatabaseError
                +      #              any other value :: used as default value
                +      # :passing :: Variables to pass to the JSON path expression.  Keys are variable
                +      #             names, values are the values of the variable.
                +      # :returning :: The data type to return (text by default)
                +      # 
                +      #   json_op.value("$.a") # json_value(json, '$.a')
                +      #   json_op.value("$.a", passing: {a: 1}) # json_value(json, '$.a' PASSING 1 AS a)
                +      #   json_op.value("$.a", on_error: :error) # json_value(json, '$.a' ERROR ON ERROR)
                +      #   json_op.value("$.a", returning: Time) # json_value(json, '$.a' RETURNING timestamp)
                +      #   json_op.value("$.a", on_empty: 2) # json_value(json, '$.a' DEFAULT 2 ON EMPTY)
                +      def value(path=(no_args_given = true), opts=OPTS)
                +        if no_args_given
                +          # Act as SQL::Wrapper#value
                +          super()
                +        else
                +          Sequel::SQL::StringExpression.new(:NOOP, JSONValueOp.new(self, path, opts))
                +        end
                +      end
                +
                @@ -704,0 +791,241 @@
                +      end
                +    end
                +
                +    # Object representing json_exists calls
                +    class JSONExistsOp < SQL::Expression
                +      ON_ERROR_SQL = {
                +        true => 'TRUE',
                +        false => 'FALSE',
                +        :null =>  'UNKNOWN',
                +        :error => 'ERROR',
                +      }.freeze
                +      private_constant :ON_ERROR_SQL
                +
                +      # Expression (context_item in PostgreSQL terms), usually JSONBaseOp instance
                +      attr_reader :expr
                +
                +      # JSON path expression to apply against the expression
                +      attr_reader :path
                +
                +      # Variables to set in the JSON path expression
                +      attr_reader :passing
                +
                +      # How to handle errors when evaluating the JSON path expression
                +      attr_reader :on_error
                +
                +      # See JSONBaseOp#exists for documentation on the options.
                +      def initialize(expr, path, opts=OPTS)
                +        @expr = expr
                +        @path = path
                +        @passing = opts[:passing]
                +        @on_error = opts[:on_error]
                +        freeze
                +      end
                +
                +      # Append the SQL function call expression to the SQL
                +      def to_s_append(ds, sql)
                +        to_s_append_function_name(ds, sql)
                +        to_s_append_args_passing(ds, sql)
                +        to_s_append_on_error(ds, sql)
                +        sql << ')'
                +      end
                +
                +      # Support transforming of function call expression
                +      def sequel_ast_transform(transformer)
                +        opts = {}
                +        transform_opts(transformer, opts)
                +        self.class.new(transformer.call(@expr), @path, opts)
                +      end
                +
                +      private
                +
                +      # Set the :passing and :on_error options when doing an
                +      # AST transform.
                +      def transform_opts(transformer, opts)
                +        if @passing
                +          passing = opts[:passing] = {}
                +          @passing.each do |k, v|
                +            passing[k] = transformer.call(v)
                +          end
                +        end
                +
                +        opts[:on_error] = @on_error
                +      end
                +      
                +      def to_s_append_function_name(ds, sql)
                +        sql << 'json_exists('
                +      end
                +
                +      # Append the expression, path, and optional PASSING fragments
                +      def to_s_append_args_passing(ds, sql)
                +        ds.literal_append(sql, @expr)
                +        sql << ', '
                +        ds.literal_append(sql, @path)
                +
                +        if (passing = @passing) && !passing.empty?
                +          sql << ' PASSING '
                +          comma = false
                +          passing.each do |k, v|
                +            if comma
                +              sql << ', '
                +            else
                +              comma = true
                +            end
                +            ds.literal_append(sql, v)
                +            sql << " AS " << k.to_s
                +          end
                +        end
                +      end
                +
                +      # Append the optional ON ERROR fragments
                +      def to_s_append_on_error(ds, sql)
                +        unless @on_error.nil?
                +          sql << " "
                +          to_s_append_on_value(ds, sql, @on_error)
                +          sql << " ON ERROR"
                +        end
                +      end
                +
                +      # Append the value to use for ON ERROR
                +      def to_s_append_on_value(ds, sql, value)
                +        sql << ON_ERROR_SQL.fetch(value)
                +      end
                +    end
                +
                +    # Object representing json_value calls
                +    class JSONValueOp < JSONExistsOp
                +      ON_SQL = {
                +        :null =>  'NULL',
                +        :error => 'ERROR',
                +      }.freeze
                +      private_constant :ON_SQL
                +
                +      # The database type to cast returned values to
                +      attr_reader :returning
                +
                +      # How to handle cases where the JSON path expression evaluation yields
                +      # an empty set.
                +      attr_reader :on_empty
                +
                +      # See JSONBaseOp#value for documentation of the options.
                +      def initialize(expr, path, opts=OPTS)
                +        @returning = opts[:returning]
                +        @on_empty = opts[:on_empty]
                +        super
                +      end
                +
                +      private
                +
                +      # Also handle transforming the returning and on_empty options.
                +      def transform_opts(transformer, opts)
                +        super
                +        opts[:returning] = @returning
                +        on_error = @on_error
                +        on_error = transformer.call(on_error) unless on_sql_value(on_error)
                +        opts[:on_error] = on_error
                +        on_empty = @on_empty
                +        on_empty = transformer.call(on_empty) unless on_sql_value(on_empty)
                +        opts[:on_empty] = on_empty
                +      end
                +      
                +      def to_s_append_function_name(ds, sql)
                +        sql << 'json_value('
                +      end
                +
                +      # Also append the optional RETURNING fragment
                +      def to_s_append_args_passing(ds, sql)
                +        super
                +
                +        if @returning
                +          sql << ' RETURNING ' << ds.db.cast_type_literal(@returning).to_s
                +        end
                +      end
                +
                +      # Also append the optional ON EMPTY fragment
                +      def to_s_append_on_error(ds, sql)
                +        unless @on_empty.nil?
                +          sql << " "
                +          to_s_append_on_value(ds, sql, @on_empty)
                +          sql << " ON EMPTY"
                +        end
                +
                +        super
                +      end
                +
                +      # Handle DEFAULT values in ON EMPTY/ON ERROR fragments
                +      def to_s_append_on_value(ds, sql, value)
                +        if v = on_sql_value(value)
                +          sql << v
                +        else
                +          sql << 'DEFAULT '
                +          default_literal_append(ds, sql, value)
                +        end
                +      end
                +
                +      # Do not auto paramterize default value, as PostgreSQL doesn't allow it.
                +      def default_literal_append(ds, sql, v)
                +        if sql.respond_to?(:skip_auto_param)
                +          sql.skip_auto_param do
                +            ds.literal_append(sql, v)
                +          end
                +        else
                +          ds.literal_append(sql, v)
                +        end
                +      end
                +
                +      def on_sql_value(value)
                +        ON_SQL[value]
                +      end
                +    end
                +
                +    # Object representing json_query calls
                +    class JSONQueryOp < JSONValueOp
                +      ON_SQL = {
                +        :null =>  'NULL',
                +        :error => 'ERROR',
                +        :empty_array => 'EMPTY ARRAY',
                +        :empty_object => 'EMPTY OBJECT',
                +      }.freeze
                +      private_constant :ON_SQL
                +
                +      WRAPPER = {
                +        :conditional => ' WITH CONDITIONAL WRAPPER',
                +        :unconditional => ' WITH WRAPPER',
                +        :omit_quotes => ' OMIT QUOTES'
                +      }
                +      WRAPPER[true] = WRAPPER[:unconditional]
                +      WRAPPER.freeze
                +      private_constant :WRAPPER
                +
                +      # How to handle wrapping of results
                +      attr_reader :wrapper
                +
                +      # See JSONBaseOp#query for documentation of the options.
                +      def initialize(expr, path, opts=OPTS)
                +        @wrapper = opts[:wrapper]
                +        super
                +      end
                +
                +      private
                +      
                +      # Also handle transforming the wrapper option
                +      def transform_opts(transformer, opts)
                +        super
                +        opts[:wrapper] = @wrapper
                +      end
                +      
                +      def to_s_append_function_name(ds, sql)
                +        sql << 'json_query('
                +      end
                +
                +      # Also append the optional WRAPPER/OMIT QUOTES fragment
                +      def to_s_append_args_passing(ds, sql)
                +        super
                +
                +        if @wrapper
                +          sql << WRAPPER.fetch(@wrapper)
                +        end
                +      end
                +
                +      def on_sql_value(value)
                +        ON_SQL[value]
        lib/sequel/sql.rb
                --- /tmp/d20240902-2174-12qwj9/sequel-5.83.1/lib/sequel/sql.rb	2024-09-02 02:26:29.375059531 +0000
                +++ /tmp/d20240902-2174-12qwj9/sequel-5.84.0/lib/sequel/sql.rb	2024-09-02 02:26:29.527061663 +0000
                @@ -156 +156 @@
                -      OPERTATOR_INVERSIONS = {:AND => :OR, :OR => :AND, :< => :>=, :> => :<=,
                +      OPERATOR_INVERSIONS = {:AND => :OR, :OR => :AND, :< => :>=, :> => :<=,
                @@ -162,0 +163,3 @@
                +      # SEQUEL6: Remove
                +      OPERTATOR_INVERSIONS = OPERATOR_INVERSIONS
                +
                @@ -1145 +1148 @@
                -            BooleanExpression.new(OPERTATOR_INVERSIONS[op], *ce.args.map{|a| BooleanExpression.invert(a)})
                +            BooleanExpression.new(OPERATOR_INVERSIONS[op], *ce.args.map{|a| BooleanExpression.invert(a)})
                @@ -1147 +1150 @@
                -            BooleanExpression.new(OPERTATOR_INVERSIONS[op], *ce.args.dup)
                +            BooleanExpression.new(OPERATOR_INVERSIONS[op], *ce.args.dup)
                @@ -1156 +1159 @@
                -                BooleanExpression.new(OPERTATOR_INVERSIONS[op], *ce.args.dup)
                +                BooleanExpression.new(OPERATOR_INVERSIONS[op], *ce.args.dup)
                @@ -1159 +1162 @@
                -              BooleanExpression.new(OPERTATOR_INVERSIONS[op], *ce.args.dup)
                +              BooleanExpression.new(OPERATOR_INVERSIONS[op], *ce.args.dup)
        lib/sequel/version.rb
                --- /tmp/d20240902-2174-12qwj9/sequel-5.83.1/lib/sequel/version.rb	2024-09-02 02:26:29.375059531 +0000
                +++ /tmp/d20240902-2174-12qwj9/sequel-5.84.0/lib/sequel/version.rb	2024-09-02 02:26:29.527061663 +0000
                @@ -9 +9 @@
                -  MINOR = 83
                +  MINOR = 84
                @@ -13 +13 @@
                -  TINY  = 1
                +  TINY  = 0

@dependabot dependabot bot force-pushed the dependabot/bundler/sequel-5.84.0 branch from 20bae24 to d2e8b5d Compare September 9, 2024 05:02
@dependabot dependabot bot force-pushed the dependabot/bundler/sequel-5.84.0 branch from d2e8b5d to d41d4ab Compare September 20, 2024 08:22
Bumps [sequel](https://github.com/jeremyevans/sequel) from 5.83.1 to 5.84.0.
- [Changelog](https://github.com/jeremyevans/sequel/blob/master/CHANGELOG)
- [Commits](jeremyevans/sequel@5.83.1...5.84.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 force-pushed the dependabot/bundler/sequel-5.84.0 branch from d41d4ab to 0f174de Compare September 22, 2024 20:34
@dentarg dentarg enabled auto-merge (squash) September 22, 2024 20:36
Copy link
Contributor Author

dependabot bot commented on behalf of github Oct 2, 2024

A newer version of sequel exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@dentarg dentarg merged commit 7f42387 into main Oct 20, 2024
7 checks passed
@dentarg dentarg deleted the dependabot/bundler/sequel-5.84.0 branch October 20, 2024 21:48
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