node-cassandra-cql

程序名称:node-cassandra-cql

授权协议: MIT/X

操作系统: 跨平台

开发语言: JavaScript

node-cassandra-cql 介绍

node-cassandra-cql 是一个 Apache Cassandra
CQL3 二进制协议的 Node.js CQL 驱动。CQL 是 Cassandra
查询语言。该项目提供到多个主机的连接池、查询参数,以及可通过列名获取数值和支持 bigint。

示例代码

// Creating a new connection pool to multiple hosts.
var cql = require('node-cassandra-cql');
var client = new cql.Client({hosts: ['host1:9042', 'host2:9042'], keyspace: 'keyspace1'});
// Reading
client.execute('SELECT key, email, last_name FROM user_profiles WHERE key=?', ['jbay'],
  function(err, result) {
    if (err) console.log('execute Failed');
    else console.log('got user profile with email ' + result.rows[0].get('email'));
  }
);

// Writing
client.execute('UPDATE user_profiles SET birth=? WHERE key=?', [new Date(1950, 5, 1), 'jbay'], 
  cql.types.consistencies.quorum,
  function(err) {
    if (err) console.log("failure");
    else console.log("success");
  }
);

// Streaming query rows
client.streamRows('SELECT event_time, temperature FROM temperature WHERE station_id=', ['abc'], 
  function(err, row) {
    //the callback will be invoked per each row as soon as they are received
    if (err) console.log("Oh dear...");
    else {
      console.log('temperature value', row.get('temperature'));
    }
  }
);

// Streaming field
client.streamField('SELECT key, photo FROM user_profiles WHERE key=', ['jbay'], 
  function(err, row, photoStream) {
    //the callback will be invoked per each row as soon as they are received.
    if (err) console.log("Shame...");
    else {
      //The stream is a Readable Stream2 object
      stdout.pipe(photoStream);
    }
  }
);

node-cassandra-cql 官网

https://github.com/jorgebay/node-cassandra-cql

相关编程语言

SchemaCrawler提供一组用于增强标准JDBC Metadata的...
ER Master 是一个用于设计ER模型图的Eclipse插件。提...
Eclipse下用于画数据库ER图的插件,主要特性如下: ...
PowerDesigner 是Sybase的企业建模和设计解决方案,...
Mogwai ERDesigner NG是一个实体关系建模工具类似于...
Power*Architect 是一个数据建模工具,主要用在数据...