Skip to content

Commit

Permalink
Started implementing sqlalchemy Query class to manage the queries
Browse files Browse the repository at this point in the history
  • Loading branch information
npalacioescat committed Jan 24, 2025
1 parent 3f05762 commit f8a652a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion omnipath_server/service/_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ class LegacyService:

def __init__(
self,
con: _connection.Connection | dict | None = None,
input_files = None,
only_tables = None,
exclude_tables = None,
Expand All @@ -721,6 +722,8 @@ def __init__(

_log('TableServer starting up.')

self.con = _connection.ensure_con(con)

self.input_files = copy.deepcopy(self.default_input_files)
self.input_files.update(input_files or {})
self.data = {}
Expand Down Expand Up @@ -1279,14 +1282,18 @@ def _query(self, args: dict, query_type: str) -> str:

return bad_req

# Instance of sqlalchemy.orm.Query
query = self.con.session.query(self._schema(query_type))

#HERE
if 'databases' in args:

args['resources'] = args['databases']

hdr = self._columns(query_type)

# Filtering for resources
if b'resources' in req.args:
if 'resources' in args:

resources = self._args_set(req, 'resources')

Expand Down

0 comments on commit f8a652a

Please sign in to comment.