2019-07-15 11:47:58 +02:00
|
|
|
{ stdenvNoCC, fetchFromGitHub, python2 }:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
|
|
|
pname = "q-text-as-data";
|
2019-10-23 22:34:38 +02:00
|
|
|
version = "1.7.4";
|
2019-07-15 11:47:58 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "harelba";
|
|
|
|
repo = "q";
|
|
|
|
rev = version;
|
2019-10-23 22:34:38 +02:00
|
|
|
sha256 = "0p8rbfwwcqjyrix51v52zp9b03z4xg1fv2raf2ygqp9a4l27dca8";
|
2019-07-15 11:47:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ python2 ];
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/q $out/bin
|
|
|
|
chmod +x $out/bin/q
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenvNoCC.lib; {
|
|
|
|
description = "Run SQL directly on CSV or TSV files";
|
|
|
|
longDescription = ''
|
|
|
|
q is a command line tool that allows direct execution of SQL-like queries on CSVs/TSVs (and any other tabular text files).
|
|
|
|
|
|
|
|
q treats ordinary files as database tables, and supports all SQL constructs, such as WHERE, GROUP BY, JOINs etc. It supports automatic column name and column type detection, and provides full support for multiple encodings.
|
|
|
|
'';
|
|
|
|
homepage = "http://harelba.github.io/q/";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = [ maintainers.taneb ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|