All new: A JavaScript Client for SQLizer on npm
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
- Install the library:
npm i sqlizer-client
-
Copy your SQLizer API Key from your Account page on SQLizer
-
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.
More from The Official SQLizer blog...
- [Update 2024] Convert JSON to SQL: Free and Fast If you want to convert JSON to SQL there’s no concrete or straightforward way of doing things. Conversion is usually tricky because JSON and SQL...
- [Update 2024] Convert XML to SQL Easy and Free To convert XML to SQL, a touch of wizardry is needed. Unlike CSV files and database tables, XML files aren’t naturally organized into rows and...
- [Update 2024] Converting a Word Doc to SQL with SQLizer Wait, what? A Word document? Have you ever found yourself faced with a Word document containing a wealth of data, all neatly structured in a...
- Automatically Rotate your SQLizer API keys with cURL and jq Hot on the heels of our post about rotating your API keys - this blog post will guide you through the process of automating your...