Skip to main content

Formater SQL written in Rust

Project description

sqlformater

sqlformater is a command-line tool (CLI) built in Rust, designed to automatically format SQL scripts. It supports individual files or entire directories and allows customized configuration via settings files.

🚀 Getting Started

Install with Cargo :

cargo install --git https://github.com/LugolBis/sqlformater.git

Install with Pip :

pip install sqlformater

Usage :

sqlformater <PATHS> [OPTIONS]

📂 : Specify the files or folders to format

You can provide one or more of the following:

  • One or more folder paths: formats all .sql files in the subdirectories.
  • One or more .sql files: formats specific individual files.
  • . or *: selects the current directory and all its subdirectories.

⚙️ Available Options

Option Description
-logs_path=<FOLDER_PATH>,
--logs_path=<FOLDER_PATH>
Specifies the folder where logs will be saved.
-settings_path=<PATH>,
--settings_path=<PATH>
Path to the configuration file or the folder that contains it.
-status,
--status
Shows diagnostic information: settings, logs, etc.
-help,
--help
Displays general help.
-help-settings,
--help-settings
Displays information about available configuration settings.

📘 Examples

Format all SQL files in the current directory and subdirectories:

sqlformater .

Format two specific files:

sqlformater tutu/queries/init.sql tutu/queries/update_users.sql

Format all files in a folder with a specific config file:

sqlformater home/tutu/migrations --settings_path=./config/settings.json

Enable verbose mode:

sqlformater * --verbose

🔧 Configuration

You can customize the formatter's behavior via a configuration file. To see the available settings:

sqlformater --help-settings

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sqlformater-1.0.11-cp312-none-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.12Windows x86-64

sqlformater-1.0.11-cp312-cp312-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

sqlformater-1.0.11-cp312-cp312-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sqlformater-1.0.11-cp311-none-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.11Windows x86-64

sqlformater-1.0.11-cp311-cp311-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

sqlformater-1.0.11-cp311-cp311-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sqlformater-1.0.11-cp310-none-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.10Windows x86-64

sqlformater-1.0.11-cp310-cp310-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

sqlformater-1.0.11-cp310-cp310-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sqlformater-1.0.11-cp39-none-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.9Windows x86-64

sqlformater-1.0.11-cp39-cp39-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

sqlformater-1.0.11-cp39-cp39-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

sqlformater-1.0.11-cp38-none-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.8Windows x86-64

sqlformater-1.0.11-cp38-cp38-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

sqlformater-1.0.11-cp38-cp38-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file sqlformater-1.0.11-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 aa0e0ff62b4378b07f67201c19fad2d2cb4178ce26a8d3beea2230706bc4960e
MD5 411a1c0565eefd91bd632fcda36e253f
BLAKE2b-256 89a2e08de25144f7e9e9981412b9e5fdfd7cc00af4ee5edda94c7214e8133186

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b91f824af2003a2563b557c99385e89e8edc870d6b9d44b4b7e69cd37c259db2
MD5 9a994389a58984074a6b0203cb939c71
BLAKE2b-256 01a2599fef35d2eb3d3675c24bda48e982f4a54893edf0ea8166b2e9a8926b69

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0dd53313651317adedc466b4c5e62c47477b1f64cab700a23443876a8dc58bfe
MD5 b4b6129ec15cbecfbbc37a2f3d0ba9e4
BLAKE2b-256 3f25efef4d3930773a07185eb78dc6efe1223bba8d1e47dc371640a747356b26

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 dcb577e7ad01c0eff8a14f591f49fb8d8e61b0d5f7c80e331e53e7e34c46ad7e
MD5 2c2ce8229cea780946df114e207f06e7
BLAKE2b-256 4d2d404c0cd675cf511baf9d4343f8740f8e5611f8c73dcdcfb8b38064484607

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 901440934bdb2cb190f3b1dc002a763f3ef3295b54fd317b8122577824d7f642
MD5 f0dfff7050147ccd997f753664ea7f2a
BLAKE2b-256 701cbc2765079fd7874fc5db8b1c28920b4087a48584d77f5f7fe2df2ecf7fb0

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f8f282ea8508c86d851c9354bb6d91dc59097f2f0fd08b2a901f9ba12d29813a
MD5 12b48f9e91e2c59f3229210df481aa76
BLAKE2b-256 1c2d612f14b3e18c6eeb72997bf6a8568e51673dbcf2fc8f4ec1d11cfef593ac

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 c12672344d466de72627b5048410d1486812786ccf92fde96aab943303594aa3
MD5 8b1fb7ab04d47363249c551072ed1fc6
BLAKE2b-256 13cbf7749c67c93fc2e90b7647726d6e12de1f969588a8074c695b21980fa8d0

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 635eb9399766486f9f4d78ee4a40f4db0a0fca1f56bfa35f8ac5bced9f984ac5
MD5 ce845c07fc1695619f2477c5633a2262
BLAKE2b-256 5c2b81812ba9fe9cf7d547eba49dd92aa4fa0086255416ca262b6b845b9bad96

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9239c8ae77d76abe1273bfae0b3f8ba59dcf5ce6859629c9f3dc5e58c779cc8a
MD5 8fa0b1c727cc837b8d5b7c9ec107210e
BLAKE2b-256 85f4291254085b616912cce7a1bd5e3b7792e5231eb9b7228a37892d6ab7a555

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp39-none-win_amd64.whl.

File metadata

  • Download URL: sqlformater-1.0.11-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for sqlformater-1.0.11-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 00f4ef136976e9d2a1271aeb7bb8c5af1d667985124d8baa5f85e78165baa552
MD5 0fdf92d41229c85267a6d1a3629f0508
BLAKE2b-256 6ce66afbef9ab10577d01b75ea72f3235afa2de6dcec9e98bc9919e00f02ad6c

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b03e19ac7308a782327ba43ee20a3f039909e85ef46d2c6cc8890a4437103b5e
MD5 f5a442506e923805f947aa7739d45197
BLAKE2b-256 afe0ff1ac044f21d50a9c43982006d78d572a4441912474ed7ce3def80a81811

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 459139ab0e77d6432715ef5dcceca1afd4d20e986daaa0a5b9d83996292cc8e0
MD5 108850e78255f58fa0346f1dd97a7aff
BLAKE2b-256 321fd66ebac8d3239aa7f424561a9f3210dbe743c53d12c9a719b002561f5d8c

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp38-none-win_amd64.whl.

File metadata

  • Download URL: sqlformater-1.0.11-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for sqlformater-1.0.11-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 60fe99ef59a4904860067095da107c45b7eb43fc425330d752c00df651b672d2
MD5 e80242aa1dc982eef80d52a0b9f4184b
BLAKE2b-256 b67536601cf36e31a1e282ad4041504664a470ba050ae8fc0eb80b60d59bb289

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 994de1a0bee1e4e1e2ed982a7f07da957fb270a1729ca233dd8966c5632b4bc8
MD5 32d435e2b7c6c897e65465341810d44a
BLAKE2b-256 f833a92b8560a0383291d64cf2af888bd42d74e876ff15b8fcb9e5452eb72ac9

See more details on using hashes here.

File details

Details for the file sqlformater-1.0.11-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sqlformater-1.0.11-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 54870d018c0ff519cc1be79f84818be63c09d7f44cf5f658f174eabda7a0b2e3
MD5 52765df849f37610e501da10c9d26f2d
BLAKE2b-256 2c18c8891a08173a3211b8865f753fec30be1700d4c69eb234614fa4246e447f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page