phpmyadmin / phpmyadmin/phpmyadmin

[Feat]: Simbiat Libraries Integration

Open
#19,725 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement undecided
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
  1. 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.
  2. Ability to find cyclic foreign keys and optionally issue some sort of warning
  3. Have current ROW_FORMAT in CREATE TABLE statement
  4. Ability to check if there are any values violating foreign key constraint
  5. Ability to fix foreign key constraint violations
  6. 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
  1. Use showOrderedTables from 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.
  2. Use checkCyclicForeignKeys from DB Manager library. Can be a feature in Operations tab to help find potentially problematic constraints.
  3. Use showCreateTable from DB Manager library. Probably should replace current way of getting CREATE TABLE. I am honestly not sure why regular MySQL/MariaDB SHOW CREATE does not show current row format, could be a bug, could be intentional, this is an easy fix.
  4. Use hasFKViolated from DB Manager library. Another potentially useful feature to Operations tab to help maintain data consistency.
  5. Use fixFKViolations from DB Manager library. Addition to previous item to help fix violations found.
  6. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.