summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-03 14:11:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-03 14:11:07 +0000
commit42a1548cecf48d18233f56e3385cf9c89abcb9c2 (patch)
tree5e0fff4ecbd1fd7dd1022a7580139038df2a824c /README.md
parentReleasing debian version 21.1.2-1. (diff)
downloadsqlglot-42a1548cecf48d18233f56e3385cf9c89abcb9c2.tar.xz
sqlglot-42a1548cecf48d18233f56e3385cf9c89abcb9c2.zip
Merging upstream version 22.2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'README.md')
-rw-r--r--README.md22
1 files changed, 11 insertions, 11 deletions
diff --git a/README.md b/README.md
index 52df5b6..da58b12 100644
--- a/README.md
+++ b/README.md
@@ -96,7 +96,7 @@ sqlglot.transpile("SELECT EPOCH_MS(1618088028295)", read="duckdb", write="hive")
```
```sql
-'SELECT FROM_UNIXTIME(1618088028295 / 1000)'
+'SELECT FROM_UNIXTIME(1618088028295 / POW(10, 3))'
```
SQLGlot can even translate custom time formats:
@@ -202,13 +202,13 @@ When the parser detects an error in the syntax, it raises a ParseError:
```python
import sqlglot
-sqlglot.transpile("SELECT foo( FROM bar")
+sqlglot.transpile("SELECT foo FROM (SELECT baz FROM t")
```
```
-sqlglot.errors.ParseError: Expecting ). Line 1, Col: 13.
- select foo( FROM bar
- ~~~~
+sqlglot.errors.ParseError: Expecting ). Line 1, Col: 34.
+ SELECT foo FROM (SELECT baz FROM t
+ ~
```
Structured syntax errors are accessible for programmatic use:
@@ -216,7 +216,7 @@ Structured syntax errors are accessible for programmatic use:
```python
import sqlglot
try:
- sqlglot.transpile("SELECT foo( FROM bar")
+ sqlglot.transpile("SELECT foo FROM (SELECT baz FROM t")
except sqlglot.errors.ParseError as e:
print(e.errors)
```
@@ -225,11 +225,11 @@ except sqlglot.errors.ParseError as e:
[{
'description': 'Expecting )',
'line': 1,
- 'col': 16,
- 'start_context': 'SELECT foo( ',
- 'highlight': 'FROM',
- 'end_context': ' bar',
- 'into_expression': None,
+ 'col': 34,
+ 'start_context': 'SELECT foo FROM (SELECT baz FROM ',
+ 'highlight': 't',
+ 'end_context': '',
+ 'into_expression': None
}]
```