Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 13c8b13

Browse files
committed
fix CONNECT and PRIOR keywords in Oracle syntax
1 parent 4f08374 commit 13c8b13

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.21)
22
cmake_policy(SET CMP0048 NEW)
3-
project(libsqlglot VERSION 0.2.10 LANGUAGES CXX)
3+
project(libsqlglot VERSION 0.3.1 LANGUAGES CXX)
44

55
# Generate version header
66
configure_file(

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
# libsqlglot
22

3-
#### What is this?
3+
#### What this is
44

55
sqlglot, in C++. 45 dialects, 126× faster on benchmark SQL, 252× on the kind your ORM generates when nobody's looking. Performance gap scales with query complexity, see [Benchmarks](#benchmarks).
66

77
Supports stored procedures (PL/pgSQL, T-SQL, MySQL, PL/SQL): where sqlglot falls back to passthrough, libsqlglot parses them into the AST.
88

99
Inspired by the original [sqlglot](https://github.com/tobymao/sqlglot), which did the decade-long work of mapping 31+ SQL dialects into an elegant, universal AST. libsqlglot does the comparatively trivial work of compiling it. The algorithm was already O(n), the runtime was O(python).
1010

11-
#### What is this for?
11+
#### What it's for
1212

13-
DB proxies, linters, migration tools, query rewriters, and a proper replacement for every regex that's pretending to parse SQL.
13+
Proxies, sidecars, migration tools, linters, anything where SQL hits a hot path. Also a proper replacement for every regex that's pretending to parse queries.
14+
15+
#### Why it exists
16+
17+
Because the highest praise one can pay a Python
1418

1519
## Contents
1620

dialects/patches/oracle.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"description": "Oracle Database - Enterprise RDBMS with PL/SQL",
55
"keywords": {
66
"add": [
7+
{"name": "CONNECT", "token_type": "CONNECT"},
8+
{"name": "PRIOR", "token_type": "PRIOR"},
79
{"name": "FLASHBACK", "token_type": "FLASHBACK"},
810
{"name": "VERSIONS", "token_type": "VERSIONS"},
911
{"name": "SCN", "token_type": "SCN"},

include/libsqlglot/tokenizer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ class Tokenizer {
8686
return '\0'; // Out of bounds
8787
}
8888
size_t p = pos_ + offset;
89+
if (p >= source_.size()) {
90+
return '\0'; // Out of bounds
91+
}
8992
return source_[p];
9093
}
9194

0 commit comments

Comments
 (0)