title: Selecting data from table with UUID as binary()
body: <p>I have an AWS RDS Aurora MySQL connection. Following are the steps that I'm following to operate create, insert &amp; fetch the data:</p>
  <p><strong>create table</strong>:</p>
  <pre><code>CREATE TABLE user (
      user_id BINARY(16) PRIMARY KEY NOT NULL,
      first_name VARCHAR(25) NOT NULL, 
      last_name VARCHAR(25) NOT NULL,
  );
  </code></pre>
  <p><strong>insert into table</strong>:</p>
  <pre><code>INSERT INTO user VALUES (
      UNHEX(REPLACE(&quot;9a9cbfga-7426-471a-af27-31be7tb53ii2&quot;, &quot;-&quot;,&quot;&quot;)),
      &quot;Jon&quot;,
      &quot;Smith&quot;
  );
  </code></pre>
  <p><strong>fetch from table</strong>:</p>
  <pre><code>SELECT * FROM user WHERE user_id = UNHEX(REPLACE(&quot;9a9cbfga-7426-471a-af27-31be7tb53ii2&quot;, &quot;-&quot;,&quot;&quot;));
  </code></pre>
  <p>The handler function that triggers my function to fetch the data goes like:</p>
  <pre><code>module.exports.fetchUser = async (event, context, callback) =&gt; {
  
    const params = {
      resourceArn: 'arn:aws:rds:*********:cluster:************',
      secretArn: 'arn:aws:secretsmanager:*************',
      sql: 'SELECT * FROM user WHERE user_id = UNHEX(REPLACE(&quot;9a9cbfga-7426-471a-af27-31be7tb53ii2&quot;, &quot;-&quot;,&quot;&quot;))',
      database: 'dev_db1',
      continueAfterTimeout: true,
      includeResultMetadata: true
    }
  
    try {
      const db_res = await rdsDataService.executeStatement(params).promise();
  
      const response = {
        body: {
          message: 'Data fetched',
          data: JSON.stringify(db_res, null, 2)
        }
      };
      callback(null, response);
    } catch (error) {
      callback(null, error)
    }
  };
  </code></pre>
  <p>Executing the http data API endpoint for the same results me in this:</p>
  <pre><code>{
      &quot;body&quot;: {
          &quot;message&quot;: &quot;Data fetched&quot;,
          &quot;data&quot;: [
              [
                  {
                      &quot;blobValue&quot;: {
                          &quot;type&quot;: &quot;Buffer&quot;,
                          &quot;data&quot;: [
                              202,
                              136,
                              22,
                              206,
                              45,
                              214,
                              75,
                              233,
                              156,
                              28,
                              163,
                              223,
                              186,
                              115,
                              89,
                              107
                          ]
                      }
                  },
                  {
                      &quot;stringValue&quot;: &quot;Jon&quot;
                  },
                  {
                      &quot;stringValue&quot;: &quot;Smith&quot;
                  },
              ]
          ]
      }
  }
  </code></pre>
  <p>All I need is to fetch the complete details of all the users (for now I've inserted just one record for ease) in the table <code>user</code> and show the exact <code>user_id</code> instead of the <code>blobValue</code>. Not sure how to convert this UUID binary into redable form like <code>9a9cbfga7426471aaf2731be7tb53ii2</code> or <code>9a9cbfga-7426-471a-af27-31be7tb53ii2</code> in the response.
  I'am bit new to handling queries in MYSQL &amp; Aurora, any help to get me through this will be really appretiated. Thanks in advance.</p>