Format-sql

Latest version: v0.12.0

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

0.13

-----------------

0.12

----

* Fix: Parsing SQL after a function call in a join failed.

.. code:: sql

SELECT
p.*
FROM
p1 AS p
LEFT JOIN p2 AS r ON
r.sk = CONCAT(p.x, '-!')
WHERE
1 = 1


* Parse ``case``

.. code:: sql

SELECT
CASE
WHEN spam THEN 1,
CASE
WHEN eggs THEN 1
WHEN eggs3 THEN 2
ELSE 0
FROM
table

0.11

----

* Parse ``like`` comparisons

.. code:: sql

SELECT
*
FROM
xs
WHERE
x LIKE 'A%Z'


* Parse ``between`` comparisons

.. code:: sql

SELECT
*
FROM
ys
WHERE
ys.id BETWEEN 91 AND 92

0.10

----

* Parse function calls in joins, for example:

.. code:: sql

FROM
x
JOIN r ON
XYZ(r.id) = ABC(x.r)


* Parse ``SQL_CALC_FOUND_ROWS``

.. code:: sql

SELECT SQL_CALC_FOUND_ROWS
*
FROM
tbl_name
WHERE
id > 100
LIMIT 10;

0.9

---

* Parse INSERTs. This kind of INSERTs should work now:

.. code:: sql

INSERT INTO
spam
SELECT
*
FROM
eggs


.. code:: sql

INSERT INTO
table_name (col1, col2, 3)
VALUES
("value!", value2, 3)


.. code:: sql

INSERT INTO
table_name
VALUES
("value!", value2, 3),
("1"),
("2")


* Parse functions with no arguments.

.. code:: python

sql = """ SELECT NOW() """

0.8

---

* Parse ``IS NOT NULL`` comparisions.

.. code:: python

sql = """ WHERE x IS NOT NULL """


* Parse ``IS NULL`` comparisions.

.. code:: python

sql = """ WHERE x IS NULL """

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.