Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mysql-script-deploy
Advanced tools
Deploys your schema changes and routines, it versions all your changes and roles back failed routines to previous versions
Readme
This useful little package takes the pain out of updating keeping your database up to date, whether in the development environent or production.
$ npm install mysql-script-deploy --save
Call scriptDeploy method at the end of your main script before your app finishes starting. In an ExpressJS app I place the app.listen() inside the callback function so my server won't start untill all the scripts have deployed.
var scriptDeploy = require('mysql-script-deploy');
var options = {
host : 'example_host',
port : 3306,
user : 'username',
password : 'password',
database : 'example_database',
schemaLocation : path.join(__dirname, 'databaseScripts', 'schemaScripts'),
routinesLocation: path.join(__dirname, 'databaseScripts', 'routineScripts'),
disableLocking : false
};
scriptDeploy(options, function(err) {
if (err) throw err;
app.listen(3000);
});
All schema scripts should be placed in the folder specified by the schemaLocation
option.
All routines should be places in the folder specified by the routinesLocation
option.
DELIMETER
syntax in your routines, it is not only unnecessary but will cause the scripts to fail.Example syntax for function script
CREATE FUNCTION SqrRt (x1 decimal, y1 decimal)
RETURNS decimal
DETERMINISTIC
BEGIN
DECLARE dist decimal;
SET dist = SQRT(x1 - y1);
RETURN dist;
END
localhost
)3306
)true
if you do not wish to lock the database from other instances of mysql-script-deploy from making concurrent changes. (default false
)If the database name in the database options does not exist, mysql-script-deploy will attempt to create it. If it fails for any reason, lack of permissions or incorrect connection details, it will halt and no futher scripts will run.
mysql-script-deploy creates 3 tables the first time you run it in an app. These table will live on the database named in the database option. They are used to track the versions of the schema scripts, functions and stored procedures. It is best to avoid modifying or manually adding any data in these tables.
These tables are:
When running, mysql-script-deploy locks itself to prevent other instances of mysql-script-deploy from running at the same time. This lock only lasts for two minutes so please be patient.
During development or if you only ever wish to connect one instance to the database, you can use the disableLocking
flag in options.
FAQs
Deploys your schema changes and routines, it versions all your changes and roles back failed routines to previous versions
The npm package mysql-script-deploy receives a total of 22 weekly downloads. As such, mysql-script-deploy popularity was classified as not popular.
We found that mysql-script-deploy 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.