Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Slouch on Akiban

Slouch on Akiban

Padraig O'Sullivan

February 11, 2013
Tweet

More Decks by Padraig O'Sullivan

Other Decks in Technology

Transcript

  1. select * from hopes limit 1; -[ RECORD 1 ]-

    id | 38290295- aed4-417f-90bf-8c6d1d730e6d data | {"desc":"raspberry beret", “date”:”12-02-2013-02-11T23:03:54” ,“bumpcount:3}
  2. CREATE TABLE hopes ( id varchar(128) primary key, “desc” varchar(128),

    “date” varchar(128), bumpcount int ); akiban
  3. select * from hopes limit 1; -[ RECORD 1 ]-

    id | 38290295- aed4-417f-90bf-8c6d1d730e6d desc | raspberry beret date | 12-02-2013-02-11T23:03:54 bumpcount | 3
  4. select * from hopes limit 1; -[ RECORD 1 ]-

    JSON | {"id":” 38290295- aed4-417f-90bf-8c6d1d730e6d”,"desc ":"raspberry beret","date":"2013-02-11T23:03:54 ","bumpcount":3}
  5. CREATE  PROCEDURE  avg_bump_count_func(OUT  ans  DOUBLE)    LANGUAGE  javascript  PARAMETER  STYLE

     variables  AS  $$        function  avg_bump_count()  {            var  conn  =   java.sql.DriverManager.getConnection("jdbc:default:connection ",  "test",  "");            var  ps  =  conn.prepareStatement("SELECT  avg(bumpcount)   FROM  hopes");            var  rs  =  ps.executeQuery();            rs.next();            return  rs.getDouble(1);        }        ans  =  avg_bump_count();    $$;