sql-blocks 0.1.3__tar.gz → 0.1.4__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: 0.1.3
3
+ Version: 0.1.4
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 = "0.1.3"
3
+ version = "0.1.4"
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 = '0.1.3',
6
+ version = '0.1.4',
7
7
  author = 'Júlio Cascalles',
8
8
  author_email = 'julio.cascalles@outlook.com',
9
9
  packages = ['sql_blocks'],
@@ -74,14 +74,18 @@ class SQLObject:
74
74
  if symmetrical:
75
75
  fld = fld.lower()
76
76
  return fld.strip()
77
- # if key == SELECT and re.search(' as | AS ', fld)
77
+ def is_named_field(fld: str) -> bool:
78
+ return key == SELECT and re.search(' as | AS ', fld)
78
79
  pattern = KEYWORD[key][2]
79
80
  if key == WHERE and symmetrical:
80
81
  pattern = f'{PATTERN_PREFIX}| '
81
82
  separator = self.get_separator(key)
82
83
  def field_set(source: list) -> set:
83
84
  return set(
84
- re.sub(pattern, '', cleanup(fld))
85
+ (
86
+ fld if is_named_field(fld) else
87
+ re.sub(pattern, '', cleanup(fld))
88
+ )
85
89
  for string in source
86
90
  for fld in re.split(separator, string)
87
91
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sql_blocks
3
- Version: 0.1.3
3
+ Version: 0.1.4
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
File without changes
File without changes
File without changes