sql-blocks 1.25.518999999999__tar.gz → 1.25.528999999999__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.1
2
2
  Name: sql_blocks
3
- Version: 1.25.518999999999
3
+ Version: 1.25.528999999999
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sql_blocks"
3
- version = "1.25.518999999999"
3
+ version = "1.25.528999999999"
4
4
  authors = [
5
5
  { name="Julio Cascalles", email="julio.cascalles@outlook.com" },
6
6
  ]
@@ -3,7 +3,7 @@ from setuptools import setup
3
3
 
4
4
  setup(
5
5
  name = 'sql_blocks',
6
- version = '1.25.518999999999',
6
+ version = '1.25.528999999999',
7
7
  author = 'Júlio Cascalles',
8
8
  author_email = 'julio.cascalles@outlook.com',
9
9
  packages = ['sql_blocks'],
@@ -131,6 +131,7 @@ class SQLObject:
131
131
  return s1 - s2
132
132
 
133
133
  def delete(self, search: str, keys: list=USUAL_KEYS, exact: bool=False):
134
+ search = re.escape(search)
134
135
  if exact:
135
136
  not_match = lambda item: not re.search(fr'\w*[.]*{search}$', item)
136
137
  else:
@@ -1437,7 +1438,11 @@ class CypherParser(Parser):
1437
1438
  raise ValueError(f'Unknown function `{func_name}`.')
1438
1439
  if ':' in token:
1439
1440
  token, field_alias = token.split(':')
1440
- class_type = class_type().As(field_alias)
1441
+ if extra_classes == [OrderBy]:
1442
+ class_type = class_type().As(field_alias, OrderBy)
1443
+ extra_classes = []
1444
+ else:
1445
+ class_type = class_type().As(field_alias)
1441
1446
  class_list = [class_type]
1442
1447
  class_list += extra_classes
1443
1448
  FieldList(token, class_list).add('', self.queries[-1])
@@ -2042,21 +2047,3 @@ def detect(text: str, join_queries: bool = True, format: str='') -> Select | lis
2042
2047
  return result
2043
2048
  # ===========================================================================================//
2044
2049
 
2045
-
2046
- if __name__ == "__main__":
2047
- query = detect("""
2048
- SELECT
2049
- e.gender, d.region,
2050
- Avg(e.age)
2051
- FROM
2052
- Employees e
2053
- JOIN Departments d ON (e.depto_id = d.id)
2054
- WHERE
2055
- e.name LIKE 'A%'
2056
- GROUP BY
2057
- e.gender, d.region
2058
- ORDER BY
2059
- d.region DESC
2060
- """)
2061
- PandasLanguage.file_extension = FileExtension.XLSX
2062
- print( query.translate_to(PandasLanguage) )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sql_blocks
3
- Version: 1.25.518999999999
3
+ Version: 1.25.528999999999
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