Desynth page and improved item info api. Added string substitution to utils.
This commit is contained in:
@@ -51,10 +51,21 @@ async def ensure_view():
|
||||
"""),
|
||||
{"table": t},
|
||||
)
|
||||
stack_exists = await conn.scalar(
|
||||
text(
|
||||
"""
|
||||
SELECT EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_name=:table AND column_name='stack_size'
|
||||
)
|
||||
"""),
|
||||
{"table": t},
|
||||
)
|
||||
desc_col = "description" if desc_exists else "NULL"
|
||||
icon_col = "icon_id" if icon_exists else "NULL"
|
||||
stack_col = "stack_size" if stack_exists else "NULL"
|
||||
selects.append(
|
||||
f"SELECT id, name, {desc_col} AS description, {icon_col} AS icon_id, type_description FROM {t}"
|
||||
f"SELECT id, name, {desc_col} AS description, {icon_col} AS icon_id, type_description, {stack_col} AS stack_size FROM {t}"
|
||||
)
|
||||
|
||||
union_sql = " UNION ALL ".join(selects)
|
||||
|
||||
Reference in New Issue
Block a user