sql-blocks 1.20250718__py3-none-any.whl → 1.20250719__py3-none-any.whl

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/sql_blocks.py CHANGED
@@ -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.20250718
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
- > **Separators and meaning:**
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
  ---
@@ -0,0 +1,7 @@
1
+ sql_blocks/__init__.py,sha256=5ItzGCyqqa6kwY8wvF9kapyHsAiWJ7KEXCcC-OtdXKg,37
2
+ sql_blocks/sql_blocks.py,sha256=F6MnDlqlBDnCZkN6t2v3Kx7Og5o7kDetRvMP3xdrBGg,85649
3
+ sql_blocks-1.20250719.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
4
+ sql_blocks-1.20250719.dist-info/METADATA,sha256=3Aggm19HCvCpFNf-Mw8NCqX38WRTyd-eeBfg7wvpLwQ,25592
5
+ sql_blocks-1.20250719.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
+ sql_blocks-1.20250719.dist-info/top_level.txt,sha256=57AbUvUjYNy4m1EqDaU3WHeP-uyIAfV0n8GAUp1a1YQ,11
7
+ sql_blocks-1.20250719.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- sql_blocks/__init__.py,sha256=5ItzGCyqqa6kwY8wvF9kapyHsAiWJ7KEXCcC-OtdXKg,37
2
- sql_blocks/sql_blocks.py,sha256=jsihV2ylEjZu_g5W4e6jtJlbmK2ZXqVJXcqKncGikNk,86290
3
- sql_blocks-1.20250718.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
4
- sql_blocks-1.20250718.dist-info/METADATA,sha256=r4s-4ScclaImOIhaIo9t5F0gY6WkJdoEpGgq-YcNOeA,25345
5
- sql_blocks-1.20250718.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
- sql_blocks-1.20250718.dist-info/top_level.txt,sha256=57AbUvUjYNy4m1EqDaU3WHeP-uyIAfV0n8GAUp1a1YQ,11
7
- sql_blocks-1.20250718.dist-info/RECORD,,