Skip to content

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

Refinement of Documentation

Angelico5f8f3055bded
diff --git a/web/docs/library/restful/delete.mdx b/web/docs/library/delete.mdx
similarity index 100%
rename from web/docs/library/restful/delete.mdx
rename to web/docs/library/delete.mdx
diff --git a/web/docs/library/restful/filters.mdx b/web/docs/library/filters.mdx
similarity index 100%
rename from web/docs/library/restful/filters.mdx
rename to web/docs/library/filters.mdx
diff --git a/web/docs/library/restful/get.mdx b/web/docs/library/get.mdx
similarity index 76%
rename from web/docs/library/restful/get.mdx
rename to web/docs/library/get.mdx
index ffc1b2ce4c3..8b0da5f038b 100644
--- a/web/docs/library/restful/get.mdx
+++ b/web/docs/library/get.mdx
@@ -58,40 +58,37 @@ All available options and examples it their usage can be found [here](../restful
## Additional filtering
### Select
```js
-select(columnArray)
+select(columnQuery)
```
-Returns an array of rows with only columns specified in `columnArray`.
+Returns an array of rows with only columns specified in `columnQuery`.
#### Method arguments
-##### columnArray
+##### columnQuery
`required` array
-```json
+```js
// From the 'users' table
-[
- "Id",
- "fullName",
- "companyId"
-]
+`
+ Id,
+ fullName,
+ companyId
+`
```
-Array of values representing column names found in the table. Typical data type would be string.
+String containing column names that are found in the table. The pattern/ syntax would be as shown above.
If a foreign key constraint exists between this table and another, information from
-the other table can be requested as well. This is shown below:
-```json
+the other table can be requested as well. The pattern/ syntax is shown below:
+```js
// From the 'users' table
-[
- "fullName",
- {
- "companies": [
- "name",
- "employeeCount"
- ]
+`
+ fullName,
+ companies {
+ name,
+ employeeCount
}
-]
+`
```
-Instead of a string data type, the column that has the foreign key constraint is now represented
-as an object with the name of the other table as the key and the desired columns from the other
-table as the value in the form of an array of column names of data type string.
+Instead of stating the column name with the foreign key constraint, the name of the other table is mentioned instead
+along with the desired column names from that table.
##### Example
Click [here](../restful/get#using-select) view some examples.
@@ -120,7 +117,7 @@ The following will be returned with status code `200 OK`:
### Using Select
Get all users but only return the column fullName.
```js
-supabase.get("users").select(["fullName"])
+supabase.get("users").select(`fullName`)
```
The following will be returned with the status code `200 OK`:
```json
@@ -134,15 +131,14 @@ The following will be returned with the status code `200 OK`:
### Using Select with Foreign Key Constraints
Get all users and return all information about them and the companies they belong to.
```js
-supabase.get("users").select([
- "fullName",
- {
- "companies": [
- "name",
- "employeeCount"
- ]
- }
-])
+supabase.get("users")
+ .select(`
+ fullName,
+ companies {
+ name,
+ employeeCount
+ }
+ `)
```
The following will be returned with the status code `200 OK`:
```json
diff --git a/web/docs/library/restful/options.mdx b/web/docs/library/options.mdx
similarity index 100%
rename from web/docs/library/restful/options.mdx
rename to web/docs/library/options.mdx
diff --git a/web/docs/library/restful/patch.mdx b/web/docs/library/patch.mdx
similarity index 100%
rename from web/docs/library/restful/patch.mdx
rename to web/docs/library/patch.mdx
diff --git a/web/docs/library/restful/post.mdx b/web/docs/library/post.mdx
similarity index 100%
rename from web/docs/library/restful/post.mdx
rename to web/docs/library/post.mdx
diff --git a/web/docs/library/restful/responses.mdx b/web/docs/library/responses.mdx
similarity index 100%
rename from web/docs/library/restful/responses.mdx
rename to web/docs/library/responses.mdx
diff --git a/web/docs/library/realtime/subscribe.mdx b/web/docs/library/subscribe.mdx
similarity index 100%
rename from web/docs/library/realtime/subscribe.mdx
rename to web/docs/library/subscribe.mdx
diff --git a/web/sidebars.js b/web/sidebars.js
index 99e13aac292..58291e5c9c1 100755
--- a/web/sidebars.js
+++ b/web/sidebars.js
@@ -13,26 +13,14 @@ module.exports = {
],
Library:[
"library/getting-started",
- {
- type: "category",
- label: "Realtime",
- items: [
- "library/realtime/subscribe"
- ]
- },
- {
- type: "category",
- label: "RESTful",
- items: [
- "library/restful/post",
- "library/restful/get",
- "library/restful/patch",
- "library/restful/delete",
- "library/restful/filters",
- "library/restful/options",
- "library/restful/responses"
- ]
- }
+ "library/subscribe",
+ "library/post",
+ "library/get",
+ "library/patch",
+ "library/delete",
+ "library/filters",
+ "library/options",
+ "library/responses"
],
Guides:[
"guides/examples"