sql-blocks 1.20250718__tar.gz → 1.20250719__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.
- {sql_blocks-1.20250718/sql_blocks.egg-info → sql_blocks-1.20250719}/PKG-INFO +10 -3
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/README.md +9 -2
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/pyproject.toml +1 -1
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/setup.py +1 -1
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/sql_blocks/sql_blocks.py +0 -22
- {sql_blocks-1.20250718 → sql_blocks-1.20250719/sql_blocks.egg-info}/PKG-INFO +10 -3
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/LICENSE +0 -0
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/setup.cfg +0 -0
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/sql_blocks/__init__.py +0 -0
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/sql_blocks.egg-info/SOURCES.txt +0 -0
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/sql_blocks.egg-info/dependency_links.txt +0 -0
- {sql_blocks-1.20250718 → sql_blocks-1.20250719}/sql_blocks.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sql_blocks
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.20250719
|
4
4
|
Summary: Allows you to create objects for parts of SQL query commands. Also to combine these objects by joining them, adding or removing parts...
|
5
5
|
Home-page: https://github.com/julio-cascalles/sql_blocks
|
6
6
|
Author: Júlio Cascalles
|
@@ -573,16 +573,20 @@ ORDER BY
|
|
573
573
|
mov.title
|
574
574
|
```
|
575
575
|
---
|
576
|
-
|
576
|
+
|
577
|
+
#### Separators and meaning:
|
578
|
+
<a id="cypher_separators"></a>
|
579
|
+
|
577
580
|
* `( )` Delimits a table and its fields
|
578
581
|
* `,` Separate fields
|
579
582
|
* `?` For simple conditions (> < = <>)
|
580
583
|
* `<-` connects to the table on the left
|
581
584
|
* `->` connects to the table on the right
|
582
585
|
* `^` Put the field in the ORDER BY clause
|
583
|
-
* `@` Immediately after the table name, it indicates the grouping field.
|
586
|
+
* `@` Immediately after the table/field name, it indicates the grouping field.
|
584
587
|
* `$` For SQL functions like **avg**$_field_, **sum**$_field_, **count**$_field_...
|
585
588
|
* `*` Sets the primary key field.
|
589
|
+
* `:` Allows you to assign an alias to the field or expression.
|
586
590
|
|
587
591
|
|
588
592
|
---
|
@@ -869,6 +873,7 @@ UNION ALL
|
|
869
873
|
```
|
870
874
|
|
871
875
|
* **17.2.1 - The `create` method** ... parameters :
|
876
|
+
<a id="cte_create_method"></a>
|
872
877
|
- name: The name of the CTE
|
873
878
|
- pattern: A cypher script that defines the tables used
|
874
879
|
- formula: The format for `Where.formula` method _(*)_
|
@@ -881,6 +886,7 @@ UNION ALL
|
|
881
886
|
'[2] = R.[1]', 'JFK', format='.csv'
|
882
887
|
) # ^^^--- Flyghts from JFK airport
|
883
888
|
```
|
889
|
+
|
884
890
|
_...Creates a recursive CTE called Route, using Flyght table, where the recursivity condition is Flyght.arrival equals to Route.departure_
|
885
891
|
>> (*) -- Note that [1] and [2] refers to first field and second field. 😉
|
886
892
|
|
@@ -1024,6 +1030,7 @@ FROM
|
|
1024
1030
|
Annual_Sales_per_Vendor aspv
|
1025
1031
|
RIGHT JOIN Goal goa ON (aspv.ref_year = goa.year)
|
1026
1032
|
```
|
1033
|
+
For more details, see the [Cypher syntax](#cypher_separators) or [CTE create method](#cte_create_method)!
|
1027
1034
|
|
1028
1035
|
|
1029
1036
|
---
|
@@ -558,16 +558,20 @@ ORDER BY
|
|
558
558
|
mov.title
|
559
559
|
```
|
560
560
|
---
|
561
|
-
|
561
|
+
|
562
|
+
#### Separators and meaning:
|
563
|
+
<a id="cypher_separators"></a>
|
564
|
+
|
562
565
|
* `( )` Delimits a table and its fields
|
563
566
|
* `,` Separate fields
|
564
567
|
* `?` For simple conditions (> < = <>)
|
565
568
|
* `<-` connects to the table on the left
|
566
569
|
* `->` connects to the table on the right
|
567
570
|
* `^` Put the field in the ORDER BY clause
|
568
|
-
* `@` Immediately after the table name, it indicates the grouping field.
|
571
|
+
* `@` Immediately after the table/field name, it indicates the grouping field.
|
569
572
|
* `$` For SQL functions like **avg**$_field_, **sum**$_field_, **count**$_field_...
|
570
573
|
* `*` Sets the primary key field.
|
574
|
+
* `:` Allows you to assign an alias to the field or expression.
|
571
575
|
|
572
576
|
|
573
577
|
---
|
@@ -854,6 +858,7 @@ UNION ALL
|
|
854
858
|
```
|
855
859
|
|
856
860
|
* **17.2.1 - The `create` method** ... parameters :
|
861
|
+
<a id="cte_create_method"></a>
|
857
862
|
- name: The name of the CTE
|
858
863
|
- pattern: A cypher script that defines the tables used
|
859
864
|
- formula: The format for `Where.formula` method _(*)_
|
@@ -866,6 +871,7 @@ UNION ALL
|
|
866
871
|
'[2] = R.[1]', 'JFK', format='.csv'
|
867
872
|
) # ^^^--- Flyghts from JFK airport
|
868
873
|
```
|
874
|
+
|
869
875
|
_...Creates a recursive CTE called Route, using Flyght table, where the recursivity condition is Flyght.arrival equals to Route.departure_
|
870
876
|
>> (*) -- Note that [1] and [2] refers to first field and second field. 😉
|
871
877
|
|
@@ -1009,6 +1015,7 @@ FROM
|
|
1009
1015
|
Annual_Sales_per_Vendor aspv
|
1010
1016
|
RIGHT JOIN Goal goa ON (aspv.ref_year = goa.year)
|
1011
1017
|
```
|
1018
|
+
For more details, see the [Cypher syntax](#cypher_separators) or [CTE create method](#cte_create_method)!
|
1012
1019
|
|
1013
1020
|
|
1014
1021
|
---
|
@@ -2504,25 +2504,3 @@ def detect(text: str, join_method = join_queries, format: str='') -> Select | li
|
|
2504
2504
|
# ===========================================================================================//
|
2505
2505
|
|
2506
2506
|
|
2507
|
-
if __name__ == "__main__":
|
2508
|
-
# cte = CTEFactory("""
|
2509
|
-
# Sales(year$ref_date:ref_year@, sum$quantity:qty_sold, vendor) <- Vendor(id, name:vendors_name@)
|
2510
|
-
# """)
|
2511
|
-
cte = CTEFactory(
|
2512
|
-
txt='''
|
2513
|
-
#Empregado #Cliente #Fornecedor
|
2514
|
-
|
2515
|
-
Todas_as_pessoas[
|
2516
|
-
[1] [2] [3]
|
2517
|
-
]
|
2518
|
-
|
2519
|
-
[-1](**, ano*) <- Meta(ano, qt_ideal)
|
2520
|
-
''',
|
2521
|
-
template='''
|
2522
|
-
Vendas_por_{t}[
|
2523
|
-
Vendas(year$data:ano@, sum$quantidade:qt_vendida,
|
2524
|
-
{f}) -> {t}(id, nome:nome_pessoa@)
|
2525
|
-
]
|
2526
|
-
'''
|
2527
|
-
)
|
2528
|
-
print(cte)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sql_blocks
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.20250719
|
4
4
|
Summary: Allows you to create objects for parts of SQL query commands. Also to combine these objects by joining them, adding or removing parts...
|
5
5
|
Home-page: https://github.com/julio-cascalles/sql_blocks
|
6
6
|
Author: Júlio Cascalles
|
@@ -573,16 +573,20 @@ ORDER BY
|
|
573
573
|
mov.title
|
574
574
|
```
|
575
575
|
---
|
576
|
-
|
576
|
+
|
577
|
+
#### Separators and meaning:
|
578
|
+
<a id="cypher_separators"></a>
|
579
|
+
|
577
580
|
* `( )` Delimits a table and its fields
|
578
581
|
* `,` Separate fields
|
579
582
|
* `?` For simple conditions (> < = <>)
|
580
583
|
* `<-` connects to the table on the left
|
581
584
|
* `->` connects to the table on the right
|
582
585
|
* `^` Put the field in the ORDER BY clause
|
583
|
-
* `@` Immediately after the table name, it indicates the grouping field.
|
586
|
+
* `@` Immediately after the table/field name, it indicates the grouping field.
|
584
587
|
* `$` For SQL functions like **avg**$_field_, **sum**$_field_, **count**$_field_...
|
585
588
|
* `*` Sets the primary key field.
|
589
|
+
* `:` Allows you to assign an alias to the field or expression.
|
586
590
|
|
587
591
|
|
588
592
|
---
|
@@ -869,6 +873,7 @@ UNION ALL
|
|
869
873
|
```
|
870
874
|
|
871
875
|
* **17.2.1 - The `create` method** ... parameters :
|
876
|
+
<a id="cte_create_method"></a>
|
872
877
|
- name: The name of the CTE
|
873
878
|
- pattern: A cypher script that defines the tables used
|
874
879
|
- formula: The format for `Where.formula` method _(*)_
|
@@ -881,6 +886,7 @@ UNION ALL
|
|
881
886
|
'[2] = R.[1]', 'JFK', format='.csv'
|
882
887
|
) # ^^^--- Flyghts from JFK airport
|
883
888
|
```
|
889
|
+
|
884
890
|
_...Creates a recursive CTE called Route, using Flyght table, where the recursivity condition is Flyght.arrival equals to Route.departure_
|
885
891
|
>> (*) -- Note that [1] and [2] refers to first field and second field. 😉
|
886
892
|
|
@@ -1024,6 +1030,7 @@ FROM
|
|
1024
1030
|
Annual_Sales_per_Vendor aspv
|
1025
1031
|
RIGHT JOIN Goal goa ON (aspv.ref_year = goa.year)
|
1026
1032
|
```
|
1033
|
+
For more details, see the [Cypher syntax](#cypher_separators) or [CTE create method](#cte_create_method)!
|
1027
1034
|
|
1028
1035
|
|
1029
1036
|
---
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|