@@ -752,6 +752,37 @@ def description= new_description
752752 patch_gapi! :description
753753 end
754754
755+ ##
756+ # The default collation of the table.
757+ #
758+ # @return [String, nil] The default collation, or `nil` if not present or the object is a
759+ # reference (see {#reference?}).
760+ #
761+ # @!group Attributes
762+ #
763+ def default_collation
764+ return nil if reference?
765+ ensure_full_data!
766+ @gapi . default_collation
767+ end
768+
769+ ##
770+ # Updates the default collation of the table.
771+ #
772+ # If the table is not a full resource representation (see
773+ # {#resource_full?}), the full representation will be retrieved before
774+ # the update to comply with ETag-based optimistic concurrency control.
775+ #
776+ # @param [String] new_default_collation The new default collation for the table.
777+ #
778+ # @!group Attributes
779+ #
780+ def default_collation = new_default_collation
781+ reload! unless resource_full?
782+ @gapi . update! default_collation : new_default_collation
783+ patch_gapi! :default_collation
784+ end
785+
755786 ##
756787 # The number of bytes in the table.
757788 #
@@ -3706,7 +3737,7 @@ def schema replace: false
37063737 # At most 1 policy tag is currently allowed.
37073738 # @param [Integer] max_length The maximum UTF-8 length of strings
37083739 # allowed in the field.
3709- # @param default_value_expression [String] The default value of a field
3740+ # @param [String] default_value_expression The default value of a field
37103741 # using a SQL expression. It can only be set for top level fields (columns).
37113742 # Use a struct or array expression to specify default value for the entire struct or
37123743 # array. The valid SQL expressions are:
@@ -3722,6 +3753,11 @@ def schema replace: false
37223753 # `ST_GEOPOINT`
37233754 # - Struct or array composed with the above allowed functions, for example:
37243755 # "[CURRENT_DATE(), DATE '2020-01-01'"]
3756+ # @param [String] collation The collation of the field.
3757+ # Collation can be set only when the type of field is `STRING`.
3758+ # The following values are supported:
3759+ # - `und:ci`: undetermined locale, case insensitive.
3760+ # - (empty string): Default to case-sensitive behavior.
37253761 #
37263762 # @example
37273763 # require "google/cloud/bigquery"
@@ -3743,9 +3779,9 @@ def schema replace: false
37433779 #
37443780 # @!group Schema
37453781 def string name , description : nil , mode : :nullable , policy_tags : nil , max_length : nil ,
3746- default_value_expression : nil
3782+ default_value_expression : nil , collation : nil
37473783 schema . string name , description : description , mode : mode , policy_tags : policy_tags , max_length : max_length ,
3748- default_value_expression : default_value_expression
3784+ default_value_expression : default_value_expression , collation : collation
37493785 end
37503786
37513787 ##
0 commit comments