supabase-community / postgres_lsp

A Language Server for Postgres
https://supabase.com
MIT License
3.24k stars 61 forks source link

feat: support `CreateCastStmt` #68

Closed cvng closed 9 months ago

cvng commented 9 months ago

What kind of change does this PR introduce?

feat: support CreateCastStmt

What is the current behavior?

Parser panics

What is the new behavior?

[2023-12-13T14:38:21Z DEBUG parser::codegen::tests] pg_query_root: Some(
        CreateCastStmt(
            CreateCastStmt {
                sourcetype: Some(
                    TypeName {
                        names: [
                            Node {
                                node: Some(
                                    String(
                                        String {
                                            sval: "pg_catalog",
                                        },
                                    ),
                                ),
                            },
                            Node {
                                node: Some(
                                    String(
                                        String {
                                            sval: "int8",
                                        },
                                    ),
                                ),
                            },
                        ],
                        type_oid: 0,
                        setof: false,
                        pct_type: false,
                        typmods: [],
                        typemod: -1,
                        array_bounds: [],
                        location: 13,
                    },
                ),
                targettype: Some(
                    TypeName {
                        names: [
                            Node {
                                node: Some(
                                    String(
                                        String {
                                            sval: "int4",
                                        },
                                    ),
                                ),
                            },
                        ],
                        type_oid: 0,
                        setof: false,
                        pct_type: false,
                        typmods: [],
                        typemod: -1,
                        array_bounds: [],
                        location: 23,
                    },
                ),
                func: None,
                context: CoercionAssignment,
                inout: true,
            },
        ),
    )

Additional context

Add any other context or screenshots.