Skip to content

Commit

Permalink
chore(prettier): fix sql & format mdx files
Browse files Browse the repository at this point in the history
  • Loading branch information
gregnr committed Apr 28, 2023
1 parent 685188a commit 7ce8579
Show file tree
Hide file tree
Showing 92 changed files with 1,166 additions and 1,416 deletions.
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
"singleQuote": true,
"printWidth": 100,
"endOfLine": "lf",
"sqlKeywordCase": "lower"
"sqlKeywordCase": "lower",
"pluginSearchDirs": false,
"plugins": ["prettier-plugin-sql-cst"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
- Click on [`Providers`](https://app.supabase.com/project/_/auth/providers) under the Configuration section
- Click on **{props.provider}** from the accordion list to expand and turn **{props.provider} Enabled** to ON
- Enter your **{props.provider} Client ID** and **{props.provider} Client Secret** saved in the previous step
- Click `Save`
- Click `Save`
28 changes: 3 additions & 25 deletions apps/docs/docs/ref/javascript/v1/upgrade-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ The signIn() method has been deprecated in favor of more explicit method signatu
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { user, error } = await supabase
.auth
Expand All @@ -98,7 +97,6 @@ const { user, error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const {
data: { user },
Expand Down Expand Up @@ -128,7 +126,6 @@ const {
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { error } = await supabase
.auth
Expand All @@ -137,7 +134,6 @@ const { error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const { error } = await supabase
.auth
Expand Down Expand Up @@ -165,7 +161,6 @@ const { error } = await supabase
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { error } = await supabase
.auth
Expand All @@ -174,7 +169,6 @@ const { error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const { error } = await supabase
.auth
Expand All @@ -201,7 +195,6 @@ const { error } = await supabase
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { error } = await supabase
.auth
Expand All @@ -210,7 +203,6 @@ const { error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const { error } = await supabase
.auth
Expand Down Expand Up @@ -238,7 +230,6 @@ const { error } = await supabase
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { error } = await supabase
.auth
Expand All @@ -248,16 +239,15 @@ const { error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.auth
.signInWithOtp({ phone })

// After receiving a SMS with a OTP.
const { data, error } = await supabase
.auth
.verifyOtp({ phone, token })
.auth
.verifyOtp({ phone, token })
```

</TabPanel>
Expand All @@ -281,7 +271,6 @@ const { data, error } = await supabase
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.auth
Expand All @@ -291,7 +280,6 @@ const { data, error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.auth
Expand Down Expand Up @@ -390,7 +378,6 @@ const { user } = session
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { user, error } = await supabase
.auth
Expand Down Expand Up @@ -435,7 +422,6 @@ const { user, error } = supabase.auth.setAuth(access_token)

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const supabase = createClient(
SUPABASE_URL,
Expand Down Expand Up @@ -486,7 +472,6 @@ Previously, these methods return inserted/updated/deleted rows by default (which
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.from('my_table')
Expand All @@ -495,7 +480,6 @@ const { data, error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.from('my_table')
Expand Down Expand Up @@ -524,7 +508,6 @@ const { data, error } = await supabase
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.from('my_table')
Expand All @@ -534,7 +517,6 @@ const { data, error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.from('my_table')
Expand Down Expand Up @@ -564,7 +546,6 @@ const { data, error } = await supabase
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.from('my_table')
Expand All @@ -573,7 +554,6 @@ const { data, error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.from('my_table')
Expand Down Expand Up @@ -602,7 +582,6 @@ const { data, error } = await supabase
defaultActiveId="1.0x"
>
<TabPanel id="1.0x" label="Before">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.from('my_table')
Expand All @@ -612,7 +591,6 @@ const { data, error } = await supabase

</TabPanel>
<TabPanel id="2.0x" label="After">
{/* prettier-ignore */}
```ts
const { data, error } = await supabase
.from('my_table')
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/docs/ref/self-hosting-auth/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ hideTitle: true
<RefSubLayout.EducationRow>
<RefSubLayout.Details>

The Supabase Auth Server (GoTrue) is a JSON Web Token (JWT)-based API for managing users and issuing access tokens.
The Supabase Auth Server (GoTrue) is a JSON Web Token (JWT)-based API for managing users and issuing access tokens.

GoTrue is an open-source API written in Golang, that acts as a self-standing API service for handling user registration and authentication for JAM projects. It's based on OAuth2 and JWT and handles user signup, authentication, and custom user data.
GoTrue is an open-source API written in Golang, that acts as a self-standing API service for handling user registration and authentication for JAM projects. It's based on OAuth2 and JWT and handles user signup, authentication, and custom user data.

</RefSubLayout.Details>

Expand Down
10 changes: 5 additions & 5 deletions apps/docs/docs/ref/self-hosting-storage/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ hideTitle: true
<RefSubLayout.EducationRow>
<RefSubLayout.Details>

An S3 compatible object storage service that integrates with Postgres.
An S3 compatible object storage service that integrates with Postgres.

- Uses Postgres as it's datastore for storing metadata
- Authorization rules are written as Postgres Row Level Security policies
- Integrates with S3 as the storage backend (with more in the pipeline!)
- Extremely lightweight and performant
- Uses Postgres as it's datastore for storing metadata
- Authorization rules are written as Postgres Row Level Security policies
- Integrates with S3 as the storage backend (with more in the pipeline!)
- Extremely lightweight and performant

</RefSubLayout.Details>

Expand Down
10 changes: 4 additions & 6 deletions apps/docs/docs/ref/swift/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ hideTitle: true
</div>

<div className="max-w-xl">
This reference documents every object and method available in Supabase's Swift library, [supabase-swift](https://github.com/supabase-community/supabase-swift). You can use supabase-swift to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files.
This reference documents every object and method available in Supabase's Swift library, [supabase-swift](https://github.com/supabase-community/supabase-swift). You can use supabase-swift to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files.

We also provide a [supabase](https://pub.dev/packages/supabase) package for non-Swift projects.

We also provide a [supabase](https://pub.dev/packages/supabase) package for non-Swift projects.
</div>

<div className="max-w-xl bg-slate-300 px-4 py-2 rounded-md">
<p>The Swift client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues.</p>

<p>
Huge thanks to official maintainer, [Maail](https://github.com/maail).
</p>
<p>Huge thanks to official maintainer, [Maail](https://github.com/maail).</p>

</div>

3 changes: 2 additions & 1 deletion apps/docs/docs/reference/dart/initializing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ final supabase = Supabase.instance.client;

### Call `initialize()` with custom headers

You can pass `headers` to initialize your Supabase client with customer headers.
You can pass `headers` to initialize your Supabase client with customer headers.
Here is an example of passing a custom auth header to Supabase client.

```dart title=main.dart
Future<void> main() async {
await Supabase.initialize(
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/docs/reference/javascript/v1/initializing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key
```

By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.
Go to `Settings > API > Schema` and add the schema which you want to expose to the API. You also need to grant `USAGE` on your new schema with the grants you desire, such as `SELECT, INSERT, UPDATE, DELETE`.
Go to `Settings > API > Schema` and add the schema which you want to expose to the API. You also need to grant `USAGE` on your new schema with the grants you desire, such as `SELECT, INSERT, UPDATE, DELETE`.

Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema.

Expand Down
39 changes: 9 additions & 30 deletions apps/docs/docs/reference/postgres/changing-timezones.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
---
id: changing-timezones
title: "Changing Timezones"
title: 'Changing Timezones'
slug: changing-timezones
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml
---

import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
import Tabs from '@theme/Tabs'
import TabsPanel from '@theme/TabsPanel'

Data types.


<Tabs
defaultActiveId="sql"
groupId="reference/postgres"
Expand All @@ -19,38 +18,22 @@ Data types.
<TabsPanel id="sql" label="sql">

```sql
alter database postgres
alter database postgres
set timezone to 'America/New_York';
```


</TabsPanel>

</Tabs>





## Notes

- View a full list of timezones on [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).










## Examples

### Change timezone



<Tabs
defaultActiveId="sql"
groupId="reference/postgres"
Expand All @@ -59,11 +42,10 @@ set timezone to 'America/New_York';
<TabsPanel id="sql" label="sql">

```sql
alter database postgres
alter database postgres
set timezone to 'America/New_York';
```


</TabsPanel>

</Tabs>
Expand All @@ -77,7 +59,6 @@ Get a full list of timezones supported by your database. This will return the fo
- `utc_offset`: Offset from UTC (positive means east of Greenwich)
- `is_dst`: True if currently observing daylight savings


<Tabs
defaultActiveId="sql"
groupId="reference/postgres"
Expand All @@ -87,11 +68,10 @@ Get a full list of timezones supported by your database. This will return the fo

```sql
select name, abbrev, utc_offset, is_dst
from pg_timezone_names()
from pg_timezone_names()
order by name;
```


</TabsPanel>

</Tabs>
Expand All @@ -108,12 +88,11 @@ Use `ilike` (case insensitive search) to find specific timezones.
<TabsPanel id="sql" label="sql">

```sql
select *
from pg_timezone_names()
select *
from pg_timezone_names()
where name ilike '%york%';
```


</TabsPanel>

</Tabs>
</Tabs>
Loading

0 comments on commit 7ce8579

Please sign in to comment.