-
-
Notifications
You must be signed in to change notification settings - Fork 964
Add feature multibots #824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for your suggestion! I guess what you're suggesting is implemented by using the table prefix when setting up the MySQL database connection: $table_prefix = 'customerN_';
$telegram->enableMySql($credentials, $table_prefix); What advantages do you see with adding a new field as you do, instead of prefixing tables? |
Example: |
Right, I see what you mean. But, (yes, of course there's a but 😁) apart from reducing the table count, this change will need many code modifications, which I'm not sure makes sense 🤔 @php-telegram-bot/developers @Hitmare @chuv1 What do you guys think? (By the way, number of tables shouldn't be a real-life issue: https://dev.mysql.com/doc/refman/5.7/en/database-count-limit.html) |
Ok, I try to get more involved in the reasons for it.
I do not insist further, if you do not like the idea, ok ... no problem. (-: |
I evaluated the situation again |
Right, I fully understand that.
It's not about that, it's more about making smart choices and not doing extra work that could be put into something else 😊 |
I like this idea, but we should think more about implementation details Maybe it is better to add |
now I evaluate, thanks |
As part of this whole issue, is to make the library less static (regarding Not sure how best to tackle that though. Using a proper ORM for DB handling has been pending for quite some time. Really should move on getting something done for that, to not let it hinder progress. |
ok, if it's so important, let's do that in the current version. What do you think? |
@noplanman this is not easy because of library architecture. Lets continue here #826 |
Is not easy like that, In messages table for example you have double primary index: |
Plus, if I may add, I think the whole DB feature (and so does Conversation) should be handled as plugin or addon after the refactor, those things shouldn't be core of the library because in larger project people might want to use their own implementations of both of these features and they are not required for library to function. |
hi guys, I tried to change the code according to my needs. I have not tested it completely yet, but I share it. I hope the functionality will be included in the next versions. I have also added the CreateTables method on DB Class; it is useful for create tables with the prefix Remember that it is to be tested Have a good time! |
Any updates in this feature request? |
I would like to modify the DB, and its classes, to add the field
bot_id int (10) unsigned
to manage multiple bots with the same 12 main tables.
Then you can still change the name of the tables to make groups of bots, for example, based on customers.
Are you interested in this modification of your code?
Before changing the code, I await your confirmation.
Thank you
SQL:
The text was updated successfully, but these errors were encountered: