MCPcopy Create free account
hub / github.com/HexHive/NASS / insert_update_arg

Function insert_update_arg

data/interface_db.py:86–106  ·  view source on GitHub ↗
(connection, interface_id, arg:Arg, order)

Source from the content-addressed store, hash-verified

84
85
86def insert_update_arg(connection, interface_id, arg:Arg, order):
87 try:
88 arg_existing = get_arg(connection, interface_id, order)
89 if arg_existing is None:
90 arg_id = insert_arg(connection, interface_id, order)
91 return arg_id
92 else:
93 cursor = connection.cursor()
94 update_query = """UPDATE arg SET interface_id = ?,
95 ordering = ?,
96 type = ?, info = ?, constr = ?,
97 where id = ?
98 """
99 cursor.execute(update_query, interface_id, order,
100 arg.argtype, "", "", arg_existing.db_id)
101 connection.commit()
102 cursor.close()
103 return arg.db_id
104 except Exception as e:
105 logging.error(f'[BINDERDB] Failed insert/update of service{str(e)}, {traceback.format_exc()}')
106 print(f'[BINDERDB] Failed insert/update of service {str(e)}, {traceback.format_exc()}')
107
108def get_arg(connection, interface_id, ordering):
109 try:

Callers 1

insert_update_interfaceFunction · 0.85

Calls 3

get_argFunction · 0.85
insert_argFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected