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

Add ability to use symbols as field names instead of strings #306

Merged
merged 7 commits into from
Nov 21, 2019

Commits on Nov 19, 2019

  1. Add ability to use symbols as field names instead of strings

    This adds:
    * PG::Result#field_name_type=
    * PG::Result#field_name_type
    * PG::Result#field_names_as
    
    Symbol comparison and lookup is faster, since the string hash is generated at Symbol creation.
    So retrieval of Symbol based field names is somewhat slower, but this is easily outperformed in frameworks that do a lot of lookups.
    
    This raises ruby version requirement to 2.2, since it depends on GC'able symbols.
    
    Fixes ged#278
    larskanis committed Nov 19, 2019
    Configuration menu
    Copy the full SHA
    7e0814b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    df0e74d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7adc26b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8fd166a View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2019

  1. Fix compat with Truffleruby

    Truffleruby doesn't support rb_check_symbol_cstr() so far, but all symbols in Truffleruby are GC'd anyway.
    So we can use classic ID2SYM to allocate the Symbol objects.
    
    Discussed here: oracle/truffleruby#1814
    larskanis committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    57e4b6e View commit details
    Browse the repository at this point in the history
  2. Add field_name_type setter and getter to PG::Connection

    It allows to set the field name type on a connection scope.
    
    Added methods are:
        * PG::Connection#field_name_type=
        * PG::Connection#field_name_type
    larskanis committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    fb49bba View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2019

  1. Fix :static_symbol on Truffleruby

    It was using strings before.
    larskanis committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    dffb658 View commit details
    Browse the repository at this point in the history