1

I need to query the database, and drop the results in a csv file.

I remember I did this with sql server, is it possible to do this CrateDB?

Cœur
  • 37,241
  • 25
  • 195
  • 267
juan garcia
  • 1,326
  • 2
  • 23
  • 56

2 Answers2

4

CrateDB's crash shell supports various different output formats, including csv.

Example:

crash --format csv -c 'select * from sys.cluster' > sys_cluster.csv

See https://crate.io/docs/reference/crash for details.

Sebastian Utz
  • 719
  • 3
  • 9
  • Thx for pointing me to the correct direction, I did not read that part of the docs, next time I will pay more attention... kind regards – juan garcia Mar 22 '17 at 10:33
1

Of course yes, where are u getting stuck?

You can find the official github repository of examples: crate/crate-sample-apps, where cratedb is used. You can use this as a baseline to understand crate.

And, you can easily convert the values from crate to a CSV format using various language specific libraries. For example, in python you can use csv.

vishwarajanand
  • 1,021
  • 13
  • 23