Loading transfer_service/db_connector.py +4 −4 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class DbConnector(object): if self.conn: out = open("db_connector_log.txt", "a") #print(f"parentOSPath: {node.parentPath}") self.cursor.execute("SELECT path FROM Node n JOIN node_os_path o ON n.node_id = o.node_id WHERE os_path = %s;", (node.parentPath,)) self.cursor.execute("SELECT path FROM node n JOIN node_os_path o ON n.node_id = o.node_id WHERE os_path = %s;", (node.parentPath,)) result = self.cursor.fetchall() for i in result: out.write(f"queryResult: {i}\n") Loading @@ -76,7 +76,7 @@ class DbConnector(object): out.close() #print(f"parentLtreePath: {parentLtreePath}, type: {type(parentLtreePath)}") self.cursor.execute(""" INSERT INTO Node(parent_path, parent_relative_path, name, tstamp_wrapper_dir, type, owner_id, creator_id, content_md5) INSERT INTO node(parent_path, parent_relative_path, name, tstamp_wrapper_dir, type, owner_id, creator_id, content_md5) VALUES (%s, %s, %s, %s, %s, %s, %s, %s); """, (parentLtreePath, Loading @@ -92,8 +92,8 @@ class DbConnector(object): def setAsyncTrans(self, nodeOSPath, value): if self.conn: self.cursor.execute(""" UPDATE Node SET async_trans = %s WHERE node_id IN UPDATE node SET async_trans = %s WHERE node_id = (SELECT node_id FROM node_os_path WHERE os_path = %s); """, Loading Loading
transfer_service/db_connector.py +4 −4 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class DbConnector(object): if self.conn: out = open("db_connector_log.txt", "a") #print(f"parentOSPath: {node.parentPath}") self.cursor.execute("SELECT path FROM Node n JOIN node_os_path o ON n.node_id = o.node_id WHERE os_path = %s;", (node.parentPath,)) self.cursor.execute("SELECT path FROM node n JOIN node_os_path o ON n.node_id = o.node_id WHERE os_path = %s;", (node.parentPath,)) result = self.cursor.fetchall() for i in result: out.write(f"queryResult: {i}\n") Loading @@ -76,7 +76,7 @@ class DbConnector(object): out.close() #print(f"parentLtreePath: {parentLtreePath}, type: {type(parentLtreePath)}") self.cursor.execute(""" INSERT INTO Node(parent_path, parent_relative_path, name, tstamp_wrapper_dir, type, owner_id, creator_id, content_md5) INSERT INTO node(parent_path, parent_relative_path, name, tstamp_wrapper_dir, type, owner_id, creator_id, content_md5) VALUES (%s, %s, %s, %s, %s, %s, %s, %s); """, (parentLtreePath, Loading @@ -92,8 +92,8 @@ class DbConnector(object): def setAsyncTrans(self, nodeOSPath, value): if self.conn: self.cursor.execute(""" UPDATE Node SET async_trans = %s WHERE node_id IN UPDATE node SET async_trans = %s WHERE node_id = (SELECT node_id FROM node_os_path WHERE os_path = %s); """, Loading