Skip to content

Commit

Permalink
feat: typecheck table names in .from()
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Mar 25, 2024
1 parent e26266a commit 5f2567b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/PostgrestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export default class PostgrestClient<
from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(
relation: ViewName
): PostgrestQueryBuilder<Schema, View, ViewName>
from(relation: string): PostgrestQueryBuilder<Schema, any, any>
/**
* Perform a query on a table or a view.
*
Expand Down
1 change: 1 addition & 0 deletions test/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const postgrest = new PostgrestClient<Database>(REST_URL)
// table invalid type
{
expectError(postgrest.from(42))
expectError(postgrest.from('nonexistent_table'))
}

// `null` can't be used with `.eq()`
Expand Down

0 comments on commit 5f2567b

Please sign in to comment.