Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for create index #81

Merged
merged 2 commits into from
Dec 17, 2023

Conversation

cvng
Copy link
Contributor

@cvng cvng commented Dec 14, 2023

What kind of change does this PR introduce?

add support for create index

What is the current behavior?

panics

What is the new behavior?

parser panics for index with using btree (the default) - it works if omitted

parser returns with 5e1ef7b, but as a side-note Using is always pushed

View log
IndexStmt {
    idxname: "title_idx",
    relation: Some(
        RangeVar {
            catalogname: "",
            schemaname: "",
            relname: "films",
            inh: true,
            relpersistence: "p",
            alias: None,
            location: 33,
        },
    ),
    access_method: "btree",
    table_space: "",
    index_params: [
        Node {
            node: Some(
                IndexElem(
                    IndexElem {
                        name: "title",
                        expr: None,
                        indexcolname: "",
                        collation: [],
                        opclass: [],
                        opclassopts: [],
                        ordering: SortbyDefault,
                        nulls_ordering: SortbyNullsDefault,
                    },
                ),
            ),
        },
    ],
    index_including_params: [],
    options: [],
    where_clause: None,
    exclude_op_names: [],
    idxcomment: "",
    index_oid: 0,
    old_node: 0,
    old_create_subid: 0,
    old_first_relfilenode_subid: 0,
    unique: true,
    nulls_not_distinct: false,
    primary: false,
    isconstraint: false,
    deferrable: false,
    initdeferred: false,
    transformed: false,
    concurrent: false,
    if_not_exists: false,
    reset_default_tblspc: false,
}

Additional context

NOTE: since access_method is always set, Using is always pushed (even if absent in the original statement)

@psteinroe psteinroe merged commit a27c65c into supabase-community:main Dec 17, 2023
1 check passed
@cvng cvng deleted the feat/create-index branch December 17, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants