Skip to content

Latest commit

 

History

History
83 lines (66 loc) · 1.91 KB

README.md

File metadata and controls

83 lines (66 loc) · 1.91 KB

DB Explorer

Tool for extraxting and analysing the database structure.

Inatalling

Command Line Installation:

  $ composer require shankarbala33/db_explorer

Available Schemas

Currently available database schema's are,

  1. MySQL

Sample Code :

"use shankarbala33\db_explorer\OTF_DB;"

Basic DB Connection [MySQL] :

$db_schema = (
 "name" => "mysql",
 "host" => "localhost",
 "username" => "root",
 "password" => "root",
 "database" => "wordpress"
); 

Scan Database :

 $database = new OTF_DB()     
 $schema = $database->scanDatabase($db_schema); 
 dd($schema);

Sample Output :

array:12 [▼
  "wp_commentmeta" => array:4 [▼
     0 => {#239 ▼
 	    +"TABLE_CATALOG": "def"
 	    +"TABLE_SCHEMA": "wordpress"
	    +"TABLE_NAME": "wp_commentmeta"
	    +"COLUMN_NAME": "meta_id"
	    +"ORDINAL_POSITION": 1
	    +"COLUMN_DEFAULT": null
	    +"IS_NULLABLE": "NO"
 	    +"DATA_TYPE": "bigint"
	    +"CHARACTER_MAXIMUM_LENGTH": null
	    +"CHARACTER_OCTET_LENGTH": null
	    +"NUMERIC_PRECISION": 20
	    +"NUMERIC_SCALE": 0
	    +"DATETIME_PRECISION": null
	    +"CHARACTER_SET_NAME": null
 	    +"COLLATION_NAME": null
 	    +"COLUMN_TYPE": "bigint(20) unsigned"
 	    +"COLUMN_KEY": "PRI"
	    +"EXTRA": "auto_increment"
 	    +"PRIVILEGES": "select,insert,update,references"
	    +"COLUMN_COMMENT": ""
       }
1 => {#240 ▶}
2 => {#241 ▶}
3 => {#242 ▶}
	]
"wp_comments" => array:15 [▶]
"wp_links" => array:13 [▶]
"wp_options" => array:4 [▶]
"wp_postmeta" => array:4 [▶]
"wp_posts" => array:23 [▶]
"wp_term_relationships" => array:3 [▶]
"wp_term_taxonomy" => array:6 [▶]
"wp_termmeta" => array:4 [▶]
"wp_terms" => array:4 [▶]
"wp_usermeta" => array:4 [▶]
"wp_users" => array:10 [▶]
] 

License

MIT License