mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 00:56:02 +00:00
query-splitter - documentation, publish
This commit is contained in:
5
.github/workflows/build-npm.yaml
vendored
5
.github/workflows/build-npm.yaml
vendored
@@ -79,6 +79,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npm publish
|
npm publish
|
||||||
|
|
||||||
|
- name: Publish query-splitter
|
||||||
|
working-directory: packages/query-splitter
|
||||||
|
run: |
|
||||||
|
npm publish
|
||||||
|
|
||||||
- name: Publish web
|
- name: Publish web
|
||||||
working-directory: packages/web
|
working-directory: packages/web
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
34
packages/query-splitter/README.md
Normal file
34
packages/query-splitter/README.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
dbgate-query-splitter
|
||||||
|
====================
|
||||||
|
|
||||||
|
Splits long SQL query into into particular statements. Designed to have zero dependencies and to be fast.
|
||||||
|
|
||||||
|
Supports following SQL dialects:
|
||||||
|
* MySQL
|
||||||
|
* PostgreSQL
|
||||||
|
* SQLite
|
||||||
|
* Microsoft SQL Server
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { splitQuery, mysqlSplitterOptions, mssqlSplitterOptions, postgreSplitterOptions } from 'dbgate-query-splitter';
|
||||||
|
|
||||||
|
const output = splitQuery('SELECT * FROM `table1`;SELECT * FROM `table2`;', mysqlSplitterOptions);
|
||||||
|
|
||||||
|
// output is ['SELECT * FROM `table1`', 'SELECT * FROM `table2`']
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
Please run tests before pushing any changes.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yarn test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Supported syntax
|
||||||
|
* Comments
|
||||||
|
* Dollar strings (PostgreSQL)
|
||||||
|
* GO separators (MS SQL)
|
||||||
|
* Custom delimiter, setby DELIMITER keyword (MySQL)
|
||||||
@@ -3,6 +3,20 @@
|
|||||||
"name": "dbgate-query-splitter",
|
"name": "dbgate-query-splitter",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"typings": "lib/index.d.ts",
|
"typings": "lib/index.d.ts",
|
||||||
|
"description": "SQL Query splitter for verious database engines",
|
||||||
|
"homepage": "https://github.com/dbgate/dbgate/tree/master/packages/query-splitter",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/dbgate/dbgate"
|
||||||
|
},
|
||||||
|
"author": "Jan Prochazka",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"SQL",
|
||||||
|
"query",
|
||||||
|
"split",
|
||||||
|
"parse"
|
||||||
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"start": "tsc --watch",
|
"start": "tsc --watch",
|
||||||
@@ -19,8 +33,5 @@
|
|||||||
"jest": "^24.9.0",
|
"jest": "^24.9.0",
|
||||||
"ts-jest": "^25.2.1",
|
"ts-jest": "^25.2.1",
|
||||||
"typescript": "^3.7.5"
|
"typescript": "^3.7.5"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"lodash": "^4.17.21"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,6 +39,7 @@ changePackageFile('packages/web', json.version);
|
|||||||
changePackageFile('packages/datalib', json.version);
|
changePackageFile('packages/datalib', json.version);
|
||||||
changePackageFile('packages/dbgate', json.version);
|
changePackageFile('packages/dbgate', json.version);
|
||||||
changePackageFile('packages/filterparser', json.version);
|
changePackageFile('packages/filterparser', json.version);
|
||||||
|
changePackageFile('packages/query-splitter', json.version);
|
||||||
|
|
||||||
changePackageFile('plugins/dbgate-plugin-csv', json.version);
|
changePackageFile('plugins/dbgate-plugin-csv', json.version);
|
||||||
changePackageFile('plugins/dbgate-plugin-excel', json.version);
|
changePackageFile('plugins/dbgate-plugin-excel', json.version);
|
||||||
|
|||||||
Reference in New Issue
Block a user