formatting, indexes optimized

This commit is contained in:
Frederik Jaeckel 2023-11-29 15:19:38 +01:00
parent 510357a13c
commit 9ee924f0d8
11 changed files with 90 additions and 94 deletions

View file

@ -15,6 +15,8 @@ from sql import With
from sql.functions import Function
from sql.conditionals import Coalesce
import copy
from .const import DEF_NONE
if config.get('cashbook', 'memcache', default='yes').lower() \
in ['yes', '1', 'true']:
@ -269,7 +271,7 @@ def order_name_hierarchical(model_name, tables):
lines = With('id', 'name', 'name_path', recursive=True)
lines.query = tab_mod.select(
tab_mod.id, tab_mod.name, Array(tab_mod.name),
where=tab_mod.parent == None,
where=tab_mod.parent == DEF_NONE,
)
lines.query |= tab_mod2.join(
lines,