How can I properly store Tiptap's deeply nested JSON editor content in a table?
I have rich text editor that outputs json formated data, the more formating the crazier the json.
Should i keep doing this? Im getting warning of deep nesting at level 16

11 Replies
Is it too big to stringify?
The nesting probably isn't meaningful from a database perspective.
i asked gpt and it said if i stringified it would hurt query time, and indexing
I would try it, gpt don't know 'bout us lol
ok i will try it. it would remove the nesting problem correct
I don't know for sure, but I imagine storing complex structured data has it's own penalty.
its not a problem keeping it nested for me, as it is a internal tool i can just ask people to not go crazy on the rich text editor
i was wondering how google docs does it since you can format as much as you would like
Convex's prosemirror component (which uses tiptap) uses strings: https://github.com/get-convex/prosemirror-sync/blob/main/src/component/schema.ts
GitHub
prosemirror-sync/src/component/schema.ts at main · get-convex/pros...
Sync prosemirror documents with Convex for server-authorized collaborative editing - get-convex/prosemirror-sync
Stringifying json is surprisingly fast in my experience, even in the browser.
It's also going to be sent to your function as a string anyway, might as well keep it that way. I'd stringify it right in the browser personally.
ok i will definitely try stringing it. only thing i lose is if i need to search inside it correct?
Yeah you wouldn't be able to do any object level operations on the data at rest, but I'd be surprised if that was actually happening anyway
great i will do that, thank you very much for the help erquahart!