Best practices for saving to the databse? #964
Replies: 4 comments 2 replies
-
I, for now, store both the HTML and JSON. JSON feels more robust, and I think it is good to have it, in case something happens to your HTML, which can be easily messed up. However, I think I had a problem where I wanted to turn JSON to HTML, and without the editor that is not possible (I also have some custom elements). So I also have HTML available all the time and I use it to do some updates to the structure when sending it to front end for reading |
Beta Was this translation helpful? Give feedback.
-
Hi, I explored Tiptap as an editor and want to integrate in into a VUE+Django App. Thanks |
Beta Was this translation helpful? Give feedback.
-
@gimyboya did you found a best way to store tiptap content to database ? |
Beta Was this translation helpful? Give feedback.
-
If using PostgreSQL, is it best to store the data in JSONB and use a GIN index? const contentJson = editor.getJSON(); |
Beta Was this translation helpful? Give feedback.
-
Hopefully this discussion will help me and others understand or see what are the best practices out there for storing content from tiptap (or from a WYISWYG editor in general) to the database.
Since tiptap can export the data both in HTML and JSON I was wondering What's the best format to use for storing the data.
Also taking in consideration performance and security and anything else you might be, I am interested to learn on what practices you guys do before saving to the database and the logic behind it, example how to sanitize, should certain tasks be done client side vs server side etc..
Beta Was this translation helpful? Give feedback.
All reactions