SQLizer Logo

Easily convert files into SQL databases

SQLizer's JavaScript SDK

Our JavaScript SDK is an open source library that provides programatic access to the SQLizer API to NodeJS clients

To install the JavaScript client, run the following command:

npm i sqlizer-client

Your NodeJS application can then initiate a file conversion like this:

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

const sqlizerFile = new SQLizerFile({
  ApiKey: '{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));

The properties on the SQLizerFile object match those on the https://sqlizer.io/api/files/ entity on our REST API. See the API Reference for more information.

The code for this SDK can be found on GitHub at: https://github.com/sqlizer-io/sqlizer-client-js