postgres/client.js
function put(key, value) {
  const { schema, table } = findSchemaAndTable(key),
    map = columnToValueMap('id', key); // create the value map

  // add data to the map
  columnToValueMap('data', wrapInObject(key, parseOrNot(value)), map);

  let url;

  if (isUri(key)) {
    url = decode(key.split('/_uris/').pop());

    // add url column to map if we're PUTting a uri
    columnToValueMap('url', url, map);
  }


  return onConflictPut(map, schema, table)
    .then(() => map.data);
}
function put(key, value) {
  const { schema, table } = findSchemaAndTable(key),
    map = columnToValueMap('id', key); // create the value map

  // add data to the map
  columnToValueMap('data', wrapInObject(key, parseOrNot(value)), map);

  let url;

  if (isUri(key)) {
    url = decode(key.split('/_uris/').pop());

    // add url column to map if we're PUTting a uri
    columnToValueMap('url', url, map);
  }


  return onConflictPut(map, schema, table)
    .then(() => map.data);
}
function put ( key , value ) { const { schema , table } = findSchemaAndTable ( key ) , map = columnToValueMap ( 'id' , key ) ; // create the value map // add data to the map columnToValueMap ( 'data' , wrapInObject ( key , parseOrNot ( value ) ) , map ) ; let url ; if ( isUri ( key ) ) { url = decode ( key . split ( '/_uris/' ) . pop ( ) ) ; // add url column to map if we're PUTting a uri columnToValueMap ( 'url' , url , map ) ; } return onConflictPut ( map , schema , table ) . then ( ( ) => map . data ) ; }
Insert a row into the DB

@param  {String} key
@param  {Object} value
@return {Promise}
Insert a row into the DB