https://github.com/phartenfeller/ora-script-validator
A CLI to validate Oracle SQL-Scripts for common errors.
https://github.com/phartenfeller/ora-script-validator
cli linter oracle oracle-db sql validator
Last synced: 11 months ago
JSON representation
A CLI to validate Oracle SQL-Scripts for common errors.
- Host: GitHub
- URL: https://github.com/phartenfeller/ora-script-validator
- Owner: phartenfeller
- License: mit
- Created: 2021-01-30T17:28:05.000Z (almost 5 years ago)
- Default Branch: dev
- Last Pushed: 2021-03-20T18:27:40.000Z (almost 5 years ago)
- Last Synced: 2025-02-27T02:57:27.783Z (11 months ago)
- Topics: cli, linter, oracle, oracle-db, sql, validator
- Language: TypeScript
- Homepage:
- Size: 282 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# ORA Script Validator
A CLI to validate Oracle SQL-Scripts for common errors.
## Supported checks
- Linked files (e.g. @@myscript.sql)
- Table refs (Foreign Keys, Read Grants, Alters, DML)
- Sequence refs (nextval)
## Usage
Requirements: https://nodejs.org/en/
```sh
npx orasv install.sql
```
You can also directly install it from [NPM](https://www.npmjs.com/package/orasv) and use it offline:
```sh
npm i -g orasv
orasv install.sql
```
[](https://nodei.co/npm/orasv/)
## Config
A config is not needed to run orasv but can be provided to configure the error checking process. The config does not have to be complete when a property is missing it will fall back to the default settings.
See: [CLI config arguments](#Config-File) for config generation and custom config path arguments.
Default config:
```json
{
"ignoreObjects": {
"tables": [],
"sequences": []
},
"rules": {
"table/foreignKeys": true,
"table/readGrants": true,
"table/tableAlters": true,
"table/dmlStatements": true,
"sequence/nextvals": true
}
}
```
`ignoreObjects`:
Specify object that will be ignored and not result into errors.
`rules`:
Enable and disable specific rule
## Arguments
### Version
Show the current version of orasv.
`--version` or `-v`
Example:
```sh
orasv -v
```
### Config File
Generate config file (written to the current dir as `orasv.config.json`):
```sh
orasv --genConfig
```
Pass custom config path (default is `orasv.config.json`):
`orasv -c {path}` or `orasv --config {path}`
Example:
```sh
orasv -c ./config/myOrasvConfig.json
```
### Loglevel
Determines what gets logged to the console.
`--loglevel {num}` or `-l {num}`
Example:
```sh
orasv install.sql -l 1
```
Levels:
| level | description | default |
| :---: | ------------------------------------------- | :-----: |
| 0 | off (No output) | |
| 1 | only runtime errors | |
| 2 | all necessary info | ✅ |
| 3 | additional debug info to see whats going on | |
### Debug args
#### Trace File Indexing:
Prints how a file is internally indexed.
```sh
orasv install.sql --traceFileIndexing
```