How to use the cassandra-driver.dataTypes.text function in cassandra-driver

To help you get started, we’ve selected a few cassandra-driver 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 oaeproject / Hilary / node_modules / oae-util / lib / cassandra.js View on Github external
const _iterateAll = function(
  columnNames,
  columnFamily,
  keyColumnName,
  returnKeyColumn,
  batchSize,
  onEach,
  callback,
  fromKey
) {
  const columns = [
    { name: 'keyId', type: { code: dataTypes.text } },
    { name: 'colOne', type: { code: dataTypes.text } },
    { name: 'colTwo', type: { code: dataTypes.text } }
  ];

  const query = _buildIterateAllQuery(columnNames, columnFamily, keyColumnName, batchSize, fromKey);
  // Since Cassandra.runQuery jumps into a new process tick, there is no issue over this recursion exceeding stack size with large data-sets
  runQuery(query.query, query.parameters, (err, rows) => {
    if (err) {
      return callback(err);
    }
    if (_.isEmpty(rows)) {
      // Notify the caller that we've finished
      return callback();
    }

    const requestedRowColumns = [];
github oaeproject / Hilary / node_modules / oae-util / lib / cassandra.js View on Github external
const _iterateAll = function(
  columnNames,
  columnFamily,
  keyColumnName,
  returnKeyColumn,
  batchSize,
  onEach,
  callback,
  fromKey
) {
  const columns = [
    { name: 'keyId', type: { code: dataTypes.text } },
    { name: 'colOne', type: { code: dataTypes.text } },
    { name: 'colTwo', type: { code: dataTypes.text } }
  ];

  const query = _buildIterateAllQuery(columnNames, columnFamily, keyColumnName, batchSize, fromKey);
  // Since Cassandra.runQuery jumps into a new process tick, there is no issue over this recursion exceeding stack size with large data-sets
  runQuery(query.query, query.parameters, (err, rows) => {
    if (err) {
      return callback(err);
    }
    if (_.isEmpty(rows)) {
      // Notify the caller that we've finished
      return callback();
    }

    const requestedRowColumns = [];
    _.each(rows, row => {
      // Remember the last key to use for the next iteration