apache / apache/datafusion-sqlparser-rs

Improve postgres CREATE FUNCTION support

Offen
#1,405 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
3.5k
Forks
772
Ø Merge
4 T. 9 Std.
Gemergte PRs (30 T.)
17

Beschreibung

Hey,

I'm trying to parse `CREATE FUNCTION` statements (PostgreSQL) with the following attributes:

```sql
CREATE OR REPLACE FUNCTION public.accounting_ids()
RETURNS SETOF uuid
LANGUAGE plpgsql
STABLE SECURITY DEFINER
SET search_path TO ''
AS $function$
```

A few features fail to parse:
1. `SETOF [type]` is not supported (Expected: end of statement, found: uuid at Line: 5, Column: 16)
2. `SECURITY DEFINER` is not supported (Expected: end of statement, found: SECURITY at Line: 7, Column: 9)
3. `SET search_path TO ''` is not supported (Expected: end of statement, found: SET at Line: 7, Column: 2)

Using sqlparser 0.50.0

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduziere das PostgreSQL-Beispiel für CREATE FUNCTION mit sqlparser 0.50.0 und finde den Parser-Einstiegspunkt für CREATE FUNCTION. Verfolge, wie Rückgabetypen und Funktionsattribute behandelt werden, und füge Abdeckung für SETOF uuid, SECURITY DEFINER und SET search_path TO '' hinzu. Als erledigt gilt die Aufgabe, wenn alle drei Konstrukte erfolgreich geparst werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
postgresql, rust
Bereich
databases
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.