Skip to content

Remove signature to allow any table name for from #1654

@olee

Description

@olee

I think the 3rd signature for the from method should be removed which currently allows using any table name inside the postgrest client:
https://github.com/supabase/postgrest-js/blob/f730aa793fbc8650de8bf914c816e943eba42844/src/PostgrestClient.ts#L59-L66
Currently this makes it quite hard to catch errors when for example removing or renaming tables.


If anyone would like to allow calling from on unknown tables, they could still do it imho by adding an index signature to the schema eg.

type Database = {
    public: {
        Tables: {
            /* standard signatures go here */

            // Allow any table name in from etc
            [key: string]: any;
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    postgrest-jsRelated to the postgrest-js library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions