Download the PHP package net-tools/js-db-editor without Composer

On this page you can find all versions of the php package net-tools/js-db-editor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package js-db-editor

net-tools/js-db-editor

Composer library with a Javascript database editor

Two kind of db editors can be used :

In either cases, type format for columns/values and mandatory values can be enforced.

Setup instructions

To install net-tools/js-db-editor package, just require it through composer : require net-tools/js-db-editor:^1.0.0.

How to use ?

SqlLiteTableEditor (sqljs-editor.html sample)

The library provides two table editors, one for a SqlJs database (a db engine hosted on client browser), one for a Mysql PDO database (the db is hosted on a remote server, accessed through PHP script).

SqlLiteTableEditor is a Javascript class to create a SqlJs editor for a given table.

The constructor expects the following data :

When grid object is ready, the setup method should be called to initialize data :

Don't remove the catch statement ; if you remove it, errors won't be displayed.

MysqlPdoTableEditor (pdo-editor.html sample)

For Mysql PDO editor, we use a new class inheriting from class nettools.PdoServerInterface which defines entry points for server side dialog with database.

The MysqlPdoTableEditor editor constructor expects the following parameters :

The object expected as first parameter must be created from a user-defined class which inherits from nettools.PdoServerInterface ; its send method implements the dialog between javascript and server-side. The sample provides a simple object using XmlHttpRequest to send queries to server-side. You may customize the send method to add any security layer required (no security in sample code). Also, this user-defined class has a constructor with a bool value ; if set to true, the data sent back to browser (such as select statements) will be compressed to save bandwidth.

When grid object is ready, the setup method should be called to initialize data :

Don't remove the catch statement ; if you remove it, errors won't be displayed.

DatabaseEditor (database-editor.html sample)

The library also defines a class that creates the GUI required for the user to select among a list of tables, and the selected table can be edited (with either MysqlPdoTableEditor or SqlLiteTableEditor).

The DatabaseEditor class constructor expects as parameters :

There's not setup method to call, the GUI is created on-the-fly.

DbConfigEditor (dbconfig-editor.html sample)

The DbConfigEditor class makes it possible to edit config values stored inside a table. The database can be a SqlJs database (edited thanks to SqlLiteTableEditor editor) or a server hosted database (through MysqlPdoTableEditor editor).

The table can have any required columns, but 3 are mandatory : id (as primary key), metadata (stores data about expected value type), value ; those are default names, custom names can be used.

The data column store the config value ; thanks to metadata column, we can enforce its type (text, numeric, bool), ensure it's not omitted, and use specific value editors (for HTML values or multiline strings). The metadata column value is defined for each row (ie each config value) through a GUI metadata editor window.

The DbConfigEditor class constructor expects the following parameters :

In this sample, the database refered by db has a config table with id, metadata, namespace and value columns.

To display the GUI editor :

Please refer to sample to see how db connection is created.

Samples

There are several samples inside /samples subdirectory :


All versions of js-db-editor with dependencies

PHP Build Version
Package Version
Requires net-tools/js-grid-editor Version ^1.0.0
net-tools/ui Version ^1.0.0
nullpunkt/lz-string-php Version ^1.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package net-tools/js-db-editor contains the following files

Loading the files please wait ....