1{
2 lib,
3 fetchPypi,
4 buildPythonPackage,
5 postgresql,
6 unittestCheckHook,
7}:
8
9buildPythonPackage rec {
10 pname = "pgsanity";
11 version = "0.2.9";
12 format = "setuptools";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "de0bbd6fe4f98bf5139cb5f466eac2e2abaf5a7b050b9e4867b87bf360873173";
17 };
18
19 nativeCheckInputs = [
20 unittestCheckHook
21 ];
22
23 unittestFlagsArray = [ "test" ];
24
25 propagatedBuildInputs = [ postgresql ];
26
27 # To find "ecpg"
28 nativeBuildInputs = [ (lib.getDev postgresql) ];
29
30 meta = with lib; {
31 homepage = "https://github.com/markdrago/pgsanity";
32 description = "Checks the syntax of Postgresql SQL files";
33 mainProgram = "pgsanity";
34 longDescription = ''
35 PgSanity checks the syntax of Postgresql SQL files by
36 taking a file that has a list of bare SQL in it,
37 making that file look like a C file with embedded SQL,
38 run it through ecpg and
39 let ecpg report on the syntax errors of the SQL.
40 '';
41 license = licenses.mit;
42 maintainers = with maintainers; [ nalbyuites ];
43 };
44}