lagdo / jaxon-dbadmin
Database management dashboard based on Jaxon and Adminer
Installs: 184
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Type:application
Requires
- php: >=7.1.0
- ext-iconv: *
- ext-json: *
- jaxon-php/jaxon-annotations: ^2.2
- jaxon-php/jaxon-core: ^4.6
- jaxon-php/jaxon-dialogs: ^4.0
- lagdo/dbadmin-driver: ^0.8
- lagdo/ui-builder: ^0.1
Requires (Dev)
- behat/behat: ^3.10
- dvdoug/behat-code-coverage: 5.0.*
- php-coveralls/php-coveralls: ^2.5
- phpunit/phpcov: ^8.2
- phpunit/phpunit: ^9.5
- dev-main
- v1.0-alpha.6
- v1.0-alpha.5
- v1.0-alpha.4
- v1.0-alpha.3
- v1.0-alpha.2
- v1.0-alpha.1
- v0.16.3
- v0.16.2
- v0.16.1
- v0.16.0
- v0.15.3
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.2
- v0.14.1
- 0.14.0
- v0.13.5
- v0.13.4
- v0.13.3
- v0.13.2
- v0.13.1
- v0.13.0
- v0.12.0
- v0.11.1
- v0.11.0
- 0.10.x-dev
- v0.10.5
- v0.10.4
- v0.10.3
- v0.10.2
- 0.10.1
- v0.10.0
- v0.9.1
- v0.9.0
- v0.8.6
- v0.8.5
- v0.8.4
- v0.8.3
- 0.8.2
- v0.8.1
- v0.8.0
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.10
- v0.6.9
- v0.6.8
- v0.6.7
- v0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.1
- v0.5.0
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-features/html-builder
- dev-html-builder-bootstrap
This package is auto-updated.
Last update: 2025-08-24 15:48:48 UTC
README
A database admin dashboard based on Jaxon and Adminer
This package 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, so the user never leaves the page.
The database access code (and thus the provided features) originates from Adminer. The original code was refactored to take advantage of the latest PHP features (namespaces, interfaces, DI, and so on), and separated into multiple Composer packages.
Howtos
This blog post on the Jaxon
website explains how to install Jaxon DbAdmin
on Backpack, an admin panel based on the Laravel
framework: https://www.jaxon-php.org/blog/2025/07/install-jaxon-dbadmin-on-backpack.html.
The Jaxon DbAdmin application
The https://github.com/lagdo/dbadmin-app repo provides a ready-to-use Jaxon DbAdmin
application built with Laravel
.
The driver packages for PostgreSQL, MySQL and SQLite are included, so the user just need to add its databases in the config file.
A Docker image is also provided to get started easily.
Documentation
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 framework extension is available for your framework, you must also install it. It will automate the previous step.
The database drivers
Install the drivers packages for the database servers you need to manage. The following drivers are available:
- PostgreSQL: https://github.com/lagdo/dbadmin-driver-pgsql
- MySQL: https://github.com/lagdo/dbadmin-driver-mysql
- Sqlite: https://github.com/lagdo/dbadmin-driver-sqlite
Declare the package and the database servers in the app.packages
section of the Jaxon configuration file.
See the corresponding database driver package for specific database server options.
'app' => [ // Other config options // ... 'packages' => [ Lagdo\DbAdmin\Package::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. ], ], ], ], ],
The CSS and javascript codes
Insert the CSS and javascript codes in the HTML page of your application, as described in the Jaxon documentation.
The UI builder
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 Bootstrap3 components.
'app' => [ 'ui' => [ 'template' => 'bootstrap3', ], ],
Additional config options
There are other config options that can be used to customize the Jaxon DbAdmin
operation.
The default
option sets a database server Jaxon DbAdmin
must connect to when it starts, instead of displaying a blank page.
'app' => [ 'packages' => [ Lagdo\DbAdmin\Package::class => [ 'servers' => [ // The database servers ], 'default' => 'server_id', ], ], ],
Access restriction
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\Package::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\Package::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
.
Customizing the package config
The app admin may need to customize the access parameters, depending for example on the connected user account or role.
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(array $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\Package::class => [ // A callable that return the access options. 'provider' => $dbAdminOptionsGetter, 'servers' => [], 'default' => 'server_mysql', 'access' => [ 'server' => false, ], ], ], ],
Debug console output
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\Package::class => [ 'debug' => [ 'queries' => true, ], 'servers' => [ // The database servers ], ], ], ],
Data import (currently disabled)
SQL files can be uploaded and executed on a server. This feature is implemented using the Jaxon ajax upload feature, which then needs to be configured in the lib
section of the Jaxon
config file.
'lib' => [ 'upload' => [ 'files' => [ 'sql_files' => [ 'dir' => '/path/to/the/upload/dir', ], ], ], ],
As stated in the Jaxon ajax upload documentation, 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.
Data export (currently disabled)
Databases can also be exported to various types of files: SQL, CSV, and more. A directory where the exported files are going to be saved must then be defined in the configuration, as well as an url where they can be downloaded.
'app' => [ 'packages' => [ Lagdo\DbAdmin\Package::class => [ 'servers' => [ // The database servers ], 'export' => [ 'dir' => '/path/to/the/export/dir', 'url' => 'http://www.domain.com/exports', ], ], ], ],
The web server needs to be setup to serve the files in the directory dir
from url url
.
Contribute
- Issue Tracker: github.com/lagdo/jaxon-dbadmin/issues
- Source Code: github.com/lagdo/jaxon-dbadmin
License
The project is licensed under the Apache license.