Is there a way to disable the monaco editor?
My use case:
I really need to filter out a table and its relationships. Also, hide irrelevant columns. Using python, I can load the editor content, set a filter value and comment all lines that I’m not interested in. And then generate a new dbml string.
But it requires me to leave dbdiagram and use an external code.
Then, I tried to create a chrome extension to do the same using js. The problem I’m facing is: each line is inside a different, and unordered, div element. Worst, after I modify my string to comment undesired lines, I cannot inject the new string into the editor. I tried to replace the textarea.inputarea content but it doesn`t work.
If the editor were a single textarea, I could easily load its content, change it, and send it back to the textarea.
Option B: I got to get a diagramId content via API using python (endpoint = f’https://api.dbdiagram.io/query/{SOURCE_DIAGRAM}'), but when I try to write it back, it creates a new diagram, instead of updating the existing one. Is it possible to update an existing diagram instead of creating a new one? I tried to send the id using both _id
and ìd` keys (ignored).
payload = {
'_id': xxx,
'content': '//test',
'userid': xxx,
'name': 'Test',
'id': xxx}
requests.post(f'https://api.dbdiagram.io/query', headers=headers, json=payload)