SQL validator tool for BigQuery standard SQL.

Related tags

Database bqvalid
Overview

bqvalid

build codecov License: MIT

What bqvalid does

bqvalid is the SQL validator tool for BigQuery standard SQL. bqvalid fails with error message if there's the expression that will cause full scan, print as it is otherwise.

Usage

cat sample.sql | bqvalid

If the SQL is contained the expressions that comparing ``_TABLE_SUFFIXwith 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) :

bqvalid one.sql two.sql three.sql

or

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
You might also like...
Fully typed SQL query builder for Rust [deprecated]

What is Deuterium? Deuterium is a fancy SQL builder for Rust. It's designed to provide a DSL to easily build SQL queries in safe and typed way. Like R

Ormlite - An ORM in Rust for developers that love SQL.

ormlite ormlite is an ORM in Rust for developers that love SQL. It provides the following, while staying close to SQL, both in syntax and performance:

Distributed SQL database in Rust, written as a learning project

toyDB Distributed SQL database in Rust, written as a learning project. Most components are built from scratch, including: Raft-based distributed conse

Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres.

SDB - SignatureDB Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres

X-Engine: A SQL Engine built from scratch in Rust.

XNGIN (pronounced "X Engine") This is a personal project to build a SQL engine from scratch. The project name is inspired by Nginx, which is a very po

Rust library to parse, deparse and normalize SQL queries using the PostgreSQL query parser

This Rust library uses the actual PostgreSQL server source to parse SQL queries and return the internal PostgreSQL parse tree.

RisingWave is a cloud-native streaming database that uses SQL as the interface language.

RisingWave is a cloud-native streaming database that uses SQL as the interface language. It is designed to reduce the complexity and cost of building real-time applications. RisingWave consumes streaming data, performs continuous queries, and updates results dynamically. As a database system, RisingWave maintains results inside its own storage and allows users to access data efficiently.

Type-safe SQL query wrappers

fnsql   The fnsql crate provides simple type-safe optional wrappers around SQL queries. Instead of calling type-less .query() and .execute(), you call

A Toy Query Engine & SQL interface
A Toy Query Engine & SQL interface

Naive Query Engine (Toy for Learning) 😄 This is a Query Engine which support SQL interface. And it is only a Toy for learn query engine only. You can

Comments
  • proposal: read file from arguments

    proposal: read file from arguments

    Currently, bqvalid parse only sql from stdin. But, I think the following usage is ordinary.

    bqvalid <FILE_PATH>
    
    # search *.sql in subdirectory
    bqvalid <DIR_PATH>
    
    opened by kitagry 3
  • Change columns and rows to 1-based

    Change columns and rows to 1-based

    Most of linters use 1-based value for row and col. But, tree-sitter use 0-based rows and cols.

    https://docs.rs/tree-sitter/latest/tree_sitter/struct.Point.html

    opened by kitagry 2
  • More parsable format

    More parsable format

    I think parsable error format is important to use some useful tools ex) reviewdog For example,

    $ golint
    comment_iowriter.go:11:6: exported type CommentWriter should have comment or be unexported
    

    I want some option which change error format, or default format should be changed. If you like this idea, I'll create PR.

    opened by kitagry 1
  • Check subdirectories

    Check subdirectories

    relate #6

    ❯ cargo run -- .
    ./sql/subquery_with_binary_op.sql:5:19: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
    ./sql/subquery_with_between.sql:6:6: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
    ./sql/subquery_with_between_from.sql:5:24: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
    ./sql/subquery_with_between_to.sql:6:6: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
    
    
    opened by kitagry 0
Owner
null
A Rust SQL query builder with a pleasant fluent API closely imitating actual SQL

Scooby An SQL query builder with a pleasant fluent API closely imitating actual SQL. Meant to comfortably build dynamic queries with a little bit of s

Aleksei Voronov 100 Nov 11, 2022
Gh-sql - Query GitHub Projects (beta) with SQL

gh-sql: Query GitHub Projects (beta) with SQL Installation gh extension install KOBA789/gh-sql Features SELECT items DELETE items UPDATE item fields

Hidekazu Kobayashi 108 Dec 7, 2022
Tool to automate the visualisation of UML dependencies from a SQL file

Doteur A simple tool to draw your mysql relations from exports. Help us If you use the tool, and like it, don't forget to add a star to the project on

Loïc 89 Nov 9, 2022
TDS 7.2+ (mssql / Microsoft SQL Server) async driver for rust

Tiberius A native Microsoft SQL Server (TDS) client for Rust. Supported SQL Server versions Version Support level Notes 2019 Tested on CI 2017 Tested

Prisma 189 Dec 25, 2022
Query LDAP and AD with SQL

SQLDAP Ever wanted to query AD or LDAP with SQL like queries ? I'm going to answer this question myself: yes ! Why ? Because I never could remember al

null 9 Nov 15, 2022
FeOphant - A SQL database server written in Rust and inspired by PostreSQL.

A PostgreSQL inspired SQL database written in Rust.

Christopher Hotchkiss 27 Dec 7, 2022
GlueSQL is a SQL database library written in Rust

GlueSQL is a SQL database library written in Rust. It provides a parser (sqlparser-rs), execution layer, and optional storage (sled) packaged into a single library.

GlueSQL 2.1k Jan 8, 2023
An object-relational in-memory cache, supports queries with an SQL-like query language.

qlcache An object-relational in-memory cache, supports queries with an SQL-like query language. Warning This is a rather low-level library, and only p

null 3 Nov 14, 2021
Run SQL queries on CSV files

zsql run SQL queries on csv files A terminal utility to easily run SQL queries on CSV files. zsql is shipped as a small single binary powered by rust

Zizaco 9 Jul 9, 2022
Running SQL-like queries on files.

filesql Running SQL-like queries on files. Features Supported: REPL Basic SQL expressions. INSERT clause. (which inserts data into another file) WHERE

Zhang Li 1 Nov 15, 2021