Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 19, 2024 via composer

doctrine/sql-formatter 1.1.3

a PHP SQL highlighting library
Package summary
Share
0
issues
1
license
1
MIT
Package created
22 Mar 2020
Version published
23 May 2022
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
doctrine/sql-formatter@1.1.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of doctrine/sql-formatter 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does doctrine/sql-formatter do?

The Doctrine/SQL-Formatter is a PHP SQL highlighting library and a lightweight package used for formatting SQL statements. The tool effectively implements indentations, adds line breaks, and provides syntax highlighting for SQL statements, making long SQL codes more readable and easy to debug. This is especially advantageous for developers who frequently deal with auto-generated SQL statements.

How do you use doctrine/sql-formatter?

The effective use of Doctrine/SQL-Formatter involves integrating it into your PHP script. First, ensure you have the package installed via composer. Initialize an instance of the SqlFormatter class, and use its methods like format, highlight, or compress according to your needs.

For instance, to use the Doctrine/SQL-Formatter to format your SQL statement, you would do the following:

<?php
require_once 'vendor/autoload.php';

use Doctrine\SqlFormatter\SqlFormatter;

$query = "YOUR SQL QUERY HERE";

echo (new SqlFormatter())->format($query);

This will output the SQL query highlighted and formatted nicely.

However, if you only need syntax highlighting, you can use the highlight method instead:

<?php
echo (new SqlFormatter())->highlight($query);

Or, for compressing the SQL command (removing comments and redundant whitespaces), use the compress method:

echo (new SqlFormatter())->compress($query);

Where are the doctrine/sql-formatter docs?

The Doctrine/SQL-Formatter docs can be found on the GitHub repository's README (https://github.com/doctrine/sql-formatter.git). The README provides comprehensive examples and detailed usage explanations to help you make the most out of this powerful library. It's advised to refer to this documentation to understand the full extent of its capabilities and for the latest updates or changes.