SupabaseRoblox Supabase

Types

Complete reference of all types defined and used by the Roblox Supabase client.

Types Reference

This document provides complete type definitions for all objects and interfaces used throughout the Roblox Supabase client. These types enable type-safe database operations and provide full IntelliSense support in Roblox Studio.

Core Query Types

RootQuery

The entry point for all database operations after selecting a table with from(). Provides methods to start SELECT, INSERT, UPDATE, UPSERT, DELETE, and RPC queries.

Prop

Type

Query Stage System

The type system uses a sophisticated stage-based approach with finalizer collapsing. Understanding these stages is key to using the API effectively:

Stage Flow Overview

  1. Filter Stage: Initial stage for SELECT, UPDATE, DELETE, and RPC queries where filter methods are chainable
  2. Modifier Stage: For SELECT/RPC after using non-final modifiers (order, limit, range)
  3. Mutation Stages: Special stages for INSERT, UPDATE, DELETE operations
  4. Final Stage: Collapsed stage with only execution methods after using finalizers

Key Concepts

  • Chainable Methods: Return the same stage type for further chaining
  • Transitioning Methods: Move to a different stage type
  • Finalizers: Collapse the chain to FinalStage with only execute()/executeTyped()
  • Non-Final Modifiers: Remain in modifier stage for further chaining

SELECT Query Types

SelectFilterStage

The initial stage for SELECT queries. Filter methods are chainable, while modifiers transition to SelectModifierStage or collapse to FinalStage.

Prop

Type

SelectModifierStage

The stage after applying non-final modifiers (order, limit, range) in a SELECT query.

Prop

Type

Mutation Query Types (INSERT/UPSERT)

InsertQuery / UpsertQuery

Initial stage for INSERT and UPSERT operations. These start in MutationInitialStage with no filter support.

Prop

Type

Mutation Query Types (UPDATE/DELETE)

UpdateFilterStage

Initial stage for UPDATE operations with filter support.

Prop

Type

DeleteFilterStage

Initial stage for DELETE operations with filter support.

Prop

Type

RPC Query Types

RPCFilterStage

Initial stage for calling PostgreSQL stored procedures with filter support.

Prop

Type

RPCModifierStage

The stage after applying non-final modifiers (order, limit, range) in an RPC query.

Prop

Type

Mutation Select Stage

MutationSelectStage

The stage after calling .select() on a mutation query (INSERT, UPDATE, DELETE, UPSERT). This stage exposes single and maybeSingle which are not available in MutationInitialStage.

Prop

Type

Base Types

BaseExec

Base interface containing execution methods common to all query stages.

Prop

Type

FilterStage<Next>

Generic filter stage type used internally. All filter methods return the Next type parameter, enabling type-safe chaining.

ModifierStage

Modifier stage for SELECT/RPC queries with non-final modifiers (order, limit, range) that remain chainable, and finalizers that collapse to FinalStage.

MutationInitialStage

Initial stage for mutation queries (INSERT/UPSERT) before calling .select(). Exposes returns and csv as finalizers, and .select() to transition to MutationSelectStage.

FinalStage

Final collapsed stage with only execution methods. Reached after calling any finalizer method (single, maybeSingle, csv, returns, overrideTypes, explain).

Prop

Type

Configuration Types

InsertOptions

Configuration options for INSERT and UPSERT operations.

Prop

Type

UpdateOptions

Configuration options for UPDATE operations.

Prop

Type

DeleteOptions

Configuration options for DELETE operations.

Prop

Type

OrderOptions

Configuration options for ordering operations.

Prop

Type

LimitOptions

Configuration options for limit operations.

Prop

Type

RangeOptions

Configuration options for range operations.

Prop

Type

OrFilterOptions

Configuration options for OR filter operations.

Prop

Type

ExplainOptions

Configuration options for query execution plan explanation.

Prop

Type

FunctionsInvokeOptions

Configuration options for invoking Supabase Edge Functions.

Prop

Type

Service Client Types

RestClient

Main REST API client interface for Supabase PostgREST operations.

Prop

Type

SupabaseClient

The main client type returned by Supabase.createClient(). Provides access to all services.

Prop

Type

Type Relationships

Stage-Based Flow Diagram

Method Availability Matrix

Method TypeFilter StageModifier StageMutation InitialMutation SelectFinal Stage
Filter Methods
(eq, neq, gt, etc.)
✅ Chainable❌ Not available❌ Not available❌ Not available❌ Not available
Non-Final Modifiers
(order, limit, range)
✅ Transitioning✅ Chainable❌ Not available❌ Not available❌ Not available
Finalizers
(single, maybeSingle)
✅ Collapses✅ Collapses❌ Not available*✅ Collapses❌ Not available
Finalizers
(csv, returns)
✅ Collapses✅ Collapses✅ Collapses✅ Collapses❌ Not available
Finalizers
(overrideTypes, explain)
✅ Collapses✅ Collapses❌ Not available❌ Not available❌ Not available
select()✅ (Mutation only)❌ Not available✅ Transitioning❌ Not available❌ Not available
get()✅ (RPC only)❌ Not available❌ Not available❌ Not available❌ Not available
execute()
executeTyped()
✅ Available✅ Available✅ Available✅ Available✅ Only these

Note: single() and maybeSingle() are only available in MutationSelectStage, not MutationInitialStage.

Query Type to Stage Mapping

Query TypeInitial StageAfter .select()After ModifierAfter Finalizer
select()SelectFilterStageN/ASelectModifierStageFinalStage
insert()InsertQuery
(MutationInitialStage)
MutationSelectStageN/AFinalStage
update()UpdateFilterStageMutationSelectStageN/AFinalStage
delete()DeleteFilterStageMutationSelectStageN/AFinalStage
upsert()UpsertQuery
(MutationInitialStage)
MutationSelectStageN/AFinalStage
rpc()RPCFilterStageN/ARPCModifierStageFinalStage

On this page