sql-blocks 1.25.414021502__py3-none-any.whl → 1.25.419021324__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 +10 -1
- {sql_blocks-1.25.414021502.dist-info → sql_blocks-1.25.419021324.dist-info}/METADATA +8 -2
- sql_blocks-1.25.419021324.dist-info/RECORD +7 -0
- sql_blocks-1.25.414021502.dist-info/RECORD +0 -7
- {sql_blocks-1.25.414021502.dist-info → sql_blocks-1.25.419021324.dist-info}/LICENSE +0 -0
- {sql_blocks-1.25.414021502.dist-info → sql_blocks-1.25.419021324.dist-info}/WHEEL +0 -0
- {sql_blocks-1.25.414021502.dist-info → sql_blocks-1.25.419021324.dist-info}/top_level.txt +0 -0
sql_blocks/sql_blocks.py
CHANGED
@@ -829,7 +829,7 @@ class QueryLanguage:
|
|
829
829
|
return self.join_with_tabs(values, ' AND ')
|
830
830
|
|
831
831
|
def sort_by(self, values: list) -> str:
|
832
|
-
return self.join_with_tabs(values)
|
832
|
+
return self.join_with_tabs(values, ',')
|
833
833
|
|
834
834
|
def set_group(self, values: list) -> str:
|
835
835
|
return self.join_with_tabs(values, ',')
|
@@ -1797,3 +1797,12 @@ def detect(text: str, join_queries: bool = True, format: str='') -> Select | lis
|
|
1797
1797
|
result += query
|
1798
1798
|
return result
|
1799
1799
|
# ===========================================================================================//
|
1800
|
+
|
1801
|
+
|
1802
|
+
if __name__ == "__main__":
|
1803
|
+
query = Select(
|
1804
|
+
'Table T',
|
1805
|
+
name=[Field, OrderBy],
|
1806
|
+
value=[Field, OrderBy],
|
1807
|
+
)
|
1808
|
+
print(query)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sql_blocks
|
3
|
-
Version: 1.25.
|
3
|
+
Version: 1.25.419021324
|
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
|
@@ -52,6 +52,12 @@ You can specify your own alias: `a = Select('Actor a')`
|
|
52
52
|
...should return:
|
53
53
|
**SELECT extract(year from due_date) as YEAR_ref...**
|
54
54
|
|
55
|
+
Possible tags in ExpressionField:
|
56
|
+
* {f} - The field name;
|
57
|
+
* {af} - The field name preceded by the table alias;
|
58
|
+
> Can be written as {a.f} or %
|
59
|
+
* {t} - The table name;
|
60
|
+
* {a} - Only the table alias.
|
55
61
|
---
|
56
62
|
|
57
63
|
### 3 - To set conditions, use **Where**:
|
@@ -450,7 +456,7 @@ WHERE
|
|
450
456
|
query = Select('post p')
|
451
457
|
query.add_fields(
|
452
458
|
'user_id, created_at',
|
453
|
-
|
459
|
+
[OrderBy, GroupBy]
|
454
460
|
)
|
455
461
|
```
|
456
462
|
...is the same as...
|
@@ -0,0 +1,7 @@
|
|
1
|
+
sql_blocks/__init__.py,sha256=5ItzGCyqqa6kwY8wvF9kapyHsAiWJ7KEXCcC-OtdXKg,37
|
2
|
+
sql_blocks/sql_blocks.py,sha256=AP5RXh5Lij_Z5PWuputOZX_ld-RnGir9FX916sGGsCA,60329
|
3
|
+
sql_blocks-1.25.419021324.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
4
|
+
sql_blocks-1.25.419021324.dist-info/METADATA,sha256=7UGdObqSmiYqjOyp9CW60iKcNQm4FklaQkukuTfPUr4,20708
|
5
|
+
sql_blocks-1.25.419021324.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
+
sql_blocks-1.25.419021324.dist-info/top_level.txt,sha256=57AbUvUjYNy4m1EqDaU3WHeP-uyIAfV0n8GAUp1a1YQ,11
|
7
|
+
sql_blocks-1.25.419021324.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
sql_blocks/__init__.py,sha256=5ItzGCyqqa6kwY8wvF9kapyHsAiWJ7KEXCcC-OtdXKg,37
|
2
|
-
sql_blocks/sql_blocks.py,sha256=HUDdXrSDuippY7buAAMuFyYS9mRetAu7woy_6yBUQ7c,60161
|
3
|
-
sql_blocks-1.25.414021502.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
4
|
-
sql_blocks-1.25.414021502.dist-info/METADATA,sha256=3GGtGw0pl-9zIqwCZM2AH0GHykI1Sawkb0fpfpsLMlc,20512
|
5
|
-
sql_blocks-1.25.414021502.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
-
sql_blocks-1.25.414021502.dist-info/top_level.txt,sha256=57AbUvUjYNy4m1EqDaU3WHeP-uyIAfV0n8GAUp1a1YQ,11
|
7
|
-
sql_blocks-1.25.414021502.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|