phpmyadmin / phpmyadmin/phpmyadmin
[Feat]: Simbiat Libraries Integration
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 7.9k
- Forks
- 3.6k
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 36
Description
phpMyAdmin version
5.2.2
Describe the feature
- Ability to generate a list of tables in order, where first you have tables without dependencies (no foreign keys), and then tables that are dependent on tables that have come before.
- Ability to find cyclic foreign keys and optionally issue some sort of warning
- Have current ROW_FORMAT in CREATE TABLE statement
- Ability to check if there are any values violating foreign key constraint
- Ability to fix foreign key constraint violations
- Logic to suggest run of OPTIMIZE, ANALYZE, CHECK/REPAIR or table compression for specific tables (optionally running them), potentially with some kind of dashboard to show current status
Describe the solution
- Use
showOrderedTablesfrom DB Manager library. Can be used when exporting multiple tables (or whole database) from PHPMyAdmin to minimize potential issues when re-importing them later without disabling foreign keys. - Use
checkCyclicForeignKeysfrom DB Manager library. Can be a feature inOperationstab to help find potentially problematic constraints. - Use
showCreateTablefrom DB Manager library. Probably should replace current way of getting CREATE TABLE. I am honestly not sure why regular MySQL/MariaDBSHOW CREATEdoes not show current row format, could be a bug, could be intentional, this is an easy fix. - Use
hasFKViolatedfrom DB Manager library. Another potentially useful feature toOperationstab to help maintain data consistency. - Use
fixFKViolationsfrom DB Manager library. Addition to previous item to help fix violations found. - Integrate DB Maintainer library.
The last one is more complex, since the whole library is much more complex and has a bunch of logic behind it. In short it aims to help with deciding when certain maintenance actions should be run on tables. It now stores data in its own tables, and those tables can be created similarly to tables PHPMyAdmin can create for other features. If created, PHPMyAdmin can trigger automatic analysis periodically, and provide a dashboard (perhaps even on home screen) to suggest running those actions.
Analysis can also be triggered per table from Operations tab, and the same can be done for automatic run of those actions or generating the commands. (probably as a bunch of checkboxes). If integrated PHPMyAdmin probably should use library's function to run respective commands on tables when triggered through existing tools or, at least, use the commands generation logic to generate UPDATE queries to update statistics used by the library to suggest stuff.
Library has a bunch of settings, those can be exposed through config and UI. It also allows fine-tuning behavior on per-table level, but I am not sure what would be a good way to implement those in UI without some sort of a dashboard. Although settings could be present in Operations tab, I guess.
It also could be beneficial to do the analysis automatically if PHPMyAdmin is run in a container.
Describe the alternatives
Items 1 through 5: essentially manually doing the queries. The integration would allow one-click (or maybe two-click) solution.
Item 6: a lot of painstaking monitoring and elaboration on whether to do something or not, and probably learning some peculiarities of MySQL/MariaDB.
Additional context
I have 2 libraries that have a bunch of functions, that may be useful for managing databases, and I think including them in PHPMyAdmin the most popular tool for users of PHP could be be beneficial to the users, at least in some niche cases.
I am ready to do what I can with PR(s) for any of this (if any), but I honestly do not know if I am just biased thinking these things could be useful for others, and even if I am not - I do not know where I can start, and what things I need to consider and generally be aware of, when working on the code.
Both libraries have appropriate readme files, but if anything is unclear there, let me know, I'll try to answer any questions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by reading the linked DB Manager and DB Maintainer library READMEs, then inspect phpMyAdmin's existing export and Operations integration points to identify one narrowly scoped capability. Done should mean an agreed scope, documented behavior, and coverage for the selected integration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, mysql, php
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100