about summary refs log tree commit diff
path: root/pkgs/development/tools/database
diff options
context:
space:
mode:
authorGabriel Fontes <hi@m7.rs>2022-11-10 21:20:43 -0300
committerGabriel Fontes <hi@m7.rs>2022-11-28 21:08:30 -0300
commitfa3fc2c985d6fe7544c43ba6fe1360e2c38f9428 (patch)
treeb3bbee82d6620b749a3ae03e5559ebcaccc398e2 /pkgs/development/tools/database
parent04e7308c6833a1f0a58dcdbd12309c7859f32d32 (diff)
sqlcl: init at 22.3.1
Diffstat (limited to 'pkgs/development/tools/database')
-rw-r--r--pkgs/development/tools/database/sqlcl/default.nix70
1 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/development/tools/database/sqlcl/default.nix b/pkgs/development/tools/database/sqlcl/default.nix
new file mode 100644
index 0000000000000..733282cd40677
--- /dev/null
+++ b/pkgs/development/tools/database/sqlcl/default.nix
@@ -0,0 +1,70 @@
+{ lib, stdenv, makeWrapper, requireFile, unzip, jdk }:
+
+let
+  version = "22.3.1";
+  fileVersion = "1032109-01";
+in
+  stdenv.mkDerivation {
+
+  inherit version;
+  pname = "sqlcl";
+
+  src = requireFile rec {
+    url = "https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/download/";
+    name = "V${fileVersion}.zip";
+    message = ''
+      This Nix expression requires that ${name} already be part of the store. To
+      obtain it you need to
+
+      - navigate to ${url}
+      - make sure that it says "Version ${version}" above the list of downloads
+        - if it does not, click on the "Previous Version" link below the
+          download and repeat until the version is correct. This is necessary
+          because as the time of this writing there exists no permanent link
+          for the current version yet.
+          Also consider updating this package yourself (you probably just need
+          to change the `version` variable and update the sha256 to the one of
+          the new file) or opening an issue at the nixpkgs repo.
+      - click "Download"
+      - sign in or create an oracle account if neccessary
+      - on the next page, click the "${name}" link
+
+      and then add the file to the Nix store using either:
+
+        nix-store --add-fixed sha256 ${name}
+
+      or
+
+        nix-prefetch-url --type sha256 file:///path/to/${name}
+    '';
+    sha256 = "0yqj8m2zwl8m7zxrzjnbl2rqnl2imn5h1bfpnmklp03nkakbzjbn";
+  };
+
+  nativeBuildInputs = [ makeWrapper unzip ];
+
+  unpackCmd = "unzip $curSrc";
+
+  installPhase = ''
+    mkdir -p $out/libexec
+    mv * $out/libexec/
+
+    makeWrapper $out/libexec/bin/sql $out/bin/sqlcl \
+      --set JAVA_HOME ${jdk.home} \
+      --chdir "$out/libexec/bin"
+  '';
+
+  meta = with lib; {
+    description = "Oracle's Oracle DB CLI client";
+    longDescription = ''
+      Oracle SQL Developer Command Line (SQLcl) is a free command line
+      interface for Oracle Database. It allows you to interactively or batch
+      execute SQL and PL/SQL. SQLcl provides in-line editing, statement
+      completion, and command recall for a feature-rich experience, all while
+      also supporting your previously written SQL*Plus scripts.
+    '';
+    homepage = "https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/";
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ misterio77 ];
+  };
+}