Rejoice, JS developers!

A JavaScript client library for SQLizer.io, easily converting CSV, JSON, XML and Spreadsheet files into SQL INSERT or UPDATE statements - is here!

All SQLizer plans get access to the API, see: SQLizer API Documentation.

NPM Page: https://www.npmjs.com/package/sqlizer-client

Getting Started

  1. Install the library:

npm i sqlizer-client

  1. Copy your SQLizer API Key from your Account page on SQLizer

  2. Then import the SQLizerFile class and use it to convert a file:


const { createWriteStream } = require('fs');
const { SQLizerFile } = require('sqlizer-client');

const sqlizerFile = new SQLizerFile({
  ApiKey: '[MY-API-KEY]',
  FileType: 'csv',
  FileName: 'my-file.csv',
  TableName: 'my_table',
  DatabaseType: 'SQLite',
  FileHasHeaders: true,
  Delimiter: ',',
  CheckTableExists: true,
  InsertSpacing: 150,
  Path: './my-file.csv'
});

// Create a writable stream to store the generated SQL
var writeStream = createWriteStream('./my-result.sql', { flags : 'w' });

// Ask SQLizer to run the conversion and pipe the results to our file
sqlizerFile.convert().then(results => results.pipe(writeStream));

🖤 SQLizer team.

About: SQLizer offers free conversion for datasets with less than 5,000 rows, designed for personal use. If you have a CSV file with more than 5,000 rows that needs conversion, you can use the code CONVERTME10 to get a 10% discount on your Pro Monthly plan for the initial 12 months or enjoy a one-time 10% reduction on your Pro Annual plan.