Navigation Menu

Skip to content
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

Store session in DB #808

Merged
merged 25 commits into from Jun 14, 2020
Merged

Store session in DB #808

merged 25 commits into from Jun 14, 2020

Conversation

xtrime-ru
Copy link
Collaborator

@xtrime-ru xtrime-ru commented May 3, 2020

Refactor storage mechanism. Add ability to store properties in mysql. Reduce ram consumption.

@xtrime-ru
Copy link
Collaborator Author

@danog Can you review this PR?

@andrew-ld
Copy link
Contributor

ora daniil sara obbligato a ficcare mysql

@andrew-ld
Copy link
Contributor

@xtrime-ru
Copy link
Collaborator Author

ora daniil sara obbligato a ficcare mysql

There is not many options to chose. Only mysql and redis have async drivers in amp. And i don't like redis :)

But its easy to write adapter for redis later.

@xtrime-ru
Copy link
Collaborator Author

Docs PR: danog/MadelineProtoDocs#18

@xtrime-ru
Copy link
Collaborator Author

@xtrime-ru xtrime-ru merged commit cbd1a6c into danog:master Jun 14, 2020
@xtrime-ru xtrime-ru deleted the db branch June 15, 2020 11:28
@svdaru
Copy link
Contributor

svdaru commented Jul 30, 2020

Are there plans to add support of postgres? amp supports it https://github.com/amphp/postgres

@xtrime-ru
Copy link
Collaborator Author

xtrime-ru commented Jul 30, 2020

Are there plans to add support of postgres? amp supports it https://github.com/amphp/postgres

I have no plans to add any other db. But it's not hard to add another provider in your pull request:

  1. Create similar data type: \danog\MadelineProto\Db\MysqlArray
  2. Create new connection like this: \danog\MadelineProto\Db\Mysql
  3. Use new connection inside new data type
  4. And add reference to new data type here: \danog\MadelineProto\Db\DbPropertiesFabric::get
  5. Add default settings here: src/danog/MadelineProto/MTProto.php:1349
  6. Use new storage type in settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants