t-sql 4.9.0__tar.gz → 4.9.1__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.
- {t_sql-4.9.0 → t_sql-4.9.1}/PKG-INFO +1 -1
- {t_sql-4.9.0 → t_sql-4.9.1}/pyproject.toml +1 -1
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_query_builder.py +13 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tsql/query_builder.py +7 -1
- {t_sql-4.9.0 → t_sql-4.9.1}/.dockerignore +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/.github/workflows/publish.yml +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/.github/workflows/test.yml +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/.gitignore +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/Dockerfile +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/LICENSE +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/README.md +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/compose.yaml +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/context7.json +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/pytest.ini +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_alembic_integration.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_asyncpg_integration.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_deep_nesting.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_different_object_types.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_error_messages.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_escaped.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_escaped_binary_hex.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_helper_functions.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_injection_edge_cases.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_injection_protection_validation.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_injections_for_escaped.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_like_patterns.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_mysql_integration.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_parameter_names.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_sqlalchemy_integration.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_sqlite_integration.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_string_based_builders.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_styles.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_template_in_builders.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_tsql.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tests/test_type_processor.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tsql/__init__.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tsql/row.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tsql/styles.py +0 -0
- {t_sql-4.9.0 → t_sql-4.9.1}/tsql/type_processor.py +0 -0
|
@@ -116,6 +116,19 @@ def test_select_specific_columns():
|
|
|
116
116
|
assert params == []
|
|
117
117
|
|
|
118
118
|
|
|
119
|
+
def test_multiple_select_calls_append():
|
|
120
|
+
"""Test that multiple .select() calls append columns instead of replacing them"""
|
|
121
|
+
query = Users.select(Users.id)
|
|
122
|
+
query.select(Users.username, Users.email)
|
|
123
|
+
sql, params = query.render()
|
|
124
|
+
|
|
125
|
+
# All three columns should be present
|
|
126
|
+
assert 'users.id' in sql
|
|
127
|
+
assert 'users.username' in sql
|
|
128
|
+
assert 'users.email' in sql
|
|
129
|
+
assert params == []
|
|
130
|
+
|
|
131
|
+
|
|
119
132
|
def test_select_with_where():
|
|
120
133
|
"""Test SELECT with WHERE clause"""
|
|
121
134
|
query = Users.select(Users.id, Users.username).where(Users.id == 5)
|
|
@@ -1201,7 +1201,13 @@ class SelectQueryBuilder(QueryBuilder):
|
|
|
1201
1201
|
# No columns specified selects all (SELECT *)
|
|
1202
1202
|
users.select()
|
|
1203
1203
|
"""
|
|
1204
|
-
|
|
1204
|
+
if columns:
|
|
1205
|
+
if self._columns is None:
|
|
1206
|
+
self._columns = []
|
|
1207
|
+
self._columns.extend(columns)
|
|
1208
|
+
else:
|
|
1209
|
+
# Calling select() with no args resets to SELECT *
|
|
1210
|
+
self._columns = None
|
|
1205
1211
|
return self
|
|
1206
1212
|
|
|
1207
1213
|
def where(self, condition: Union[Condition, Template]) -> 'SelectQueryBuilder':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|