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

[API-875] Deserialize SqlRows lazily #472

Merged
merged 1 commit into from
Sep 16, 2021

Commits on Sep 16, 2021

  1. Deserialize SqlRows lazily

    This is a required change to be able to use parts of the row,
    even if we cannot deserialize some column values.
    
    Also, lazy deserialization is a plus on its own.
    
    To accomplish this, similar to the Java client, I have changed the
    code so that, we try to deserialize column values when we
    call `get_object` or `get_object_with_index`. Note that,
    just like the Java client
    
    ```
    row.get_object("smth")
    row.get_object("smth")
    ```
    
    will result in two deserializations.
    We could easily solve this with an extra object per row (something
    like LazyDeserializable class with two fields: serialized and deserialized
    where once we deserialize it, it assigns the result to deserialized and
    return it for the subsequent calls). But, I didn't want to go that way due
    to extra object cost.
    mdumandag committed Sep 16, 2021
    Configuration menu
    Copy the full SHA
    7b39199 View commit details
    Browse the repository at this point in the history