
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Describe mysql database. Get table names, column specs as a json object.
Describe mysql database. Get table names, column specs as a json object.
npm install mysqldesc --save-dev
Describe database data.
var mysqldesc = require('mysqldesc');
// Mysql connect config.
var config = {
user: 'root',
password: 'my_password',
host: 'localhost',
database: 'my_db'
};
// Desc connected database
mysqldesc(config, function (err, data) {
console.log("structure=" + JSON.stringify(data, null, 4));
});
This will result like:
structure = { // Tables in "my_db" database.
"TEST_PERSON": { // Columns in "TEST_PERSON" table.
"PersonID": { // Spec of "TEST_PERSON.PersonID" column.
"Type": "int(11)",
"Null": "YES",
"Key": "",
"Default": null,
"Extra": ""
},
"LastName": {
"Type": "varchar(255)",
"Null": "YES",
"Key": "",
"Default": null,
"Extra": ""
}
},
"TEST_SHOP": {
/*...*/
}
};
Signature | Description |
---|---|
mysqldesc(config, callback) | Describe tables in the connected database. |
mysqldesc(config, databaseName, callback) | Describe tables in a specific database. |
mysqldesc(config, databaseName, tableName, callback) | Describe a specific table. |
mysqldesc.keyColumnUsage(config, callback) | Describe key column usage in the connected database. |
mysqldesc.keyColumnUsage(config, databaseName, callback) | Describe key column usage in a specific database. |
mysqldesc.keyColumnUsage(config, databaseName, tableName, callback) | Describe key column usage in a specific table. |
mysqldesc
uses node-mysql as connector.
For more advanced setting, see the node-mysql documents about Connection options
This software is released under the MIT License.
FAQs
Describe mysql database. Get table names, column specs as a json object.
The npm package mysqldesc receives a total of 15 weekly downloads. As such, mysqldesc popularity was classified as not popular.
We found that mysqldesc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.