deadlinecode / baileys-bottle

56 stars 42 forks source link

Use foreign keys instead of simple-json to link messages with chats #1

Open Manjit2003 opened 2 years ago

Manjit2003 commented 2 years ago

This will help easily define reverse relationship for messages.

deadlinecode commented 2 years ago

Good idea I also already thought of this but since this is the first version of the package i just tried to mimic the behaviour of the makeInMemory store from baileys which also isn't relational but yeah thanks for the suggestion

Would you be able to contribute and make a PR?

Manjit2003 commented 2 years ago

Yes surely, I will submit one soon. Just assign it to me

deadlinecode commented 2 years ago

Another thing: I think theoretical we could include support for mongo db without a lot of rewriting since the only two relations are the MessageDic and PresenceDic once but if we make even the chats and everything relational we will prbbly forget about mongo db or nosql support

And also i think the primary keys need rewriting then because currently the behaviour is that one chat with a key can exist two times in the chat table

deadlinecode commented 1 year ago

Inconsistent data will be a huge problem when implementing this xD Since wa only syncs what it likes to sync we will have a lot of missing contacts, chats, groups and much much more