sqlccc 1.0.1__tar.gz → 1.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlccc
3
- Version: 1.0.1
3
+ Version: 1.1.1
4
4
  Summary: A cyclomatix complexity calculator for SQL
5
5
  Author-email: Søren Brønsted <soren@bronsted.dk>
6
6
  License-Expression: Apache-2.0
@@ -14,4 +14,12 @@ License-File: LICENSE
14
14
  Dynamic: license-file
15
15
 
16
16
  # sqlcc
17
- [A cyclomatix complexity calculator for SQL](https://en.wikipedia.org/wiki/Cyclomatic_complexity) for SQL
17
+ A [cyclomatix complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity)
18
+ calculator for SQL
19
+
20
+ ## Usage
21
+
22
+ ```bash
23
+ sqlcc <file.sql>
24
+ ```
25
+ which output a number representing the cyclomatic complexity of the SQL file.
sqlccc-1.1.1/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # sqlcc
2
+ A [cyclomatix complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity)
3
+ calculator for SQL
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ sqlcc <file.sql>
9
+ ```
10
+ which output a number representing the cyclomatic complexity of the SQL file.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sqlccc"
3
- version = "1.0.1"
3
+ version = "1.1.1"
4
4
  authors = [
5
5
  { name="Søren Brønsted", email="soren@bronsted.dk" },
6
6
  ]
@@ -5,13 +5,14 @@ Calculate the cyclomatic complexity of a SQL query.
5
5
 
6
6
  Args:
7
7
  sql (str): The SQL query string.
8
+ dialect (str): The SQL dialect to use for parsing. See sqlglot documentation for supported dialects.
8
9
 
9
10
  Returns:
10
11
  int: The calculated cyclomatic complexity.
11
12
  """
12
- def calc(sql: str) -> int:
13
+ def calc(sql: str, dialect='snowflake') -> int:
13
14
  result = 1
14
- parsed = sg.parse_one(sql)
15
+ parsed = sg.parse_one(sql,dialect=dialect)
15
16
  cyclomatics = [
16
17
  # Logic
17
18
  sg.exp.And, sg.exp.Or, sg.exp.In, sg.exp.Between, sg.exp.Like, sg.exp.Group,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlccc
3
- Version: 1.0.1
3
+ Version: 1.1.1
4
4
  Summary: A cyclomatix complexity calculator for SQL
5
5
  Author-email: Søren Brønsted <soren@bronsted.dk>
6
6
  License-Expression: Apache-2.0
@@ -14,4 +14,12 @@ License-File: LICENSE
14
14
  Dynamic: license-file
15
15
 
16
16
  # sqlcc
17
- [A cyclomatix complexity calculator for SQL](https://en.wikipedia.org/wiki/Cyclomatic_complexity) for SQL
17
+ A [cyclomatix complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity)
18
+ calculator for SQL
19
+
20
+ ## Usage
21
+
22
+ ```bash
23
+ sqlcc <file.sql>
24
+ ```
25
+ which output a number representing the cyclomatic complexity of the SQL file.
sqlccc-1.0.1/README.md DELETED
@@ -1,2 +0,0 @@
1
- # sqlcc
2
- [A cyclomatix complexity calculator for SQL](https://en.wikipedia.org/wiki/Cyclomatic_complexity) for SQL
File without changes
File without changes