mirror of
https://github.com/dbgate/dbgate
synced 2024-11-22 16:27:18 +00:00
query-splitter - documentation, publish
This commit is contained in:
parent
5d661ad3a3
commit
64c7072aca
5
.github/workflows/build-npm.yaml
vendored
5
.github/workflows/build-npm.yaml
vendored
@ -79,6 +79,11 @@ jobs:
|
||||
run: |
|
||||
npm publish
|
||||
|
||||
- name: Publish query-splitter
|
||||
working-directory: packages/query-splitter
|
||||
run: |
|
||||
npm publish
|
||||
|
||||
- name: Publish web
|
||||
working-directory: packages/web
|
||||
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",
|
||||
"main": "lib/index.js",
|
||||
"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": {
|
||||
"build": "tsc",
|
||||
"start": "tsc --watch",
|
||||
@ -19,8 +33,5 @@
|
||||
"jest": "^24.9.0",
|
||||
"ts-jest": "^25.2.1",
|
||||
"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/dbgate', json.version);
|
||||
changePackageFile('packages/filterparser', json.version);
|
||||
changePackageFile('packages/query-splitter', json.version);
|
||||
|
||||
changePackageFile('plugins/dbgate-plugin-csv', json.version);
|
||||
changePackageFile('plugins/dbgate-plugin-excel', json.version);
|
||||
|
Loading…
Reference in New Issue
Block a user