mirror of
https://github.com/fastapi/sqlmodel.git
synced 2025-08-14 17:41:37 +08:00
♻️ Update expresion.py
, sync from Jinja2 template, implement inherit_cache
to solve errors like: SAWarning: Class SelectOfScalar will not make use of SQL compilation caching
(#422)
This commit is contained in:

committed by
GitHub

parent
f232166db5
commit
b51ebaf658
@ -1,3 +1,4 @@
|
||||
import os
|
||||
from itertools import product
|
||||
from pathlib import Path
|
||||
from typing import List, Tuple
|
||||
@ -52,4 +53,11 @@ result = (
|
||||
|
||||
result = black.format_str(result, mode=black.Mode())
|
||||
|
||||
current_content = destiny_path.read_text()
|
||||
|
||||
if current_content != result and os.getenv("CHECK_JINJA"):
|
||||
raise RuntimeError(
|
||||
"sqlmodel/sql/expression.py content not update with Jinja2 template"
|
||||
)
|
||||
|
||||
destiny_path.write_text(result)
|
||||
|
Reference in New Issue
Block a user