Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hirosassa/bqvalid
SQL linter tool for BigQuery GoogleSQL (formerly known as StandardSQL).
https://github.com/hirosassa/bqvalid
bigquery google linter sql
Last synced: 2 months ago
JSON representation
SQL linter tool for BigQuery GoogleSQL (formerly known as StandardSQL).
- Host: GitHub
- URL: https://github.com/hirosassa/bqvalid
- Owner: hirosassa
- License: mit
- Created: 2022-06-18T09:23:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-14T08:26:35.000Z (3 months ago)
- Last Synced: 2024-10-24T21:29:27.304Z (3 months ago)
- Topics: bigquery, google, linter, sql
- Language: Rust
- Homepage:
- Size: 52.7 KB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bqvalid
[![build](https://github.com/hirosassa/bqvalid/actions/workflows/test.yaml/badge.svg)](https://github.com/hirosassa/bqvalid/actions/workflows/test.yaml)
[![codecov](https://codecov.io/gh/hirosassa/bqvalid/branch/main/graph/badge.svg?token=Q5FIA58YTN)](https://codecov.io/gh/hirosassa/bqvalid)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/hirosassa/bqvalid/blob/main/LICENSE)## What bqvalid does
`bqvalid` is a SQL linter tool for BigQuery GoogleSQL (formerly known as StandardSQL).
`bqvalid` fails with error message if there are the violation of rules described in the [rules page](https://github.com/hirosassa/bqvalid/blob/main/docs/rules.md).## Installation
You can get binary of `bqvalid` from the release page like
```shell
curl -LsJO https://github.com/hirosassa/bqvalid/releases/download/v0.0.9/bqvalid-x86_64-apple-darwin
```## Usage
```shell
cat sample.sql | bqvalid
```If the SQL is contained the expressions that comparing `_TABLE_SUFFIX` with subquery, `bqvalid` outputs the reason and its position like:
```
5:7: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
```Also, you can input file paths or directory. `bqvalid` collects files whose extension is `.sql` (ignores files that has other extensions) :
```shell
bqvalid one.sql two.sql three.sql
```or
```shell
bqvalid sql/
```Then, the output will as follows:
```
one.sql:6:6: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
three.sql:5:19: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
```## Linting Rules
See the [rules page](https://github.com/hirosassa/bqvalid/blob/main/docs/rules.md)
## Contributing
See the [contributing guide](https://github.com/hirosassa/bqvalid/blob/main/docs/contribute.md)!