title: How to sort ENUM field order and set relation table condition to PostgreSQL with TypeORM?
body: <p>About Enum filed sort, if use MySQL, this way can sort ENUM field order:</p>
  <pre class="lang-sql prettyprint-override"><code>ORDER BY FIELD(code, 'USD','CAD','AUD','BBD','EUR', 'GBP')
  </code></pre>
  <p>For PostgreSQL, maybe there isn't a built-in method, but this way works:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM currency_codes
    ORDER BY
    CASE
      WHEN code='USD' THEN 1
      WHEN code='CAD' THEN 2
      WHEN code='AUD' THEN 3
      WHEN code='BBD' THEN 4
      WHEN code='EUR' THEN 5
      WHEN code='GBP' THEN 6
      ELSE 7
    END,name;
  </code></pre>
  <p>How to do it with TypeORM? I didn't find a <code>field</code> function there.</p>
  <p>About set relation table condition to find method, I tried this way below(<code>andWhere</code> block)</p>
  <pre class="lang-js prettyprint-override"><code>const [items, total] = await this.findAndCount({
    where: {
      enable: true,
    },
    join: {
      alias: 'posts',
      innerJoinAndSelect: {
        category: 'posts.category',
      },
    },
    //andWhere: {
    //  'category.post_id': In(params.postId), // It doesn't work
    //},
    order: { CASE WHEN code='USD' THEN 1 ... }, // It doesn't work
  });
  </code></pre>