How to use the fxjs.pipe function in fxjs

To help you get started, we’ve selected a few fxjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marpple / FxSQL / src / index.js View on Github external
async TRANSACTION() {
        try {
          const client = await get_connection(pool);
          const client_query = query_fn(client);
          await BEGIN(client);
          function QUERY(texts, ...values) {
            return base_query(client_query, texts, values);
          }
          const QUERY1 = pipe(QUERY, first),
          ASSOCIATE = baseAssociate(QUERY),
          ASSOCIATE1 = pipe(ASSOCIATE, first);
          return {
            VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL,
            QUERY,
            QUERY1,
            ASSOCIATE,
            ASSOCIATE1,
            LJOIN: use_ljoin && ljoin ? await ljoin(QUERY) : null,
            COMMIT: _ => COMMIT(client),
            ROLLBACK: _ => ROLLBACK(client)
          }
        } catch (e) { throw e; }
      }
    }
github marpple / FxSQL / src / index.js View on Github external
async TRANSACTION() {
        try {
          const client = await get_connection(pool);
          const client_query = query_fn(client);
          await BEGIN(client);
          function QUERY(texts, ...values) {
            return base_query(client_query, texts, values);
          }
          const QUERY1 = pipe(QUERY, first),
          ASSOCIATE = baseAssociate(QUERY),
          ASSOCIATE1 = pipe(ASSOCIATE, first);
          return {
            VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL,
            QUERY,
            QUERY1,
            ASSOCIATE,
            ASSOCIATE1,
            LJOIN: use_ljoin && ljoin ? await ljoin(QUERY) : null,
            COMMIT: _ => COMMIT(client),
            ROLLBACK: _ => ROLLBACK(client)
          }
        } catch (e) { throw e; }
      }
    }
github marpple / FxSQL / src / index.js View on Github external
} catch (e) {
        FxSQL_DEBUG.ERROR_WITH_SQL &&
          (e.stack = `\nFxSQL_DEBUG.ERROR_WITH_SQL:\n  text: ${query.text}\n  values: ${JSON.stringify(query.values)}\n${e.stack}`);
        throw e;
      }
    }

    function QUERY(texts, ...values) {
      return base_query(pool_query, texts, values);
    }

    function END() {
      return end_pool(pool);
    }

    const QUERY1 = pipe(QUERY, first),
      ASSOCIATE = baseAssociate(QUERY),
      ASSOCIATE1 = pipe(ASSOCIATE, first);

    var ljoin = null;

    async function LOAD_LJOIN(QUERY) {
      if (!ljoin) ljoin = await load_ljoin({
        ready_sqls, add_column, tag, FxSQL_DEBUG,
        connection_info, QUERY, VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL, SQLS
      });
      return ljoin(QUERY);
    }

    return {
      POOL: pool,
      VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL, SQLS, FxSQL_DEBUG,
github marpple / FxSQL / src / index.js View on Github external
    query_fn: pool => pipe(pool.query.bind(pool), res => res.rows),
github marpple / FxSQL / src / index.js View on Github external
(e.stack = `\nFxSQL_DEBUG.ERROR_WITH_SQL:\n  text: ${query.text}\n  values: ${JSON.stringify(query.values)}\n${e.stack}`);
        throw e;
      }
    }

    function QUERY(texts, ...values) {
      return base_query(pool_query, texts, values);
    }

    function END() {
      return end_pool(pool);
    }

    const QUERY1 = pipe(QUERY, first),
      ASSOCIATE = baseAssociate(QUERY),
      ASSOCIATE1 = pipe(ASSOCIATE, first);

    var ljoin = null;

    async function LOAD_LJOIN(QUERY) {
      if (!ljoin) ljoin = await load_ljoin({
        ready_sqls, add_column, tag, FxSQL_DEBUG,
        connection_info, QUERY, VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL, SQLS
      });
      return ljoin(QUERY);
    }

    return {
      POOL: pool,
      VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL, SQLS, FxSQL_DEBUG,
      QUERY,
      QUERY1,