Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glynnbird/couchexport
CouchDB CSV export command-line utility
https://github.com/glynnbird/couchexport
Last synced: about 1 month ago
JSON representation
CouchDB CSV export command-line utility
- Host: GitHub
- URL: https://github.com/glynnbird/couchexport
- Owner: glynnbird
- Created: 2024-07-25T08:36:51.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-31T11:43:58.000Z (4 months ago)
- Last Synced: 2024-10-01T20:42:13.178Z (about 2 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changeProcessor.js
Awesome Lists containing this project
README
# couchcsvexport
## IntroductionThe _couchcsvexport_ command-line utility is useful for exporting Apache CouchDB database to CSV format. Note:
- the documents must be uniform i.e. have the same number of attributes.
- "flat" JSON documents make for better CSV exports
- the first line of the CSV will be the column headers## Installation
Install using npm or another Node.js package manager:
```sh
npm install -g couchcsvexport
```## Usage
_couchcsvexport_ (or its alias _couchexport_) writes a CSV to stdout which can be redirected to a file:
```sh
couchexport --db mydatabase > mydatabase.csv
```*couchexport*'s configuration parameters can be stored in environment variables or supplied as command line arguments.
## Configuration - environment variables
Simply set the `COUCH_URL` environment variable e.g. for a hosted Cloudant database
```sh
export COUCH_URL="https://myusername:[email protected]"
```and define the name of the CouchDB database to write to by setting the `COUCH_DATABASE` environment variable e.g.
```sh
export COUCH_DATABASE="mydatabase"
```## Configuring - command-line options
Supply the `--url` and `--database` parameters as command-line parameters instead:
```sh
couchexport --url "http://user:password@localhost:5984" --database "mydata"
```## IAM
To use IBM IAM authentication, use the `IAM_API_KEY` environment variable e.g.
```sh
export IAM_API_KEY="my_api_key"
export COUCH_URL="https://my.cloudant.com"
couchexport --db mydata
```