2022-05-30 10:32:20 +02:00
|
|
|
{
|
|
|
|
writeShellApplication,
|
|
|
|
python3
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
python = python3.withPackages(python-packages: with python-packages; [
|
|
|
|
sqlparse
|
|
|
|
]);
|
|
|
|
|
|
|
|
in writeShellApplication {
|
|
|
|
name = "sqlformat";
|
2022-05-31 18:54:47 +02:00
|
|
|
|
|
|
|
runtimeInputs = [
|
|
|
|
python
|
|
|
|
];
|
|
|
|
|
2022-05-30 10:32:20 +02:00
|
|
|
text = ''
|
2022-05-31 18:54:47 +02:00
|
|
|
python3 -m sqlparse --keywords upper --identifiers lower --reindent_aligned --indent_width 4 <(cat -)
|
2022-05-30 10:32:20 +02:00
|
|
|
'';
|
|
|
|
}
|