pakyow-data 1.0.1 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -2
- data/lib/pakyow/data/adapters/sql.rb +3 -3
- data/lib/pakyow/data/adapters/sql/types.rb +2 -2
- data/lib/pakyow/data/container.rb +2 -2
- data/lib/pakyow/data/migrator.rb +6 -6
- data/lib/pakyow/data/sources/relational.rb +4 -0
- data/lib/pakyow/data/sources/relational/command.rb +1 -1
- metadata +14 -14
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f043711209f0fd8d1eb2f2b07ad93e7085b50f71e4f64e5a79450617f5756fdf
         | 
| 4 | 
            +
              data.tar.gz: 67f5d2ef32052052f2554eb2e8ec3f3f1589707b0cc35dcb8f5df4d3aa380f7c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 7caef27c02c9817f97955f4f67c9cf22b8573a65f8be28e83d7eed934fa3494c773e7d961bf57ec26325bf78691767c5b839bdec0798ba3cbe09beada47a716c
         | 
| 7 | 
            +
              data.tar.gz: 58e46b03bcf37e00cba1c299b9de4bb8739dacf8d800fddaf0774a0df14a1df588a41dea213e738bbae80d2ac504657fbc48f587a3477a04490c10ef846bf560
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,30 @@ | |
| 1 | 
            -
            #  | 
| 1 | 
            +
            # v1.0.2
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
              * `fix` **Data types are now compatible with `dry-types` v1.2.0.**
         | 
| 4 | 
            +
             | 
| 5 | 
            +
                *Related links:*
         | 
| 6 | 
            +
                - [Pull Request #305][pr-305]
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              * `fix` **Associating sources across connections now works correctly.**
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                *Related links:*
         | 
| 11 | 
            +
                - [Commit 4c8c544][4c8c544]
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              * `fix` **Setting up associations of different types for the same source now works correctly.**
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                *Related links:*
         | 
| 16 | 
            +
                - [Commit 12fafe0][12fafe0]
         | 
| 17 | 
            +
             | 
| 18 | 
            +
              * `fix` **Fetching one then all now correctly includes associated data.**
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                *Related links:*
         | 
| 21 | 
            +
                - [Commit 546e92a][546e92a]
         | 
| 22 | 
            +
             | 
| 23 | 
            +
            [pr-305]: https://github.com/pakyow/pakyow/pull/305
         | 
| 24 | 
            +
            [4c8c544]: https://github.com/pakyow/pakyow/commit/4c8c544cd7ec91ffe9ec6d4bb72e14699b59357d
         | 
| 25 | 
            +
            [12fafe0]: https://github.com/pakyow/pakyow/commit/12fafe0ae1e65e15bd9c78b674bb36ef3bee95f3
         | 
| 26 | 
            +
            [546e92a]: https://github.com/pakyow/pakyow/commit/546e92a02d840f7586439f0abe6a9a56c533d062
         | 
| 27 | 
            +
             | 
| 28 | 
            +
            # v1.0.0
         | 
| 4 29 |  | 
| 5 30 | 
             
              * Hello, Web
         | 
| @@ -31,9 +31,9 @@ module Pakyow | |
| 31 31 | 
             
                      time: Data::Types::MAPPING[:time].meta(database_type: Time, column_type: :datetime),
         | 
| 32 32 |  | 
| 33 33 | 
             
                      # sql-specific types
         | 
| 34 | 
            -
                      file: Types.Constructor(Sequel::SQL::Blob).meta(mapping: :file, database_type: File, column_type: :blob),
         | 
| 35 | 
            -
                      text: Types::Coercible::String.meta(mapping: :text, database_type: :text, column_type: :text, native_type: "text"),
         | 
| 36 | 
            -
                      bignum: Types::Coercible::Integer.meta(mapping: :bignum, database_type: :Bignum)
         | 
| 34 | 
            +
                      file: Data::Types.Constructor(Sequel::SQL::Blob).meta(mapping: :file, database_type: File, column_type: :blob),
         | 
| 35 | 
            +
                      text: Data::Types::Coercible::String.meta(mapping: :text, database_type: :text, column_type: :text, native_type: "text"),
         | 
| 36 | 
            +
                      bignum: Data::Types::Coercible::Integer.meta(mapping: :bignum, database_type: :Bignum)
         | 
| 37 37 | 
             
                    }.freeze
         | 
| 38 38 |  | 
| 39 39 | 
             
                    require "pakyow/data/adapters/sql/types"
         | 
| @@ -13,9 +13,9 @@ module Pakyow | |
| 13 13 | 
             
                          string: Sql::TYPES[:string].meta(native_type: "text"),
         | 
