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

fix: dont use virtual key for UPDATE … where (<key>) in <subquery> #800

Merged
merged 10 commits into from
Sep 12, 2024

Commits on Sep 7, 2024

  1. fix: dont use virtual key elements for UPDATE where condition

    For a draft enabled model:
    
    ```
    namespace my;
    
    entity Books {
      key ID : Integer;
      title  : String;
      stock  : Integer;
      author : Association to Authors;
    }
    
    entity Authors {
      key ID : Integer;
      name   : String;
      alive  : Boolean;
    }
    
    service CatalogService {
        @odata.draft.enabled
        @readonly entity Books as projection on my.Books;
    
        @readonly entity Authors as projection on my.Authors;
    }
    ```
    
    `my.Books` will have a field:
    ```
            "IsActiveEntity": {
              "type": "cds.Boolean",
              "key": true,
              "default": {
                "val": true
              },
              "@UI.Hidden": true
            },
    ```
    
    which is marked as virtual by the lean draft implementation.
    This virtual key must not be part of the primary key matching
    which is done for a path expression in a `UPDATE.where`:
    
    https://github.com/cap-js/cds-dbs/blob/982b8b796da4b577c5641039d2036816209c0437/db-service/test/cqn4sql/UPDATE.test.js#L73-L97
    
    TODO:
    
    - [] test this
    patricebender committed Sep 7, 2024
    Configuration menu
    Copy the full SHA
    233af38 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. add test

    patricebender committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    893a863 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1051200 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2024

  1. add end 2 end test

    patricebender committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    0c193c4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b7cec64 View commit details
    Browse the repository at this point in the history
  3. trailing ws

    patricebender committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    a756755 View commit details
    Browse the repository at this point in the history
  4. remove annotation

    patricebender committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    d46bce8 View commit details
    Browse the repository at this point in the history
  5. indent

    patricebender committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    2564fb7 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2024

  1. Configuration menu
    Copy the full SHA
    300296f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    84eb84c View commit details
    Browse the repository at this point in the history