`supabase-js` release candidate `2.46.2-rc.3` incoming types inferences for PostgREST fixes and feedbacks

Nov 6, 2024

🚀 Announcement: We’ve just released supabase-js version 2.46.2-rc.3, which resolves several type errors in the PostgREST client.

Notable issues resolved:#

We’d love your feedback to ensure everything runs smoothly!


Important Notes:#

This update might require regenerating your database types. You can do this via the Supabase CLI (≥v1.207.8) or the dashboard. For instructions, check out our guide here.


Potential Issues#

This version introduces stricter alignment between runtime behavior and type inference. As a result, some types might appear "broken" but are actually being corrected.

The main changes to be aware of:

  1. The result of an embedding now correctly infers a single object or an array based on the relationship.
  2. The result of an object embedding now more accurately identifies whether the result can be null.

Before reporting a bug, please double-check that the inferred types are truly incorrect based on your query and database schema.


Bug Reporting:#

If your project is hosted on Supabase, please open a support ticket here and check "Allow Supabase Support to access your project temporarily." This will enable us to investigate your database types directly.

Alternatively, you can open an issue on GitHub. Please include:

  1. The generated Database type used to instantiate the client (e.g., createClient<Database>(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY)). If possible a minimal SQL declaration resulting in such Database type.
  2. The query where type inference failed (e.g., .from('which-table').select('which-query')).
  3. Your TypeScript version (npx tsc -v).

Build in a weekend, scale to millions