Socket
Book a DemoInstallSign in
Socket

execsql

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

execsql

Execute you *.sql file which contains multiple sql statements. Usate: init database.

0.0.3
latest
npmnpm
Version published
Maintainers
1
Created
Source

execsql

An npm project. Node.js Execute you *.sql file which contains multiple sql statements. Usate: init database.

Usage

As a CLI tool

  • Make sure that you have execsql installed globally

    npm install -g execsql
    
  • Configure your db access for the first time

    execsql -c "localhost" "root" "root"
    
  • Execute a bunch of sql statements

    execsql "use db_cam; delete from admin;"
    
  • Execute a .sql file

    execsql -f ./db.sql
    

As a Node dependency

  • Make sure that you have execsql installed locally

    npm install execsql
    
  • Require and use

    var execsql = require('execsql'),
    	dbConfig = {
    		host: 'localhost',
    		user: 'root',
    		password: 'root'
    	},
    	sql = 'use db_cam;',
    	sqlFile = __dirname + '/db.sql';
    execsql.config(dbConfig)
    	.exec(sql)
    	.execFile(sqlFile, function(err, results){
    		console.log(results);
    	}).end();
    

Keywords

mysql

FAQs

Package last updated on 21 Jan 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.