Skip to content

Nodejs library for importing SQL file in mariadb

Notifications You must be signed in to change notification settings

iqrok/sql-importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL File Importer

Import sql file to database in mariadb server. Probably also works in MySQL server, but currently only tested in mariadb 10.4 & 15.1.

Usage

const sqlFileImporter = require('sql-file-importer');

const config = {
		host: 'localhost',
		port: 3306,
		user: 'root',
		password: '',
		database: 'test_db',
		charset: 'utf8mb4',
		trace: true,
		verbose: 2,
	};

	/** import db data and multiple rows insert statement will be splitted into
	 * single row statements. **/
	const proc = await importer.init(config).importFile(filepath, {
			withData: 'single',
			dropFirst: true,
		});

About

Nodejs library for importing SQL file in mariadb

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published