sqlvalidator icon indicating copy to clipboard operation
sqlvalidator copied to clipboard

SQL queries formatting, syntactic and semantic validation

Results 13 sqlvalidator issues
Sort by recently updated
recently updated
newest added

Using Python3.8 in a virtual environment, this query is showing an error even though it's working properly for Google BigQuery: ```python3 query = """ SELECT CAST( DATE_ADD(invoice_date, INTERVAL payment_term DAY)...

The current version doesn't handle well the interval statement. If we try to validate this SQL code: ```sql SELECT * FROM table WHERE date >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY) ```...

`SQLQuery.is_valid()` raises an exception for `with` query statements: ``` from sqlvalidator.sql_validator import SQLQuery sql_with = """with a as (select * from b) select * from a """ sql_query = SQLQuery(sql_with)...

I know the validation is limited, but at least it starts working

Example ```python import sqlvalidator invalid_query = "SELECT ** FROM FROM FROM ***;" sql_query = sqlvalidator.parse(invalid_query) sql_query.is_valid() ```

Using python 3.9 and sqlvalidator==0.0.18 When running `sqlvalidator.parse(query).is_valid()` i'm getting ``` def _validate(self): self.validated = True try: > self.errors = self.sql_query.validate() E TypeError: validate() missing 1 required positional argument: 'known_fields'...

I found the following case which seems to me to be a false negative. According to PG's documentation, setting `LIMIT` to either `NULL` or `ALL` should result in fetching all...

I tried to dig into the code and find some breadcrumbs but I couldn't get anywhere... ```python import sqlvalidator query = 'SELECT * FROM table WHERE cast(start_time as date) >...

Hello David 👋 I just noticed that comments are not handled correctly when formatting the SQL queries. For example ```sql SELECT * FROM table_a WHERE user_name="john doe" /* just a...