Open zxg110 opened 5 years ago
SquidDatabase
has methods tryCreateTable()
(or tryExecSql()
if you have arbitrary SQL you want to run), but this is not a good way to approach this problem. Regardless which kind of database or you use, your approach is going to run into problems because you are not identifying and associating your entities correctly.
The entities you have are chats
, messages
, and users
. Preferably, these entities would also exist on your server and have globally unique IDs.
chats
.users
.
I have such a need.I want to create a chat information table for each friend when I receive a chat message from the Internet.For example when I receive chat message from my friend Tom,I will check if there are tom_chat_table locally.If it exists,I will insert this chat message to tom_chat_table.If it not exists,I will create tom_chat_table and insert this chat message to tom_chat_table. Thanks