| 14 14 | 
             
                          text: Sql::TYPES[:text].meta(column_type: :string),
         | 
| 15 15 |  | 
| 16 | 
            -
                          json: Pakyow::Data::Types.Constructor( | 
| 16 | 
            +
                          json: Pakyow::Data::Types.Constructor(::Object) { |value|
         | 
| 17 17 | 
             
                            Sequel.pg_json(value)
         | 
| 18 | 
            -
                          }.meta(mapping: :json, database_type: :json)
         | 
| 18 | 
            +
                          }.meta(mapping: :json, database_type: :json, column_type: :json)
         | 
| 19 19 | 
             
                        }.freeze
         | 
| 20 20 | 
             
                      end
         | 
| 21 21 |  | 
| @@ -172,11 +172,11 @@ module Pakyow | |
| 172 172 | 
             
                            end
         | 
| 173 173 |  | 
| 174 174 | 
             
                            unless association.internal?
         | 
| 175 | 
            -
                              unless associated_source.associations[association.specific_type].any? { |current_association| current_association.joining_source_name == association.joining_source_name }
         | 
| 175 | 
            +
                              unless associated_source.associations[association.specific_type].any? { |current_association| current_association.type == :through && current_association.joining_source_name == association.joining_source_name }
         | 
| 176 176 | 
             
                                associated_source.send(association.specific_type, association.associated_name, source: source.plural_name, as: association.left_name, through: association.joining_source_name, dependent: association.dependent)
         | 
| 177 177 | 
             
                              end
         | 
| 178 178 |  | 
| 179 | 
            -
                              unless source.associations[association.specific_type].any? { |current_association| current_association.associated_source_name == association.joining_source_name }
         | 
| 179 | 
            +
                              unless source.associations[association.specific_type].any? { |current_association| current_association.type == :through && current_association.associated_source_name == association.joining_source_name }
         | 
| 180 180 | 
             
                                source.send(association.specific_type, association.joining_source_name, source: joining_source.plural_name, as: Support.inflector.singularize(association.associated_name), dependent: association.dependent)
         | 
| 181 181 | 
             
                              end
         | 
| 182 182 | 
             
                            end
         | 
    
        data/lib/pakyow/data/migrator.rb
    CHANGED
    
    | @@ -132,7 +132,7 @@ module Pakyow | |
| 132 132 | 
             
                      )
         | 
| 133 133 |  | 
| 134 134 | 
             
                      merge_connection_overrides!(connection_opts, connection_overrides)
         | 
| 135 | 
            -
                       | 
| 135 | 
            +
                      connect_raw(opts: connection_opts, type: adapter, name: connection)
         | 
| 136 136 | 
             
                    end
         | 
| 137 137 |  | 
| 138 138 | 
             
                    def connect_global(adapter:, connection:, connection_overrides: {})
         | 
| @@ -154,12 +154,12 @@ module Pakyow | |
| 154 154 |  | 
| 155 155 | 
             
                      merge_connection_overrides!(connection_opts, connection_overrides)
         | 
| 156 156 | 
             
                      globalize_connection_opts!(adapter, connection_opts)
         | 
| 157 | 
            +
                      connect_raw(opts: connection_opts, type: adapter, name: connection)
         | 
| 158 | 
            +
                    end
         | 
| 157 159 |  | 
| 158 | 
            -
             | 
| 159 | 
            -
             | 
| 160 | 
            -
             | 
| 161 | 
            -
                        connection_overrides: connection_opts
         | 
| 162 | 
            -
                      )
         | 
| 160 | 
            +
                    # @api private
         | 
| 161 | 
            +
                    def connect_raw(opts:, type:, name:)
         | 
| 162 | 
            +
                      new(Connection.new(opts: opts, type: type, name: name))
         | 
| 163 163 | 
             
                    end
         | 
| 164 164 |  | 
| 165 165 | 
             
                    private
         | 
| @@ -289,6 +289,10 @@ module Pakyow | |
| 289 289 |  | 
| 290 290 | 
             
                    def include_results!(results)
         | 
| 291 291 | 
             
                      @included.each do |association, combined_source|
         | 
| 292 | 
            +
                        combined_source = combined_source.source_from_self(
         | 
| 293 | 
            +
                          combined_source.__getobj__.dup
         | 
| 294 | 
            +
                        )
         | 
| 295 | 
            +
             | 
| 292 296 | 
             
                        group_by_key, assign_by_key, remove_keys = if association.type == :through
         | 
