dbgate-plugin-csv
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "dbgate-plugin-csv", | ||
"main": "dist/backend.js", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"homepage": "https://github.com/dbshell/dbgate-plugin-csv", | ||
@@ -6,0 +6,0 @@ "description": "CSV import/export plugin for DbGate", |
@@ -8,1 +8,51 @@ [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) | ||
CSV import/export plugin for DbGate | ||
## Usage without DbGate | ||
Export from fake object reader into CSV file. Fake object file can be replaced with other reader/writer factory functions, as described in | ||
[dbgate-api package](https://www.npmjs.com/package/dbgate-api) | ||
```javascript | ||
const dbgateApi = require('dbgate-api'); | ||
const dbgatePluginCsv = require("dbgate-plugin-csv"); | ||
dbgateApi.registerPlugins(dbgatePluginCsv); | ||
async function run() { | ||
const reader = await dbgateApi.fakeObjectReader(); | ||
const writer = await dbgateApi.consoleObjectWriter(); | ||
await dbgatePluginCsv.shellApi.writer({ fileName: '~/myfile1.csv', separator: ';' }); | ||
console.log('Finished job script'); | ||
} | ||
dbgateApi.runScript(run); | ||
``` | ||
## Factory functions | ||
### shellApi.reader | ||
Reads CSV file | ||
```js | ||
const reader = await dbgateApi.csvReader({ | ||
fileName: '/home/root/test.csv', | ||
encoding: 'utf-8', | ||
header: true, | ||
delimiter: ',', | ||
quoted: false, | ||
limitRows: null | ||
}); | ||
``` | ||
### shellApi.writer | ||
Writes CSV file | ||
```js | ||
const reader = await dbgateApi.csvWriter({ | ||
fileName: '/home/root/test.csv', | ||
encoding: 'utf-8', | ||
header: true, | ||
delimiter: ',', | ||
quoted: false | ||
}); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
86400
58
2