Git Product home page Git Product logo

n1ql2csv's Introduction

n1ql2csv

Executes a given N1QL query and exports the results as CSV

Install

Install n1ql2csv globally

npm install n1ql2csv -g

Requires Node, if you don't have node, you can install nvm by issuing the following command.

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

then

nvm install 9

Usage

n1ql2csv --help

  Usage: n1ql2csv [options]

  This will execute a N1QL query and export the results into a csv file


  Options:

    -V, --version        output the version number
    -c, --cluster <s>    The cluster address (default: localhost)
    -s, --secure <b>     Whether or not to use http(s) (default: false)
    -p, --port <n>       The query port to use (default: 8093)
    -u, --username <s>   Cluster Admin or RBAC username (default: Administrator)
    -p, --password <s>   Cluster Admin or RBAC password (default: password)
    -s, --statement <s>  A N1QL statement or file path to a N1QL query
    -o, --output <s>     The destination output file (default: /home/centos/results.csv)
    -x, --overwrite <b>  Overwrite the destination file if it exists already (default: false)
    -t, --timeout <n>    Timeout in milliseconds for the query (default: 10000)
    -d, --delimiter <s>  The delimiter to use (default: ,)
    -h, --headers <b>    Whether or not there should be column headers (default: true)
    -h, --help           output usage information

Example

n1ql2csv \
  --cluster localhost \
  --username Administrator \
  --password password \
  --statement "SELECT airportname, city, country, faa, icao, id, type, tz FROM \`travel-sample\` AS airports WHERE type ='airport' ORDER BY airportname ASC" \
  --output somedir/results.csv \
  --overwrite true

n1ql2csv's People

Contributors

bentonam avatar

Watchers

James Cloos avatar Jeudi Prando Araujo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.