feat: add python documentation for functions, Auth, and Storage (#10343)
* initial commit * fix: remove methods which aren't in python lib yet * temporarily remove postgrest * feat: add non-admin methods * fix: temporarily remove non-admin methods * Update Dashboard Auth Settings links * Update example names * Add example * started adding pages * fix: update python ids * fix: change python docs image back to grayscale * fix: update ids of storage functions * Update apps/docs/pages/reference/python/[...slug].tsx Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: reinstate python image * filter common navmenu sections based on library * fix reference icons * Add introduction * Add IDs * Update common client libs sections * Update intro * fix: add reference section and database section Co-authored-by: joel@joellee.org <joel@joellee.org> Co-authored-by: dannykng <danny@supabase.io> Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Francisco Mazzoni <francisco@supabase.io>
@@ -94,6 +94,12 @@ const home = [
|
||||
href: '/reference/dart/introduction',
|
||||
level: 'reference_dart',
|
||||
},
|
||||
{
|
||||
label: 'Python',
|
||||
icon: '/img/icons/menu/reference-python',
|
||||
href: '/reference/python/introduction',
|
||||
level: 'reference_python',
|
||||
},
|
||||
{
|
||||
label: 'Tools Reference',
|
||||
},
|
||||
|
||||
@@ -788,6 +788,13 @@ export const reference_dart_v1 = {
|
||||
parent: '/reference',
|
||||
}
|
||||
|
||||
export const reference_python_v2 = {
|
||||
icon: 'reference-python',
|
||||
title: 'Python',
|
||||
url: '/guides/reference/python',
|
||||
parent: '/reference',
|
||||
}
|
||||
|
||||
export const reference_cli = {
|
||||
icon: 'reference-cli',
|
||||
title: 'Supabase CLI',
|
||||
|
||||
@@ -11,6 +11,9 @@ import spec_js_v1 from '~/../../spec/supabase_js_v1.yml' assert { type: 'yml' }
|
||||
import spec_dart_v1 from '~/../../spec/supabase_dart_v1.yml' assert { type: 'yml' }
|
||||
// @ts-expect-error
|
||||
import spec_dart_v0 from '~/../../spec/supabase_dart_v0.yml' assert { type: 'yml' }
|
||||
// @ts-expect-error
|
||||
import spec_python_v2 from '~/../../spec/supabase_py_v2.yml' assert { type: 'yml' }
|
||||
|
||||
// import { gen_v3 } from '~/lib/refGenerator/helpers'
|
||||
import apiCommonSections from '~/../../spec/common-api-sections.json'
|
||||
import cliCommonSections from '~/../../spec/common-cli-sections.json'
|
||||
@@ -47,6 +50,7 @@ export type RefIdOptions =
|
||||
| 'reference_javascript_v2'
|
||||
| 'reference_dart_v0'
|
||||
| 'reference_dart_v1'
|
||||
| 'reference_python_v2'
|
||||
| 'reference_cli'
|
||||
| 'reference_api'
|
||||
| 'reference_self_hosting_auth'
|
||||
@@ -56,6 +60,7 @@ export type RefIdOptions =
|
||||
export type RefKeyOptions =
|
||||
| 'javascript'
|
||||
| 'dart'
|
||||
| 'python'
|
||||
| 'cli'
|
||||
| 'api'
|
||||
| 'self-hosting-auth'
|
||||
@@ -65,16 +70,6 @@ export type RefKeyOptions =
|
||||
const NavigationMenu = () => {
|
||||
const router = useRouter()
|
||||
|
||||
let version = ''
|
||||
|
||||
if (router.asPath.includes('v1')) {
|
||||
version = '_v1'
|
||||
}
|
||||
|
||||
if (router.asPath.includes('v0')) {
|
||||
version = '_v0'
|
||||
}
|
||||
|
||||
function handleRouteChange(url: string) {
|
||||
switch (url) {
|
||||
case `/docs`:
|
||||
@@ -126,6 +121,10 @@ const NavigationMenu = () => {
|
||||
case url.includes(`/docs/reference/dart`) && url:
|
||||
menuState.setMenuLevelId('reference_dart_v1')
|
||||
break
|
||||
// puthon v2 (latest)
|
||||
case url.includes(`/docs/reference/python`) && url:
|
||||
menuState.setMenuLevelId('reference_python_v2')
|
||||
break
|
||||
case url.includes(`/docs/reference/cli`) && url:
|
||||
menuState.setMenuLevelId('reference_cli')
|
||||
break
|
||||
@@ -175,6 +174,7 @@ const NavigationMenu = () => {
|
||||
const isReference_Javascript_V2 = 'reference_javascript_v2' === level
|
||||
const isReference_Dart_V0 = 'reference_dart_v0' === level
|
||||
const isReference_Dart_V1 = 'reference_dart_v1' === level
|
||||
const isReference_Python_V2 = 'reference_python_v2' === level
|
||||
const isReference_Cli = 'reference_cli' === level
|
||||
const isReference_Api = 'reference_api' === level
|
||||
const isReference_Self_Hosting_Auth = 'reference_self_hosting_auth' === level
|
||||
@@ -229,6 +229,14 @@ const NavigationMenu = () => {
|
||||
lib="dart"
|
||||
spec={spec_dart_v1}
|
||||
/>
|
||||
<NavigationMenuRefList
|
||||
key={'reference-python-menu-v2'}
|
||||
id={'reference_python_v2'}
|
||||
active={isReference_Python_V2}
|
||||
commonSections={libCommonSections}
|
||||
lib="python"
|
||||
spec={spec_python_v2}
|
||||
/>
|
||||
{/* // Tools */}
|
||||
<NavigationMenuRefList
|
||||
key={'reference-cli-menu'}
|
||||
|
||||
@@ -25,6 +25,10 @@ const NavigationMenuRefList: React.FC<INavigationMenuRefList> = ({
|
||||
active,
|
||||
spec,
|
||||
}) => {
|
||||
const filteredSections = commonSections.filter((section) => {
|
||||
return !section.excludes?.includes(id)
|
||||
})
|
||||
|
||||
return (
|
||||
<div
|
||||
className={[
|
||||
@@ -38,7 +42,7 @@ const NavigationMenuRefList: React.FC<INavigationMenuRefList> = ({
|
||||
!active ? 'opacity-0 invisible absolute h-0 overflow-hidden' : '',
|
||||
].join(' ')}
|
||||
>
|
||||
<NavigationMenuRefListItems id={id} lib={lib} commonSections={commonSections} spec={spec} />
|
||||
<NavigationMenuRefListItems id={id} lib={lib} commonSections={filteredSections} spec={spec} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ const Content: React.FC<INavigationMenuRefList> = ({ id, lib, commonSections, sp
|
||||
if (!sections) console.error('no common sections imported')
|
||||
|
||||
const menu = NavItems[id]
|
||||
|
||||
console.log(menu)
|
||||
const databaseFunctions = find(sections, { title: 'Database' })
|
||||
? find(sections, { title: 'Database' }).items
|
||||
: []
|
||||
|
||||
21
apps/docs/docs/ref/python/introduction.mdx
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
id: introduction
|
||||
title: Introduction
|
||||
hideTitle: true
|
||||
---
|
||||
|
||||
<div className="flex items-start gap-6 not-prose" id="introduction">
|
||||
<img src="/docs/img/icons/menu/reference-python.svg" className="w-8 h-8 rounded" />
|
||||
<div className="flex flex-col gap-2">
|
||||
<h1 className="text-3xl text-scale-1200 m-0">Python Client Library</h1>
|
||||
<h2 className="text-base font-mono text-scale-1100">@supabase-community/supabase-py</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="max-w-xl">
|
||||
This reference documents every object and method available in the
|
||||
[supabase-py](https://github.com/supabase-community/supabase-py) library from the Supabase
|
||||
community. You can use `supabase-py` to interact with your Postgres database, listen to database
|
||||
changes, invoke Deno Edge Functions, build login and user management functionality, and manage
|
||||
large files.
|
||||
</div>
|
||||
10
apps/docs/docs/ref/python/release-notes.mdx
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
id: release-notes
|
||||
title: Release Notes
|
||||
---
|
||||
|
||||
The community is actively working on the library and we will be upgrading the Authentication library, `gotrue-py`, to mirror the Supabase-js v2 lib.
|
||||
|
||||
## Storage Transformations
|
||||
|
||||
We currently support [image transformations](https://supabase.com/docs/guides/storage/image-transformations) in our storage library.
|
||||
@@ -71,6 +71,10 @@ const levelsData = {
|
||||
icon: '/docs/img/icons/menu/reference-dart',
|
||||
name: 'Dart Reference v0.0',
|
||||
},
|
||||
reference_python_v2: {
|
||||
icon: '/docs/img/icons/menu/reference-python',
|
||||
name: 'Python Reference v2.0',
|
||||
},
|
||||
reference_cli: {
|
||||
icon: '/docs/img/icons/menu/reference-cli',
|
||||
name: 'CLI Reference',
|
||||
|
||||
30
apps/docs/pages/reference/python/[...slug].tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import clientLibsCommonSections from '~/../../spec/common-client-libs-sections.json'
|
||||
import typeSpec from '~/../../spec/enrichments/tsdoc_v2/combined.json'
|
||||
// @ts-expect-error
|
||||
import spec from '~/../../spec/supabase_py_v2.yml' assert { type: 'yml' }
|
||||
import RefSectionHandler from '~/components/reference/RefSectionHandler'
|
||||
import { flattenSections } from '~/lib/helpers'
|
||||
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
|
||||
import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
|
||||
|
||||
const sections = flattenSections(clientLibsCommonSections)
|
||||
|
||||
export default function PyReference(props) {
|
||||
return (
|
||||
<RefSectionHandler
|
||||
sections={sections}
|
||||
spec={spec}
|
||||
typeSpec={typeSpec}
|
||||
pageProps={props}
|
||||
type="client-lib"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getStaticProps() {
|
||||
return handleRefStaticProps(sections, '/python')
|
||||
}
|
||||
|
||||
export function getStaticPaths() {
|
||||
return handleRefGetStaticPaths()
|
||||
}
|
||||
44
apps/docs/pages/reference/python/crawlers/[...slug].tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import clientLibsCommonSections from '~/../../spec/common-client-libs-sections.json'
|
||||
import typeSpec from '~/../../spec/enrichments/tsdoc_v2/combined.json'
|
||||
// @ts-expect-error
|
||||
import spec from '~/../../spec/supabase_py_v2.yml' assert { type: 'yml' }
|
||||
import RefSectionHandler from '~/components/reference/RefSectionHandler'
|
||||
import { flattenSections } from '~/lib/helpers'
|
||||
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
|
||||
import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
|
||||
import { useRouter } from 'next/router'
|
||||
import RefSEO from '~/components/reference/RefSEO'
|
||||
|
||||
const sections = flattenSections(clientLibsCommonSections)
|
||||
|
||||
export default function PyReference(props) {
|
||||
const router = useRouter()
|
||||
const slug = router.query.slug[0]
|
||||
const filteredSection = sections.filter((section) => section.id === slug)
|
||||
|
||||
const pageTitle = filteredSection[0]?.title
|
||||
? `${filteredSection[0]?.title} | Supabase`
|
||||
: 'Supabase'
|
||||
|
||||
return (
|
||||
<>
|
||||
<RefSEO title={pageTitle} />
|
||||
|
||||
<RefSectionHandler
|
||||
sections={filteredSection}
|
||||
spec={spec}
|
||||
typeSpec={typeSpec}
|
||||
pageProps={props}
|
||||
type="client-lib"
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getStaticProps() {
|
||||
return handleRefStaticProps(sections, '/python')
|
||||
}
|
||||
|
||||
export function getStaticPaths() {
|
||||
return handleRefGetStaticPaths()
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
<svg width="15" height="18" viewBox="0 0 15 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0347 0.420898L8.66508 0.426816L0.00683594 9.08506L2.67814 11.7597L5.02598 9.42498L14.0347 0.420898ZM8.81915 8.40844C8.74295 8.40492 8.6644 8.40129 8.61512 8.46638L3.99811 13.0827L6.6501 15.7185L6.64716 15.7214L8.54505 17.6209C8.55749 17.6319 8.56986 17.6443 8.58246 17.6569C8.6344 17.7088 8.69013 17.7645 8.77056 17.7465C9.6472 17.7445 10.5238 17.7448 11.4006 17.7452C12.2775 17.7455 13.1545 17.7458 14.0316 17.7439L9.36417 13.0721L14.0301 8.40918L8.91032 8.40787C8.88183 8.41133 8.85069 8.40989 8.81915 8.40844Z" fill="url(#paint0_linear_657_71721)"/>
|
||||
<svg width="81" height="80" viewBox="0 0 81 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M62.8209 10.9141L44.7971 10.9339L15.7344 39.9967L24.701 48.9743L32.5819 41.1376L62.8209 10.9141ZM45.3142 37.7255C45.0585 37.7136 44.7948 37.7015 44.6294 37.92L29.1317 53.4154L38.0337 62.2629L38.0234 62.273L44.394 68.649C44.4358 68.6861 44.4773 68.7276 44.5196 68.7698C44.6939 68.944 44.881 69.1309 45.151 69.0705C48.0938 69.0639 51.0367 69.065 53.9798 69.0661C56.9231 69.0672 59.8666 69.0683 62.8106 69.0617L47.1433 53.3803L62.8055 37.728L45.6203 37.7235C45.5247 37.7352 45.4201 37.7303 45.3142 37.7255Z" fill="url(#paint0_linear_1785_15060)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_657_71721" x1="5.29108" y1="13.0823" x2="16.7808" y2="13.0823" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#429B72"/>
|
||||
<stop offset="1" stop-color="#D8FFEC" stop-opacity="0.6"/>
|
||||
<linearGradient id="paint0_linear_1785_15060" x1="15.7344" y1="69.0821" x2="72.627" y2="23.028" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#171717" stop-opacity="0.5"/>
|
||||
<stop offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 959 B After Width: | Height: | Size: 925 B |
@@ -1,9 +1,9 @@
|
||||
<svg width="15" height="18" viewBox="0 0 15 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0347 0.420898L8.66508 0.426816L0.00683594 9.08506L2.67814 11.7597L5.02598 9.42498L14.0347 0.420898ZM8.81915 8.40844C8.74295 8.40492 8.6644 8.40129 8.61512 8.46638L3.99811 13.0827L6.6501 15.7185L6.64716 15.7214L8.54505 17.6209C8.55749 17.6319 8.56986 17.6443 8.58246 17.6569C8.6344 17.7088 8.69013 17.7645 8.77056 17.7465C9.6472 17.7445 10.5238 17.7448 11.4006 17.7452C12.2775 17.7455 13.1545 17.7458 14.0316 17.7439L9.36417 13.0721L14.0301 8.40918L8.91032 8.40787C8.88183 8.41133 8.85069 8.40989 8.81915 8.40844Z" fill="url(#paint0_linear_657_71721)"/>
|
||||
<svg width="81" height="80" viewBox="0 0 81 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M62.8209 10.9141L44.7971 10.9339L15.7344 39.9967L24.701 48.9743L32.5819 41.1376L62.8209 10.9141ZM45.3142 37.7255C45.0585 37.7136 44.7948 37.7015 44.6294 37.92L29.1317 53.4154L38.0337 62.2629L38.0234 62.273L44.394 68.649C44.4358 68.6861 44.4773 68.7276 44.5196 68.7698C44.6939 68.944 44.881 69.1309 45.151 69.0705C48.0938 69.0639 51.0367 69.065 53.9798 69.0661C56.9231 69.0672 59.8666 69.0683 62.8106 69.0617L47.1433 53.3803L62.8055 37.728L45.6203 37.7235C45.5247 37.7352 45.4201 37.7303 45.3142 37.7255Z" fill="url(#paint0_linear_1785_15060)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_657_71721" x1="5.29108" y1="13.0823" x2="16.7808" y2="13.0823" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#F4FFFA"/>
|
||||
<stop offset="1" stop-color="#D8FFEC" stop-opacity="0.6"/>
|
||||
<linearGradient id="paint0_linear_1785_15060" x1="15.7344" y1="69.0821" x2="72.627" y2="23.028" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#EDEDED" stop-opacity="0.5"/>
|
||||
<stop offset="1" stop-color="white"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 959 B After Width: | Height: | Size: 944 B |
@@ -1,9 +1,9 @@
|
||||
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.230469 0.339844H53.7695V53.8789H0.230469V0.339844ZM41.1578 45.2235C38.6763 45.2235 37.2732 43.9292 36.1948 42.1683L32.1063 44.5436C33.5832 47.4619 36.6018 49.6885 41.2742 49.6885C46.0527 49.6885 49.611 47.207 49.611 42.6774C49.611 38.4758 47.1975 36.6071 42.9228 34.774L41.6651 34.2352C39.5065 33.3004 38.5717 32.6894 38.5717 31.1801C38.5717 29.9589 39.5057 29.0241 40.9793 29.0241C42.424 29.0241 43.3545 29.6334 44.2171 31.1801L48.1348 28.6646C46.4777 25.7497 44.178 24.6364 40.9793 24.6364C36.4863 24.6364 33.6113 27.5088 33.6113 31.2821C33.6113 35.3782 36.0231 37.3158 39.6536 38.8625L40.9113 39.4022C43.2058 40.4058 44.5741 41.0168 44.5741 42.742C44.5741 44.1816 43.2424 45.2235 41.1578 45.2235ZM21.6602 45.192C19.9316 45.192 19.2127 44.0065 18.4223 42.6043L14.327 45.0837C15.5134 47.5945 17.8462 49.6791 21.8743 49.6791C26.3325 49.6791 29.3868 47.3081 29.3868 42.0987V24.9237H24.3558V42.0307C24.3558 44.5453 23.3131 45.192 21.6602 45.192Z" fill="url(#paint0_linear_1029_62398)"/>
|
||||
<svg width="81" height="80" viewBox="0 0 81 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.7305 13.2305H67.2695V66.7695H13.7305V13.2305ZM54.6588 58.1144C52.1773 58.1144 50.7743 56.8201 49.6959 55.0593L45.6073 57.4345C47.0843 60.3528 50.1029 62.5794 54.7753 62.5794C59.5538 62.5794 63.1121 60.0979 63.1121 55.5683C63.1121 51.3668 60.6986 49.498 56.4239 47.6649L55.1662 47.1261C53.0076 46.1913 52.0728 45.5803 52.0728 44.071C52.0728 42.8498 53.0068 41.915 54.4804 41.915C55.9251 41.915 56.8556 42.5243 57.7182 44.071L61.6359 41.5555C59.9788 38.6406 57.6791 37.5273 54.4804 37.5273C49.9873 37.5273 47.1124 40.3998 47.1124 44.173C47.1124 48.2691 49.5242 50.2068 53.1546 51.7534L54.4124 52.2931C56.7069 53.2967 58.0751 53.9077 58.0751 55.6329C58.0751 57.0725 56.7435 58.1144 54.6588 58.1144ZM35.1613 58.0829C33.4327 58.0829 32.7138 56.8974 31.9234 55.4952L27.8281 57.9746C29.0145 60.4854 31.3473 62.57 35.3754 62.57C39.8336 62.57 42.8879 60.199 42.8879 54.9896V37.8146H37.8569V54.9216C37.8569 57.4362 36.8142 58.0829 35.1613 58.0829Z" fill="url(#paint0_linear_1785_15055)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_1029_62398" x1="-9.88098" y1="0.339844" x2="73.784" y2="0.33984" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#429B72"/>
|
||||
<stop offset="1" stop-color="#D8FFEC" stop-opacity="0.6"/>
|
||||
<linearGradient id="paint0_linear_1785_15055" x1="13.7305" y1="66.7695" x2="67.2695" y2="13.2305" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#171717" stop-opacity="0.5"/>
|
||||
<stop offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -1,9 +1,9 @@
|
||||
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.230469 0.339844H53.7695V53.8789H0.230469V0.339844ZM41.1578 45.2235C38.6763 45.2235 37.2732 43.9292 36.1948 42.1683L32.1063 44.5436C33.5832 47.4619 36.6018 49.6885 41.2742 49.6885C46.0527 49.6885 49.611 47.207 49.611 42.6774C49.611 38.4758 47.1975 36.6071 42.9228 34.774L41.6651 34.2352C39.5065 33.3004 38.5717 32.6894 38.5717 31.1801C38.5717 29.9589 39.5057 29.0241 40.9793 29.0241C42.424 29.0241 43.3545 29.6334 44.2171 31.1801L48.1348 28.6646C46.4777 25.7497 44.178 24.6364 40.9793 24.6364C36.4863 24.6364 33.6113 27.5088 33.6113 31.2821C33.6113 35.3782 36.0231 37.3158 39.6536 38.8625L40.9113 39.4022C43.2058 40.4058 44.5741 41.0168 44.5741 42.742C44.5741 44.1816 43.2424 45.2235 41.1578 45.2235ZM21.6602 45.192C19.9316 45.192 19.2127 44.0065 18.4223 42.6043L14.327 45.0837C15.5134 47.5945 17.8462 49.6791 21.8743 49.6791C26.3325 49.6791 29.3868 47.3081 29.3868 42.0987V24.9237H24.3558V42.0307C24.3558 44.5453 23.3131 45.192 21.6602 45.192Z" fill="url(#paint0_linear_1029_62398)"/>
|
||||
<svg width="81" height="80" viewBox="0 0 81 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.7305 13.2305H67.2695V66.7695H13.7305V13.2305ZM54.6588 58.1144C52.1773 58.1144 50.7743 56.8201 49.6959 55.0593L45.6073 57.4345C47.0843 60.3528 50.1029 62.5794 54.7753 62.5794C59.5538 62.5794 63.1121 60.0979 63.1121 55.5683C63.1121 51.3668 60.6986 49.498 56.4239 47.6649L55.1662 47.1261C53.0076 46.1913 52.0728 45.5803 52.0728 44.071C52.0728 42.8498 53.0068 41.915 54.4804 41.915C55.9251 41.915 56.8556 42.5243 57.7182 44.071L61.6359 41.5555C59.9788 38.6406 57.6791 37.5273 54.4804 37.5273C49.9873 37.5273 47.1124 40.3998 47.1124 44.173C47.1124 48.2691 49.5242 50.2068 53.1546 51.7534L54.4124 52.2931C56.7069 53.2967 58.0751 53.9077 58.0751 55.6329C58.0751 57.0725 56.7435 58.1144 54.6588 58.1144ZM35.1613 58.0829C33.4327 58.0829 32.7138 56.8974 31.9234 55.4952L27.8281 57.9746C29.0145 60.4854 31.3473 62.57 35.3754 62.57C39.8336 62.57 42.8879 60.199 42.8879 54.9896V37.8146H37.8569V54.9216C37.8569 57.4362 36.8142 58.0829 35.1613 58.0829Z" fill="url(#paint0_linear_1785_15055)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_1029_62398" x1="-9.88098" y1="0.339844" x2="73.784" y2="0.33984" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#F4FFFA"/>
|
||||
<stop offset="1" stop-color="#D8FFEC" stop-opacity="0.6"/>
|
||||
<linearGradient id="paint0_linear_1785_15055" x1="13.7305" y1="66.7695" x2="67.2695" y2="13.2305" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#EDEDED" stop-opacity="0.5"/>
|
||||
<stop offset="1" stop-color="white"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,9 @@
|
||||
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.7668 10.4216C34.8343 10.0558 37.1841 9.84591 39.6447 9.83448C42.1052 9.82305 44.6707 10.01 47.1433 10.4216C51.0493 11.0726 54.3399 14.0028 54.3399 17.9034V31.6089C54.3399 35.628 51.1452 38.923 47.1433 38.923H32.7668C27.8856 38.923 23.7752 43.1136 23.7752 47.8643V54.4403H18.8264C14.6433 54.4403 12.2 51.4041 11.1768 47.143C9.79667 41.4184 9.85529 37.9973 11.1768 32.5148C12.3225 27.7318 15.9853 25.2175 20.1684 25.2175H25.5701H39.9634V23.389H25.5701V17.9034C25.5701 13.7499 26.676 11.4977 32.7668 10.4216ZM34.5617 16.9976C34.5617 15.4804 33.3476 14.2464 31.8609 14.2464C30.3688 14.2464 29.1601 15.4804 29.1601 16.9976C29.1601 18.5094 30.3688 19.732 31.8609 19.732C33.3476 19.732 34.5617 18.5094 34.5617 16.9976ZM56.1348 31.6092V25.2178H61.5365C65.7249 25.2178 67.6994 28.3508 68.7332 32.5151C70.1719 38.2988 70.2359 42.6346 68.7332 47.1432C67.2784 51.5227 65.7196 54.4405 61.5365 54.4405H54.3399H39.9634V56.269H54.3399V61.7546C54.3399 65.9081 50.7668 68.0195 47.1432 69.0687C41.6919 70.6505 37.3228 70.4083 32.7667 69.0687C28.962 67.9496 25.5701 65.6553 25.5701 61.7546V48.0491C25.5701 44.1054 28.8287 40.735 32.7667 40.735H47.1432C51.9338 40.735 56.1348 36.5644 56.1348 31.6092ZM50.7499 62.6605C50.7499 61.1486 49.5412 59.9261 48.0491 59.9261C46.5624 59.9261 45.3483 61.1486 45.3483 62.6605C45.3483 64.1777 46.5624 65.4116 48.0491 65.4116C49.5412 65.4116 50.7499 64.1777 50.7499 62.6605Z" fill="url(#paint0_linear_1785_15271)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_1785_15271" x1="10.1636" y1="70.1661" x2="70.492" y2="10.4969" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#171717" stop-opacity="0.5"/>
|
||||
<stop offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
9
apps/docs/public/img/icons/menu/reference-python.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.7668 10.4216C34.8343 10.0558 37.1841 9.84591 39.6447 9.83448C42.1052 9.82305 44.6707 10.01 47.1433 10.4216C51.0493 11.0726 54.3399 14.0028 54.3399 17.9034V31.6089C54.3399 35.628 51.1452 38.923 47.1433 38.923H32.7668C27.8856 38.923 23.7752 43.1136 23.7752 47.8643V54.4403H18.8264C14.6433 54.4403 12.2 51.4041 11.1768 47.143C9.79667 41.4184 9.85529 37.9973 11.1768 32.5148C12.3225 27.7318 15.9853 25.2175 20.1684 25.2175H25.5701H39.9634V23.389H25.5701V17.9034C25.5701 13.7499 26.676 11.4977 32.7668 10.4216ZM34.5617 16.9976C34.5617 15.4804 33.3476 14.2464 31.8609 14.2464C30.3688 14.2464 29.1601 15.4804 29.1601 16.9976C29.1601 18.5094 30.3688 19.732 31.8609 19.732C33.3476 19.732 34.5617 18.5094 34.5617 16.9976ZM56.1348 31.6092V25.2178H61.5365C65.7249 25.2178 67.6994 28.3508 68.7332 32.5151C70.1719 38.2988 70.2359 42.6346 68.7332 47.1432C67.2784 51.5227 65.7196 54.4405 61.5365 54.4405H54.3399H39.9634V56.269H54.3399V61.7546C54.3399 65.9081 50.7668 68.0195 47.1432 69.0687C41.6919 70.6505 37.3228 70.4083 32.7667 69.0687C28.962 67.9496 25.5701 65.6553 25.5701 61.7546V48.0491C25.5701 44.1054 28.8287 40.735 32.7667 40.735H47.1432C51.9338 40.735 56.1348 36.5644 56.1348 31.6092ZM50.7499 62.6605C50.7499 61.1486 49.5412 59.9261 48.0491 59.9261C46.5624 59.9261 45.3483 61.1486 45.3483 62.6605C45.3483 64.1777 46.5624 65.4116 48.0491 65.4116C49.5412 65.4116 50.7499 64.1777 50.7499 62.6605Z" fill="url(#paint0_linear_1785_15271)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_1785_15271" x1="10.1636" y1="70.1661" x2="70.492" y2="10.4969" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#EDEDED" stop-opacity="0.5"/>
|
||||
<stop offset="1" stop-color="white"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -9,7 +9,8 @@
|
||||
"title": "Installing",
|
||||
"id": "installing",
|
||||
"slug": "installing",
|
||||
"type": "markdown"
|
||||
"type": "markdown",
|
||||
"excludes": ["reference_javascript_v1", "reference_dart_v0", "reference_python_v2"]
|
||||
},
|
||||
{
|
||||
"title": "Initializing",
|
||||
@@ -21,13 +22,20 @@
|
||||
"title": "Typescript Support",
|
||||
"id": "typescript-support",
|
||||
"slug": "typescript-support",
|
||||
"type": "markdown"
|
||||
"type": "markdown",
|
||||
"excludes": [
|
||||
"reference_javascript_v1",
|
||||
"reference_dart_v0",
|
||||
"reference_dart_v1",
|
||||
"reference_python_v2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Upgrade guide",
|
||||
"id": "upgrade-guide",
|
||||
"slug": "upgrade-guide",
|
||||
"type": "markdown"
|
||||
"type": "markdown",
|
||||
"excludes": ["reference_javascript_v2", "reference_dart_v1", "reference_python_v2"]
|
||||
},
|
||||
{
|
||||
"title": "Database",
|
||||
|
||||
401
spec/supabase_py_v2.yml
Normal file
@@ -0,0 +1,401 @@
|
||||
openref: 0.1
|
||||
|
||||
info:
|
||||
id: reference/supabase-py
|
||||
title: Supabase Client
|
||||
description: |
|
||||
|
||||
Supabase Python(Community).
|
||||
|
||||
definition: ../../spec/enrichments/tsdoc_v2/combined.json
|
||||
specUrl: https://github.com/supabase/supabase/edit/master/spec/supabase_py_v2.yml
|
||||
slugPrefix: '/'
|
||||
libraries:
|
||||
- name: 'Python'
|
||||
id: 'py'
|
||||
version: '0.0.1'
|
||||
|
||||
functions:
|
||||
- id: initializing
|
||||
$ref: '@supabase/supabase-js.index.SupabaseClient.constructor'
|
||||
description: |
|
||||
You can initialize a new Supabase client using the `create_client()` method.
|
||||
|
||||
The Supabase client is your entrypoint to the rest of the Supabase functionality
|
||||
and is the easiest way to interact with everything we offer within the Supabase ecosystem.
|
||||
|
||||
examples:
|
||||
- id: create-client
|
||||
name: create_client()
|
||||
code: |
|
||||
```
|
||||
import os
|
||||
from supabase import create_client, Client
|
||||
|
||||
url: str = os.environ.get("SUPABASE_URL")
|
||||
key: str = os.environ.get("SUPABASE_KEY")
|
||||
supabase: Client = create_client(url, key)
|
||||
```
|
||||
- id: with-timeout-option
|
||||
name: With timeout option
|
||||
code: |
|
||||
```
|
||||
import os
|
||||
from supabase import create_client, Client
|
||||
|
||||
url: str = os.environ.get("SUPABASE_URL")
|
||||
key: str = os.environ.get("SUPABASE_KEY")
|
||||
supabase: Client = create_client(url, key, options={'timeout': 10})
|
||||
```
|
||||
|
||||
- id: sign-up
|
||||
title: 'sign_up()'
|
||||
$ref: '@supabase/gotrue-js.GoTrueClient.signUp'
|
||||
notes: |
|
||||
- By default, the user needs to verify their email address before logging in. To turn this off, disable **Confirm email** in [your project](https://app.supabase.com/project/_/auth/providers).
|
||||
- **Confirm email** determines if users need to confirm their email address after signing up.
|
||||
- If **Confirm email** is enabled, a `user` is returned but `session` is null.
|
||||
- If **Confirm email** is disabled, both a `user` and a `session` are returned.
|
||||
- By default, when the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url). You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://app.supabase.com/project/_/auth/url-configuration).
|
||||
- If signUp() is called for an existing confirmed user:
|
||||
- If **Confirm email** is enabled in [your project](https://app.supabase.com/project/_/auth/providers), an obfuscated/fake user object is returned.
|
||||
- If **Confirm email** is disabled, the error message, `User already registered` is returned.
|
||||
- To fetch the currently logged-in user, refer to [`getUser()`](/docs/reference/javascript/auth-getuser).
|
||||
examples:
|
||||
- id: signup
|
||||
name: Sign up
|
||||
code: |
|
||||
```
|
||||
res = supabase.auth.signUp({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
```
|
||||
- id: sign-up-with-additional-user-metadata
|
||||
name: Sign up with additional user metadata
|
||||
code: |
|
||||
```
|
||||
res = supabase.auth.signUp({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
options: {
|
||||
data: {
|
||||
first_name: 'John',
|
||||
age: 27,
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
- id: sign-out
|
||||
title: 'sign_out()'
|
||||
$ref: '@supabase/gotrue-js.GoTrueClient.signOut'
|
||||
notes: |
|
||||
- In order to use the `signOut()` method, the user needs to be signed in first.
|
||||
examples:
|
||||
- id: sign-out
|
||||
name: Sign out
|
||||
code: |
|
||||
```
|
||||
res = supabase.auth.sign_out()
|
||||
```
|
||||
- id: verify-otp
|
||||
title: 'verify_otp()'
|
||||
$ref: '@supabase/gotrue-js.GoTrueClient.verifyOtp'
|
||||
notes: |
|
||||
- The `verifyOtp` method takes in different verification types. If a phone number is used, the type can either be `sms` or `phone_change`. If an email address is used, the type can be one of the following: `signup`, `magiclink`, `recovery`, `invite` or `email_change`.
|
||||
- The verification type used should be determined based on the corresponding auth method called before `verifyOtp` to sign up / sign-in a user.
|
||||
examples:
|
||||
- id: verify-sms-one-time-password
|
||||
name: Verify SMS One-Time Password (OTP)
|
||||
code: |
|
||||
```
|
||||
res = supabase.auth.verify_otp(phone, token)
|
||||
```
|
||||
|
||||
- id: get-session
|
||||
title: 'get_session_from_url'
|
||||
$ref: '@supabase/gotrue-js.GoTrueClient.getSession'
|
||||
examples:
|
||||
- id: get-session
|
||||
name: Get the session data from URL
|
||||
code: |
|
||||
```
|
||||
res = supabase.auth.get_session_from_url(url)
|
||||
```
|
||||
|
||||
- id: set-session
|
||||
title: 'set_session()'
|
||||
$ref: '@supabase/gotrue-js.GoTrueClient.setSession'
|
||||
notes: |
|
||||
- `setSession()` takes in a refresh token and uses it to get a new session.
|
||||
- The refresh token can only be used once to obtain a new session.
|
||||
- [Refresh token rotation](/docs/reference/auth/config#refresh_token_rotation_enabled) is enabled by default on all projects to guard against replay attacks.
|
||||
- You can configure the [`REFRESH_TOKEN_REUSE_INTERVAL`](https://supabase.com/docs/reference/auth/config#refresh_token_reuse_interval) which provides a short window in which the same refresh token can be used multiple times in the event of concurrency or offline issues.
|
||||
- If you are using React Native, you will need to install a Buffer polyfill via a library such as [rn-nodeify](https://github.com/tradle/rn-nodeify) to properly use the library.
|
||||
examples:
|
||||
- id: set-session
|
||||
name: Refresh the session
|
||||
description: Sets the session data from refresh_token and returns current session or an error if the refresh_token is invalid.
|
||||
code: |
|
||||
```
|
||||
res = supabase.auth.set_session(refresh_token)
|
||||
```
|
||||
- id: refresh-session
|
||||
title: 'refresh_ession()'
|
||||
$ref: '@supabase/gotrue-js.GoTrueClient.refreshSession'
|
||||
notes: |
|
||||
- This method will refresh the session whether the current one is expired or not.
|
||||
- Both examples destructure `user` and `session` from `data`. This is not required; so `const { data, error } =` is also valid.
|
||||
examples:
|
||||
- id: refresh-session
|
||||
name: Refresh session using the current session
|
||||
code: |
|
||||
```
|
||||
res = supabase.auth.refresh_session()
|
||||
```
|
||||
- id: select
|
||||
title: 'Fetch data: select()'
|
||||
$ref: '@supabase/postgrest-js.PostgrestQueryBuilder.select'
|
||||
notes: |
|
||||
- By default, Supabase projects return a maximum of 1,000 rows. This setting can be changed in your project's [API settings](https://app.supabase.com/project/_/settings/api). It's recommended that you keep it low to limit the payload size of accidental or malicious requests.
|
||||
- `apikey` is a reserved keyword if you're using the [Supabase Platform](/docs/guides/platform) and [should be avoided as a column name](https://github.com/supabase/supabase/issues/5465).
|
||||
examples:
|
||||
- id: getting-your-data
|
||||
name: Getting your data
|
||||
code: |
|
||||
```
|
||||
r = supabase
|
||||
.from('countries')
|
||||
.select("*")
|
||||
```
|
||||
- id: selecting-specific-columns
|
||||
name: Selecting specific columns
|
||||
code: |
|
||||
```
|
||||
r = await supabase
|
||||
.from('countries')
|
||||
.select('name')
|
||||
```
|
||||
|
||||
- id: invoke
|
||||
title: 'invoke()'
|
||||
description: |
|
||||
Invoke a Supabase Function.
|
||||
$ref: '@supabase/functions-js.F'
|
||||
notes: |
|
||||
- Requires an Authorization header.
|
||||
- When you pass in a body to your function, we automatically attach the Content-Type header for `Blob`, `ArrayBuffer`, `File`, `FormData` and `String`. If it doesn't match any of these types we assume the payload is `json`, serialise it and attach the `Content-Type` header as `application/json`. You can override this behaviour by passing in a `Content-Type` header of your own.
|
||||
examples:
|
||||
- id: invoke-function
|
||||
name: Basic invocation
|
||||
description:
|
||||
code: |
|
||||
```
|
||||
func = supabase.functions()
|
||||
@asyncio.coroutine
|
||||
async def test_func(loop):
|
||||
resp = await func.invoke("hello-world",invoke_options={'body':{}})
|
||||
return resp
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
resp = loop.run_until_complete(test_func(loop))
|
||||
loop.close()
|
||||
```
|
||||
|
||||
- id: list-buckets
|
||||
title: 'list_buckets()'
|
||||
$ref: '@supabase/storage-js.packages/StorageBucketApi.default.listBuckets'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: `select`
|
||||
- `objects` table permissions: none
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: list-buckets
|
||||
name: List buckets
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().list_buckets()
|
||||
```
|
||||
|
||||
- id: get-bucket
|
||||
title: 'get_bucket()'
|
||||
$ref: '@supabase/storage-js.packages/StorageBucketApi.default.getBucket'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: `select`
|
||||
- `objects` table permissions: none
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: get-bucket
|
||||
name: Get bucket
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().get_bucket(name)
|
||||
```
|
||||
|
||||
- id: create-bucket
|
||||
title: 'create_bucket()'
|
||||
$ref: '@supabase/storage-js.packages/StorageBucketApi.default.createBucket'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: `insert`
|
||||
- `objects` table permissions: none
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: create-bucket
|
||||
name: Create bucket
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().create_bucket(name)
|
||||
```
|
||||
|
||||
- id: empty-bucket
|
||||
title: 'empty_bucket()'
|
||||
$ref: '@supabase/storage-js.packages/StorageBucketApi.default.emptyBucket'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: `select`
|
||||
- `objects` table permissions: `select` and `delete`
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: empty-bucket
|
||||
name: Empty bucket
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().empty_bucket(name)
|
||||
```
|
||||
- id: delete-bucket
|
||||
title: 'delete_bucket()'
|
||||
$ref: '@supabase/storage-js.packages/StorageBucketApi.default.deleteBucket'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: `select` and `delete`
|
||||
- `objects` table permissions: none
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: delete-bucket
|
||||
name: Delete bucket
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().delete_bucket(name)
|
||||
```
|
||||
|
||||
- id: from-upload
|
||||
title: 'from_.upload()'
|
||||
$ref: '@supabase/storage-js.packages/StorageFileApi.default.upload'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: none
|
||||
- `objects` table permissions: `insert`
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: upload-file
|
||||
name: Upload file using filepath
|
||||
code: |
|
||||
```
|
||||
with open(source, 'rb+') as f:
|
||||
res = supabase.storage().from_('bucket').upload(destination, os.path.abspath(source))
|
||||
```
|
||||
- id: from-move
|
||||
title: 'from_.move()'
|
||||
$ref: '@supabase/storage-js.packages/StorageFileApi.default.move'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: none
|
||||
- `objects` table permissions: `update` and `select`
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: move-file
|
||||
name: Move file
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().from_(bucket).move('public/avatar1.png', 'private/avatar2.png')
|
||||
```
|
||||
|
||||
- id: from-create-signed-url
|
||||
title: 'from_.create_signed_url()'
|
||||
$ref: '@supabase/storage-js.packages/StorageFileApi.default.createSignedUrl'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: none
|
||||
- `objects` table permissions: `select`
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: create-signed-url
|
||||
name: Create Signed URL
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().from_(bucket_name).create_signed_url(filepath, expiry_duration)
|
||||
```
|
||||
|
||||
- id: from-get-public-url
|
||||
title: 'from_.get_public_url()'
|
||||
$ref: '@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl'
|
||||
notes: |
|
||||
- The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [app.supabase.com](https://app.supabase.com), clicking the overflow menu on a bucket and choosing "Make public"
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: none
|
||||
- `objects` table permissions: none
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: get-public-url
|
||||
name: Returns the URL for an asset in a public bucket
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().from_(bucket_name).get_public_url('test/avatar1.jpg')
|
||||
```
|
||||
|
||||
- id: from-download
|
||||
title: 'from_.download()'
|
||||
$ref: '@supabase/storage-js.packages/StorageFileApi.default.download'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: none
|
||||
- `objects` table permissions: `select`
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: download-file
|
||||
name: Download file
|
||||
code: |
|
||||
```
|
||||
with open(destination, 'wb+') as f:
|
||||
res = supabase.storage().from_(bucket_name).download(source)
|
||||
f.write(res)
|
||||
```
|
||||
|
||||
- id: from-remove
|
||||
title: 'from_.remove()'
|
||||
$ref: '@supabase/storage-js.packages/StorageFileApi.default.remove'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: none
|
||||
- `objects` table permissions: `delete` and `select`
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: delete-file
|
||||
name: Delete file
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().from_('test').remove('test.jpg')
|
||||
```
|
||||
- id: from-list
|
||||
title: 'from_.list()'
|
||||
$ref: '@supabase/storage-js.packages/StorageFileApi.default.list'
|
||||
notes: |
|
||||
- RLS policy permissions required:
|
||||
- `buckets` table permissions: none
|
||||
- `objects` table permissions: `select`
|
||||
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
|
||||
examples:
|
||||
- id: list-files
|
||||
name: List files in a bucket
|
||||
code: |
|
||||
```
|
||||
res = supabase.storage().from_('test').list()
|
||||
```
|
||||
- id: subscribe
|
||||
title: on().subscribe()
|
||||
$ref: '@supabase/realtime-js.RealtimeChannel.on'
|
||||
notes: |
|
||||
- We are implementing this feature at the moment. If you have queries feel free to open an issue on the [realtime-py](https://github.com/supabase-community) repository.
|
||||