apexdevkit 1.17.16__tar.gz → 1.17.17__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.
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/PKG-INFO +1 -1
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/mssql.py +19 -6
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/sql.py +8 -4
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/pyproject.toml +1 -1
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/LICENSE +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/README.md +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/environment.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/error.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/name.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/request.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/key_fn.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/query/__init__.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/query/generator.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/query/query.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/decorator.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/mongo.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/repository/sqlite.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/server.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/synchronization.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/testing/rest.py +0 -0
- {apexdevkit-1.17.16 → apexdevkit-1.17.17}/apexdevkit/value.py +0 -0
|
@@ -246,19 +246,32 @@ class DefaultSqlTable(SqlTable[ItemT]):
|
|
|
246
246
|
placeholders = ", ".join(
|
|
247
247
|
[f"%({key.name})s" for key in self.fields if key.include_in_insert]
|
|
248
248
|
)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
try:
|
|
250
|
+
self.fields.id
|
|
251
|
+
output = ", ".join(
|
|
252
|
+
["[" + field.name + "] AS " + field.name for field in self.fields]
|
|
253
|
+
)
|
|
254
|
+
where_statement = f"""
|
|
255
|
+
FROM [{self.schema}].[{self.table}]
|
|
256
|
+
{self.fields.where_statement(include_id=True, read_id=True)}
|
|
257
|
+
"""
|
|
258
|
+
except ValueError:
|
|
259
|
+
output = ", ".join(
|
|
260
|
+
["%(" + field.name + ")s AS " + field.name for field in self.fields]
|
|
261
|
+
)
|
|
262
|
+
where_statement = ""
|
|
252
263
|
|
|
253
264
|
return DatabaseCommand(f"""
|
|
254
265
|
{self._user_check}
|
|
255
266
|
INSERT INTO [{self.schema}].[{self.table}] (
|
|
256
267
|
{columns}
|
|
257
|
-
)
|
|
258
|
-
{output}
|
|
268
|
+
)
|
|
259
269
|
VALUES (
|
|
260
270
|
{placeholders}
|
|
261
|
-
)
|
|
271
|
+
);
|
|
272
|
+
SELECT
|
|
273
|
+
{output}
|
|
274
|
+
{where_statement}
|
|
262
275
|
REVERT
|
|
263
276
|
""").with_data(self.fields.with_fixed(self.formatter.dump(item)))
|
|
264
277
|
|
|
@@ -140,12 +140,12 @@ class SqlFieldManager:
|
|
|
140
140
|
def __iter__(self) -> Iterator[_SqlField]:
|
|
141
141
|
yield from self.fields
|
|
142
142
|
|
|
143
|
-
def where_statement(self, include_id: bool = False) -> str:
|
|
143
|
+
def where_statement(self, include_id: bool = False, read_id: bool = False) -> str:
|
|
144
144
|
statements = [
|
|
145
145
|
statement
|
|
146
146
|
for statement in [
|
|
147
147
|
self._parent_filter(),
|
|
148
|
-
self._id_filter(include_id),
|
|
148
|
+
self._id_filter(include_id, read_id),
|
|
149
149
|
self._general_filters(),
|
|
150
150
|
]
|
|
151
151
|
if statement != ""
|
|
@@ -177,11 +177,15 @@ class SqlFieldManager:
|
|
|
177
177
|
else:
|
|
178
178
|
return ""
|
|
179
179
|
|
|
180
|
-
def _id_filter(self, include_id: bool
|
|
180
|
+
def _id_filter(self, include_id: bool, read_id: bool) -> str:
|
|
181
181
|
return (
|
|
182
182
|
self.key_formatter.replace("x", self.id)
|
|
183
183
|
+ " = "
|
|
184
|
-
+
|
|
184
|
+
+ (
|
|
185
|
+
self.value_formatter.replace("x", self.id)
|
|
186
|
+
if not read_id
|
|
187
|
+
else "SCOPE_IDENTITY()"
|
|
188
|
+
)
|
|
185
189
|
if include_id
|
|
186
190
|
else ""
|
|
187
191
|
)
|
|
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
|
|
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
|