Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Update cli.mdx (#22564)

Pedro Carloto0116711a8a9a
diff --git a/apps/docs/content/guides/cli.mdx b/apps/docs/content/guides/cli.mdx
index 4cc568e2d3d..e123fa567c9 100644
--- a/apps/docs/content/guides/cli.mdx
+++ b/apps/docs/content/guides/cli.mdx
@@ -6,7 +6,7 @@ subtitle: 'Developing locally using the Supabase CLI.'
sidebar_label: 'Overview'
---
-You can use the Supabase CLI to run the entire Supabase stack locally on your machine, simply by running `supabase init` and then `supabase start`.
+You can use the Supabase CLI to run the entire Supabase stack locally on your machine, simply by running `supabase init` and then `supabase start`. To install the CLI, see the [installation guide](/docs/guides/cli/getting-started#installing-the-supabase-cli).
The Supabase CLI provides tools to develop your project locally, deploy to the Supabase Platform, handle database migrations, and generate types directly from your database schema.
diff --git a/packages/pg-meta/src/pg-meta-roles.ts b/packages/pg-meta/src/pg-meta-roles.ts
index f3c5ca391c5..2c9afbd32de 100644
--- a/packages/pg-meta/src/pg-meta-roles.ts
+++ b/packages/pg-meta/src/pg-meta-roles.ts
@@ -67,7 +67,10 @@ where
function retrieve({ id }: { id: number }): { sql: string; zod: typeof pgRoleOptionalZod }
function retrieve({ name }: { name: string }): { sql: string; zod: typeof pgRoleOptionalZod }
-function retrieve({ id, name }: { id?: number; name?: string }): { sql: string; zod: typeof pgRoleOptionalZod } {
+function retrieve({ id, name }: { id?: number; name?: string }): {
+ sql: string
+ zod: typeof pgRoleOptionalZod
+} {
if (id) {
const sql = `${ROLES_SQL} where r.oid = ${literal(id)};`
return {
@@ -84,21 +87,21 @@ function retrieve({ id, name }: { id?: number; name?: string }): { sql: string;
}
type RoleCreateParams = {
- name: string,
- isSuperuser?: boolean,
- canCreateDb?: boolean,
- canCreateRole?: boolean,
- inheritRole?: boolean,
- canLogin?: boolean,
- isReplicationRole?: boolean,
- canBypassRls?: boolean,
- connectionLimit?: number,
- password?: string,
- validUntil?: string,
- memberOf?: string[],
- members?: string[],
- admins?: string[],
- config?: Record<string, string>,
+ name: string
+ isSuperuser?: boolean
+ canCreateDb?: boolean
+ canCreateRole?: boolean
+ inheritRole?: boolean
+ canLogin?: boolean
+ isReplicationRole?: boolean
+ canBypassRls?: boolean
+ connectionLimit?: number
+ password?: string
+ validUntil?: string
+ memberOf?: string[]
+ members?: string[]
+ admins?: string[]
+ config?: Record<string, string>
}
function create({
name,
@@ -133,23 +136,25 @@ create role ${ident(name)}
${members.length === 0 ? '' : `role ${members.map(ident).join(',')}`}
${admins.length === 0 ? '' : `admin ${admins.map(ident).join(',')}`}
;
-${Object.entries(config).map(([param, value]) => `alter role ${ident(name)} set ${ident(param)} = ${literal(value)};`).join('\n')}
+${Object.entries(config)
+ .map(([param, value]) => `alter role ${ident(name)} set ${ident(param)} = ${literal(value)};`)
+ .join('\n')}
`
return { sql }
}
type RoleUpdateParams = {
- name?: string,
- isSuperuser?: boolean,
- canCreateDb?: boolean,
- canCreateRole?: boolean,
- inheritRole?: boolean,
- canLogin?: boolean,
- isReplicationRole?: boolean,
- canBypassRls?: boolean,
- connectionLimit?: number,
- password?: string,
- validUntil?: string,
+ name?: string
+ isSuperuser?: boolean
+ canCreateDb?: boolean
+ canCreateRole?: boolean
+ inheritRole?: boolean
+ canLogin?: boolean
+ isReplicationRole?: boolean
+ canBypassRls?: boolean
+ connectionLimit?: number
+ password?: string
+ validUntil?: string
}
function update({ id }: { id: number }, params: RoleUpdateParams): { sql: string }
function update({ name }: { name: string }, params: RoleUpdateParams): { sql: string }
@@ -173,7 +178,8 @@ function update(
connectionLimit,
password,
validUntil,
- }: RoleUpdateParams): { sql: string } {
+ }: RoleUpdateParams
+): { sql: string } {
const sql = `
do $$
declare
@@ -198,12 +204,16 @@ begin
${validUntil === undefined ? '' : `valid until ${literal(validUntil)}`}
', old.rolname));
- ${newName === undefined ? '' : `
+ ${
+ newName === undefined
+ ? ''
+ : `
-- Using the same name in the rename clause gives an error, so only do it if the new name is different.
if new_name != old.nspname then
execute(format('alter role %I rename to ${ident(newName)};', old.nspname));
end if;
- `}
+ `
+ }
end
$$;
`
diff --git a/packages/pg-meta/src/pg-meta-schemas.ts b/packages/pg-meta/src/pg-meta-schemas.ts
index 83a636eb2fc..d367b1b525e 100644
--- a/packages/pg-meta/src/pg-meta-schemas.ts
+++ b/packages/pg-meta/src/pg-meta-schemas.ts
@@ -41,7 +41,10 @@ function list({
function retrieve({ id }: { id: number }): { sql: string; zod: typeof pgSchemaOptionalZod }
function retrieve({ name }: { name: string }): { sql: string; zod: typeof pgSchemaOptionalZod }
-function retrieve({ id, name }: { id?: number; name?: string }): { sql: string; zod: typeof pgSchemaOptionalZod } {
+function retrieve({ id, name }: { id?: number; name?: string }): {
+ sql: string
+ zod: typeof pgSchemaOptionalZod
+} {
if (id) {
const sql = `${SCHEMAS_SQL} and n.oid = ${literal(id)};`
return {