Jaxon DbAdmin is a complete rewrite of Adminer, the popular database admin dashboard.
It inserts a database admin dashboard into an existing PHP application. Thanks to the Jaxon library, it installs and runs in a page of the application. All its operations are performed with Ajax requests.
This application and the related packages are still being actively developed, and the provided features are still basic and need improvements.
The following features are currently available:
- Browse servers and databases.
- Show tables and views details.
- Query a table.
- Query a view.
- Execute queries in the query editor.
- Use a better editor for SQL queries.
- Save and show the query history.
- Save queries in user favorites.
- Import or export data.
- Insert, modify or delete data in a table.
- Create or drop a database.
- Create or alter a table or view.
- Drop a table or view.
- Browse servers and databases in multiple tabs.
The following features are not yet implemented, and planned for future releases:
- Save the current tabs in user preferences.
- Navigate through related tables.
- Code completion for table and field names in the SQL editor.
- An advanced GUI-based query builder.
- Automated tests.
This blog post on the Jaxon website explains how to install Jaxon DbAdmin on Backpack, a Laravel-based admin panel: https://www.jaxon-php.org/blog/2025/07/install-jaxon-dbadmin-on-backpack.html.
The https://github.com/lagdo/dbadmin-app repo provides a ready-to-use application, made with the Laravel framework, and Jaxon DbAdmin.
The driver packages for PostgreSQL, MySQL and SQLite are already installed, so the user just need to add its databases in the config file.
A Docker image is also provided to get started easily. It runs the Laravel based DbAdmin application.
The docker/ dir provides 3 Docker Compose files to start the database servers (PostgreSQL, MariaDB and MySQL), the Infisical secret management service, and the DBAdmin demo apps.
The seed container in the docker/compose-dbserver Docker Compose can be used to populate the databases with popular freely online available data.
These scripts are located in the seed dir, which is mounted in the /home/seed/scripts dir in the seed container.
Install the Jaxon library so it bootstraps from a config file and handles ajax requests. Here's the documentation.
Install this package with Composer. If a Jaxon plugin exists for your framework, you can also install it. It will automate the previous step.
Install the drivers packages for the database servers you need to manage. The following drivers are available:
- MySQL: https://github.com/lagdo/dbadmin-driver-mysql
- PostgreSQL: https://github.com/lagdo/dbadmin-driver-pgsql
- Sqlite: https://github.com/lagdo/dbadmin-driver-sqlite
Declare the package and the database servers in the app.packages section of the Jaxon configuration.
See the Jaxon packages documentation.
See the corresponding database driver package for specific database server options.
'app' => [
// Other config options
// ...
'packages' => [
Lagdo\DbAdmin\Db\DbAdminPackage::class => [
'servers' => [
// The database servers
'pgsql_server' => [ // A unique identifier for this server
'driver' => 'pgsql',
'name' => '', // The name to be displayed in the dashboard UI.
'host' => '', // The database host name or address.
'port' => 0, // The database port. Optional.
'username' => '', // The database user credentials.
'password' => '', // The database user credentials.
],
'mysql_server' => [ // A unique identifier for this server
'driver' => 'mysql',
'name' => '', // The name to be displayed in the dashboard UI.
'host' => '', // The database host name or address.
'port' => 0, // The database port. Optional.
'username' => '', // The database user credentials.
'password' => '', // The database user credentials.
],
],
],
],
],Insert the CSS and javascript codes in the HTML pages of your application using calls to Jaxon\jaxon()->getCss() and Jaxon\jaxon()->getScript(true).
In the page that displays the dashboard, insert the HTML code returned by the call to Jaxon\jaxon()->package(\Lagdo\DbAdmin\Db\DbAdminPackage::class)->getHtml(). Two cases are then possible.
-
If the dashboard is displayed on a dedicated page, make a call to
Jaxon\jaxon()->package(\Lagdo\DbAdmin\Db\DbAdminPackage::class)->ready()in your PHP code when loading the page. -
If the dashboard is loaded with an Ajax request in a page already displayed, execute the javascript code returned the call to
Jaxon\jaxon()->package(\Lagdo\DbAdmin\Db\DbAdminPackage::class)->getReadyScript()after the page is loaded.
This package uses the HTML UI builder to build UI components for various frontend frameworks. The packages for the UI framework in use must also be installed. The following builders are available:
- Bootstrap 5: https://github.com/lagdo/ui-builder-bootstrap5
- Bootstrap 4: https://github.com/lagdo/ui-builder-bootstrap4
- Bootstrap 3: https://github.com/lagdo/ui-builder-bootstrap3
In the above example, the UI will be built with Bootstrap5 components.
'app' => [
'ui' => [
'template' => 'bootstrap5',
],
],There are other config options that can be used to customize Jaxon DbAdmin operation.
The default option sets a database server Jaxon DbAdmin must connect to when it starts.
'app' => [
'packages' => [
Lagdo\DbAdmin\Db\DbAdminPackage::class => [
'servers' => [
// The database servers
],
'default' => 'server_id',
],
],
],The access section provides a few options to restrict access to databases on any server.
If the access.server option is set to false at package level, then the access to all servers information will be forbidden, and the user will have access only to database contents.
The access.server option can also be set at a server level, and in this case it applies only to that specific server.
'app' => [
'packages' => [
Lagdo\DbAdmin\Db\DbAdminPackage::class => [
'servers' => [
// The database servers
'server_id' => [
// Database options
'access' => [
'server' => true,
],
],
],
'default' => 'server_id',
'access' => [
'server' => false,
],
],
],
],In this configuration, the user will get access to server information only on the server with id server_id.
The access.databases and access.schemas options define the set of databases and schemas the user can access.
This options can only be defined at server level, and will apply to that specific server.
The access.schemas option will apply only on servers which provide that feature.
'app' => [
'packages' => [
Lagdo\DbAdmin\Db\DbAdminPackage::class => [
'servers' => [
// The database servers
'server_id' => [
// Database options
'access' => [
'server' => false,
'databases' => ['db1', 'db2', 'db3'],
'schemas' => ['public'],
],
],
],
'default' => 'server_id',
],
],
],In this configuration, the user will be able to get access only to three databases on the server with id server_id.
The app admin may need to customize the access parameters, depending for example on the connected user account or group.
In this case, the provider option can be used to define a callable that returns the access options as an array,
which will then be used to configure the package.
The defined options are passed to the callable, so it can be used as a basis to build the customized config.
$dbAdminOptionsGetter = function($config) {
$config['servers']['server_mysql'] = [
'driver' => 'mysql',
'name' => '', // The name to be displayed in the dashboard UI.
'host' => '', // The database host name or address.
'port' => 0, // The database port. Optional.
'username' => '', // The database user credentials.
'password' => '', // The database user credentials.
];
$config['servers']['server_pgsql'] = [
'driver' => 'pgsql',
'name' => '', // The name to be displayed in the dashboard UI.
'host' => '', // The database host name or address.
'port' => 0, // The database port. Optional.
'username' => '', // The database user credentials.
'password' => '', // The database user credentials.
];
return $config;
}; 'app' => [
// Other config options
// ...
'packages' => [
Lagdo\DbAdmin\Db\DbAdminPackage::class => [
// A callable that return the access options.
'provider' => $dbAdminOptionsGetter,
'servers' => [],
'default' => 'server_mysql',
'access' => [
'server' => false,
],
],
],
],Starting from version 0.9.0, the SQL queries that are executed can also be printed in the browser debug console,
if the debug.queries option is set to true.
'app' => [
'packages' => [
Lagdo\DbAdmin\Db\DbAdminPackage::class => [
'debug' => [
'queries' => true,
],
'servers' => [
// The database servers
],
],
],
],Databases can be exported to various types of files: SQL, CSV, and more.
The export feature is configured with two callbacks.
The writer callback saves the export data content in a file. It takes the content and the file name as parameters, and returns the URI to the created file.
It must return an empty string in case of error.
The reader callback takes an export file name as parameter, then reads and returns its content.
The web app must be configured to call the reader callback and send back the returned content when an HTTP request hits the URI returned by the writer callback.
Both callbacks can use the Jaxon Storage, as in the example below, to read and write the exported files, which can then be saved on different types of filesystems, thanks to the Flysystem library.
The callbacks can also save the file in different locations, depending for example on the application user.
use League\Flysystem\FilesystemException;
use League\Flysystem\UnableToReadFile;
use League\Flysystem\UnableToWriteFile;
use function Jaxon\storage;
'app' => [
'storage' => [
'stores' => [
'exports' => [
'adapter' => 'local',
'dir' => "/path/to/exports",
],
],
],
'packages' => [
Lagdo\DbAdmin\Db\DbAdminPackage::class => [
'servers' => [
// The database servers
],
'export' => [
'writer' => function(string $content, string $filename): string {
try {
// Make a Filesystem object with the storage.exports options.
$storage = storage()->get('exports');
$storage->write($filename, "$content\n");
} catch (FilesystemException|UnableToWriteFile) {
return '';
}
// Return the link to the exported file.
return "/export.php?file=$filename";
},
'reader' => function(string $filename): string {
try {
// Make a Filesystem object with the storage.exports options.
$storage = storage()->get('exports');
return !$storage->fileExists($filename) ?
"No file $filename found." : $storage->read($filename);
} catch (FilesystemException|UnableToReadFile) {
return "No file $filename found.";
}
},
],
],
],
],SQL files can be uploaded and executed on a server. This feature is implemented using the Jaxon ajax upload and Jaxon Storage packages, which then needs to be configured in the Jaxon config file.
'app' => [
'storage' => [
'uploads' => [
'adapter' => 'local',
'dir' => '/path/to/the/upload/dir',
],
],
'upload' => [
'enabled' => true,
'files' => [
'sql_files' => [
'storage' => 'uploads',
],
],
],
],In this example, sql_files is the name attribute of the file upload field, and of course /path/to/the/upload/dir needs to be writable.
Other parameters can also be defined to limit the size of the uploaded files or retrict their extensions or mime types.
the Jaxon ajax upload documentation
- Issue Tracker: github.com/lagdo/jaxon-dbadmin/issues
- Source Code: github.com/lagdo/jaxon-dbadmin
The project is licensed under the Apache license.