rubydatabasegriddb

How do you start GridDB client in Ruby?


I want to configure the database system https://github.com/griddb/griddb in Ruby. However, I am a relative new in this space. What are the starting points?


Solution

  • Preparations Install SWIG as below.

    $ wget https://sourceforge.net/projects/pcre/files/pcre/8.39/pcre-8.39.tar.gz
    $ tar xvfz pcre-8.39.tar.gz
    $ cd pcre-8.39
    $ ./configure
    $ make
    $ make install
    
    $ wget https://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz
    $ tar xvfz swig-3.0.12.tar.gz
    $ cd swig-3.0.12
    $ ./configure
    $ make
    $ make install
    

    Install Ruby and GridDB C Client. If required, change INCLUDES_RUBY path in Makefile. Set LIBRARY_PATH.

    export LIBRARY_PATH=$LIBRARY_PATH:<C client library file directory path>
    

    Build and Run

    1. Execute the command on project directory.

      $ make

    2. Set the RUBYLIB variable for griddb griddb_ruby.so module files.

      $ export RUBYLIB=

    How to run sample GridDB Server need to be started in advance.

    1. Set LD_LIBRARY_PATH

      export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:

    2. The command to run sample

      $ ruby sample/sample.rb -->['name01', false, 1, 'ABCDEFGHIJ' ]

    Function

    (available)

    STRING, BOOL, BYTE, SHORT, INTEGER, LONG, FLOAT, DOUBLE, TIMESTAMP, BLOB type for GridDB put single row, get row with key normal query, aggregation with TQL (not available)

    Multi-Put/Get/Query (batch processing) GEOMETRY, Array type for GridDB timeseries compression timeseries-specific function like gsAggregateTimeSeries, gsQueryByTimeSeriesSampling in C client trigger, affinity

    Please refer to the following files for more detailed information.

    Ruby Client API Reference.