SupabaseProvisioner class

Applies the bundled Supabase schema to a user-provided project using the Supabase Management API.

The anon key cannot execute DDL via PostgREST, and the existing _apply_migration() RPC only exists after the initial schema is applied. Bootstrapping a blank project therefore requires a privileged credential — a personal access token or an organization access token — which is passed once to applySchema and never persisted.

See the "Two-phase design" section of the plan for the full rationale.

Constructors

SupabaseProvisioner({Dio? dio, String? baseUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

applySchema({required String projectRef, required String accessToken, required String schemaSql}) Future<void>
Applies schemaSql to the project identified by projectRef.
configureAuth({required String projectRef, required String accessToken, required Map<String, dynamic> authConfig}) Future<void>
Configures the project's auth settings via the Management API.
deployFunction({required String projectRef, required String accessToken, required String slug, required String entrypoint, required Map<String, String> files, bool verifyJwt = false}) Future<void>
Deploys (creates or updates) an Edge Function.
fetchApiKeys({required String projectRef, required String accessToken}) Future<ProjectApiKeys>
Fetches the project's API keys via the Management API.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setSecrets({required String projectRef, required String accessToken, required Map<String, String> secrets}) Future<void>
Creates or updates one or more Edge Function secrets on the project.
toString() String
A string representation of this object.
inherited
writeFunctionsHash({required String projectRef, required String serviceRoleKey, required String hash}) Future<void>
Writes the bundled functions hash into _schema_meta.functions_hash on the user's Supabase project via PostgREST, using the fetched service role key so the write bypasses RLS.

Operators

operator ==(Object other) bool
The equality operator.
inherited