sqlizer-client

1.0.0 • Public • Published

sqlizer-client-js

A JavaScript client library for SQLizer.io, easily converting CSV, JSON, XML and Spreadsheet files into SQL.

Getting Started

Install the library:

npm i sqlizer-client

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));

Package Sidebar

Install

npm i sqlizer-client

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

16.3 kB

Total Files

12

Last publish

Collaborators

  • d4nielt