Subject: [bug#67963] [PATCH v2 31/37] gnu: Add perl-sql-translator.

From: Felix Lechner <[email-masked]>
Date: Tue, 16 Jan 2024 14:13:09 -0800

* gnu/packages/databases.scm (perl-sql-translator): New variable.

Change-Id: I8a7c45539cf848e03f038b1e8bb9334b5115d1d4
---
 gnu/packages/databases.scm | 57 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 1f4e6be631..5ff23ba63d 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -101,12 +101,14 @@ (define-module (gnu packages databases)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages gd)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages golang)
   #:use-module (gnu packages gperf)
+  #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages icu4c)
@@ -2322,6 +2324,61 @@ (define-public perl-sql-tokenizer
 valid SQL query.")
     (license license:perl-license)))
 
+(define-public perl-sql-translator
+  (package
+    (name "perl-sql-translator")
+    (version "1.64")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/V/VE/VEESH/SQL-Translator-"
+                           version ".tar.gz"))
+       (sha256
+        (base32 "1iykygxlsd98cxkr6np3gvcidrvgal7q59ms1id1vb76z0kd8478"))))
+    (build-system perl-build-system)
+    (arguments
+     (list
+      #:tests? #f))
+    (native-inputs (list perl-file-sharedir-install
+                         perl-json-maybexs
+                         perl-test-differences
+                         perl-test-exception
+                         perl-xml-writer
+                         perl-yaml))
+    (propagated-inputs (list perl-carp-clan
+                             perl-dbi
+                             perl-file-sharedir
+                             perl-gd
+                             perl-graph
+                             perl-graphviz
+                             perl-moo
+                             perl-package-variant
+                             perl-parse-recdescent
+                             perl-spreadsheet-parseexcel
+                             perl-sub-quote
+                             perl-template-toolkit
+                             perl-text-recordparser
+                             perl-try-tiny
+                             perl-xml-libxml))
+    (home-page "https://metacpan.org/release/SQL-Translator")
+    (synopsis "SQL DDL transformations and more")
+    (description "SQL::Translator is a group of Perl modules that converts
+vendor-specific SQL table definitions into other formats like a different
+SQL dialect, into ER diagrams, into documentation (POD and HTML), into XML,
+and into Class::DBI classes.
+
+The main focus of SQL::Translator is SQL, but parsers exist for other
+structured data formats, including Excel spreadsheets and arbitrarily
+delimited text files.
+
+Through the separation of the code into parsers and producers with an
+object model in between, it's possible to combine any parser with any
+producer, or to plug in custom parsers or producers, or to manipulate
+the parsed data via the built-in object model.  Presently only the
+definition parts of SQL are handled CREATE, ALTER), but not the
+manipulation of data (INSERT, UPDATE, DELETE).")
+    (license license:perl-license)))
+
 (define-public unixodbc
   (package
    (name "unixodbc")
-- 
2.41.0