sql-blocks 1.25.1__py3-none-any.whl → 1.25.2__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
@@ -170,9 +170,12 @@ class Function:
170
170
  @classmethod
171
171
  def format(cls, name: str, main: SQLObject) -> str:
172
172
  obj = cls.get_instance()
173
- params = [
174
- Field.format(name, main)
175
- ] + obj.params
173
+ if name in '*_' and obj.params:
174
+ params = obj.params
175
+ else:
176
+ params = [
177
+ Field.format(name, main)
178
+ ] + obj.params
176
179
  return obj.pattern.format(
177
180
  cls.__name__,
178
181
  ', '.join(params)
@@ -1356,3 +1359,12 @@ def detect(text: str) -> Select:
1356
1359
  for query in query_list[1:]:
1357
1360
  result += query
1358
1361
  return result
1362
+
1363
+ if __name__ == "__main__":
1364
+ OrderBy.sort = SortType.DESC
1365
+ query = Select(
1366
+ 'order_Detail d',
1367
+ customer_id=GroupBy,
1368
+ _=Sum('d.unitPrice * d.quantity').As('total', OrderBy)
1369
+ )
1370
+ print(query)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sql_blocks
3
- Version: 1.25.1
3
+ Version: 1.25.2
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
@@ -0,0 +1,7 @@
1
+ sql_blocks/__init__.py,sha256=5ItzGCyqqa6kwY8wvF9kapyHsAiWJ7KEXCcC-OtdXKg,37
2
+ sql_blocks/sql_blocks.py,sha256=R2xZsaKRd600rsZf0lzyXITALpZ3ZXBmwOADNpX1qUA,45798
3
+ sql_blocks-1.25.2.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
4
+ sql_blocks-1.25.2.dist-info/METADATA,sha256=NKLAHw43avYevBxxWhKBts8tOB2AaKETMp08dCoSAzQ,13423
5
+ sql_blocks-1.25.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
+ sql_blocks-1.25.2.dist-info/top_level.txt,sha256=57AbUvUjYNy4m1EqDaU3WHeP-uyIAfV0n8GAUp1a1YQ,11
7
+ sql_blocks-1.25.2.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- sql_blocks/__init__.py,sha256=5ItzGCyqqa6kwY8wvF9kapyHsAiWJ7KEXCcC-OtdXKg,37
2
- sql_blocks/sql_blocks.py,sha256=JYATgw-J3SzAVCYZpdNGyc7rK700jHJtOWbK9gxywu4,45466
3
- sql_blocks-1.25.1.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
4
- sql_blocks-1.25.1.dist-info/METADATA,sha256=k6Xd3FtNhl3KHAOzVA0zkx5TvQdcb2P5st6-fEm7r4M,13423
5
- sql_blocks-1.25.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
- sql_blocks-1.25.1.dist-info/top_level.txt,sha256=57AbUvUjYNy4m1EqDaU3WHeP-uyIAfV0n8GAUp1a1YQ,11
7
- sql_blocks-1.25.1.dist-info/RECORD,,