| 293 297 | 
             
                          joining_source = association.joining_source.instance
         | 
| 294 298 |  | 
| @@ -101,7 +101,7 @@ module Pakyow | |
| 101 101 |  | 
| 102 102 | 
             
                            case association_value
         | 
| 103 103 | 
             
                            when Proxy
         | 
| 104 | 
            -
                              if association_value.source.class == association.associated_source
         | 
| 104 | 
            +
                              if association_value.source.class.__object_name.name == association.associated_source.__object_name.name
         | 
| 105 105 | 
             
                                if association.result_type == :one && (association_value.count > 1 || (@updates && @source.count > 1))
         | 
| 106 106 | 
             
                                  raise ConstraintViolation.new_with_message(
         | 
| 107 107 | 
             
                                    :associate_multiple,
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: pakyow-data
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Bryan Powell
         | 
| 8 | 
            -
            autorequire: | 
| 8 | 
            +
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2020-09-03 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: pakyow-core
         | 
| @@ -16,28 +16,28 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - '='
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: 1.0. | 
| 19 | 
            +
                    version: 1.0.6
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - '='
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: 1.0. | 
| 26 | 
            +
                    version: 1.0.6
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: pakyow-support
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 30 | 
             
                requirements:
         | 
| 31 31 | 
             
                - - '='
         | 
| 32 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            -
                    version: 1.0. | 
| 33 | 
            +
                    version: 1.0.6
         | 
| 34 34 | 
             
              type: :runtime
         | 
| 35 35 | 
             
              prerelease: false
         | 
| 36 36 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 37 | 
             
                requirements:
         | 
| 38 38 | 
             
                - - '='
         | 
| 39 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            -
                    version: 1.0. | 
| 40 | 
            +
                    version: 1.0.6
         | 
| 41 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 42 42 | 
             
              name: concurrent-ruby
         | 
| 43 43 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -72,14 +72,14 @@ dependencies: | |
| 72 72 | 
             
                requirements:
         | 
| 73 73 | 
             
                - - "~>"
         | 
| 74 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            -
                    version: '1. | 
| 75 | 
            +
                    version: '1.2'
         | 
| 76 76 | 
             
              type: :runtime
         | 
| 77 77 | 
             
              prerelease: false
         | 
| 78 78 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 79 | 
             
                requirements:
         | 
| 80 80 | 
             
                - - "~>"
         | 
| 81 81 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            -
                    version: '1. | 
| 82 | 
            +
                    version: '1.2'
         | 
| 83 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 84 84 | 
             
              name: redis
         | 
| 85 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -100,14 +100,14 @@ dependencies: | |
| 100 100 | 
             
                requirements:
         | 
| 101 101 | 
             
                - - "~>"
         | 
| 102 102 | 
             
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            -
                    version: '5. | 
| 103 | 
            +
                    version: '5.26'
         | 
| 104 104 | 
             
              type: :runtime
         | 
| 105 105 | 
             
              prerelease: false
         | 
| 106 106 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 107 | 
             
                requirements:
         | 
| 108 108 | 
             
                - - "~>"
         | 
| 109 109 | 
             
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            -
                    version: '5. | 
| 110 | 
            +
                    version: '5.26'
         | 
| 111 111 | 
             
            description: Data persistence layer for Pakyow
         | 
| 112 112 | 
             
            email: bryan@bryanp.org
         | 
| 113 113 | 
             
            executables: []
         | 
| @@ -178,7 +178,7 @@ homepage: https://pakyow.com | |
| 178 178 | 
             
            licenses:
         | 
| 179 179 | 
             
            - LGPL-3.0
         | 
| 180 180 | 
             
            metadata: {}
         | 
| 181 | 
            -
            post_install_message: | 
| 181 | 
            +
            post_install_message:
         | 
| 182 182 | 
             
            rdoc_options: []
         | 
| 183 183 | 
             
            require_paths:
         | 
| 184 184 | 
             
            - lib
         | 
| @@ -193,8 +193,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 193 193 | 
             
                - !ruby/object:Gem::Version
         | 
| 194 194 | 
             
                  version: '0'
         | 
| 195 195 | 
             
            requirements: []
         | 
| 196 | 
            -
            rubygems_version: 3. | 
| 197 | 
            -
            signing_key: | 
| 196 | 
            +
            rubygems_version: 3.1.2
         | 
| 197 | 
            +
            signing_key:
         | 
| 198 198 | 
             
            specification_version: 4
         | 
| 199 199 | 
             
            summary: Pakyow Data
         | 
| 200 200 | 
             
            test_files: []
         |