Skip to content

Commit

Permalink
add(_quotes): Add _quotes static method
Browse files Browse the repository at this point in the history
  • Loading branch information
bbazsi41 committed Jun 3, 2024
1 parent 72731e5 commit 8e78e25
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cache_manager/_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ def _create_schema(self):
'''.format(typ, typ.upper()),
)


@staticmethod
def _quotes(string: str) -> str:

return f'"{string}"'


@staticmethod
def _table_fields(name: str = 'main') -> dict[str, str]:

Expand Down Expand Up @@ -343,11 +350,15 @@ def update(

update = update or {}


main = {k: v for k, v in update.items() if k in self._table_fields()}
ids = [it.id for it in items()]
_log(f'Updating {len(ids)} items')

where = self._where(uri, params, status, newer_than, older_than)

q = f'UPDATE main SET () '
q = (
'UPDATE main SET (%s) '
)
q += where

self._execute(q)
Expand Down

0 comments on commit 8e78e25

Please sign in to comment.