1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, pytestCheckHook
6, python-dateutil
7, duckdb
8}:
9buildPythonPackage rec {
10 pname = "sqlglot";
11 version = "6.0.7";
12
13 disabled = pythonOlder "3.8";
14
15 src = fetchFromGitHub {
16 repo = "sqlglot";
17 owner = "tobymao";
18 rev = "v${version}";
19 hash = "sha256-7PBhf9NN/mCi92xSkB9ygfmfxTyOYaEyrNvL309sG5Y=";
20 };
21
22 propagatedBuildInputs = [ python-dateutil ];
23
24 checkInputs = [ pytestCheckHook duckdb ];
25
26 pythonImportsCheck = [ "sqlglot" ];
27
28 meta = with lib; {
29 description = "A no dependency Python SQL parser, transpiler, and optimizer";
30 homepage = "https://github.com/tobymao/sqlglot";
31 license = licenses.mit;
32 maintainers = with maintainers; [ cpcloud ];
33 };
34}