about summary refs log tree commit diff
path: root/pkgs/development/tools/zq
diff options
context:
space:
mode:
authorNikola Knezevic <nikola.knezevic@imc.com>2022-04-28 12:33:10 +0200
committerNikola Knezevic <nikola.knezevic@imc.com>2022-08-15 09:24:21 +0200
commit8a73271911445fc2206b6572956dd578beb227ef (patch)
treef30511df321a307b619d5528d750c54579801360 /pkgs/development/tools/zq
parentdbaaa8a676fc2eac46cb4b4b44f2bc6cb9f39ecf (diff)
zq: init at v1.2.0
This change adds zq, a part of the zed project https://zed.brimdata.io/.

zq is a command-line tool that uses the Zed language for pipeline-style
search and analytics. zq can query a variety of data formats in files,
over HTTP, or in S3 storage. It is particularly fast when operating on
data in the Zed-native ZNG format.

The zq design philosophy blends the query/search-tool approach of jq,
awk, and grep with the command-line, embedded database approach of
sqlite and duckdb.
Diffstat (limited to 'pkgs/development/tools/zq')
-rw-r--r--pkgs/development/tools/zq/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/tools/zq/default.nix b/pkgs/development/tools/zq/default.nix
new file mode 100644
index 0000000000000..956ce70b41b04
--- /dev/null
+++ b/pkgs/development/tools/zq/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, buildGoModule
+, testers
+, zq
+}:
+
+buildGoModule rec {
+  pname = "zq";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "brimdata";
+    repo = "zed";
+    rev = "v${version}";
+    hash = "sha256-BK4LB37jr/9O0sjYgFtnEkbFqTsp/1+hcmCNMFDPiPM=";
+  };
+
+  vendorSha256 = "sha256-oAkQRUaEP/RNjpDH4U8XFVokf7KiLk0OWMX+U7qny70=";
+
+  subPackages = [ "cmd/zq" ];
+
+  ldflags = [ "-s" "-X" "github.com/brimdata/zed/cli.Version=${version}" ];
+
+  passthru.tests = testers.testVersion { package = zq; };
+
+  meta = with lib; {
+    description = "A command-line tool for processing data in diverse input formats, providing search, analytics, and extensive transformations using the Zed language";
+    homepage = "https://zed.brimdata.io";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ knl ];
+  };
+}