komagata
11/21/2022, 6:59 AMMDobs
11/21/2022, 7:37 AMtherakeshpurohit
11/21/2022, 8:45 AMZebraCoder
11/21/2022, 10:08 AMskagiya
11/21/2022, 10:34 AMimport { useSupabaseClient } from '@supabase/auth-helpers-react'
import { Auth } from '@supabase/auth-ui-react'
export const LoginButton = () => {
const supabase = useSupabaseClient()
return (
<>
<Auth
supabaseClient={supabase}
providers={['discord']}
onlyThirdPartyProviders={true}
/>
</>
)
}
kouwasi
11/21/2022, 2:54 PMdb diff
.
What is the difference?
It's for compatibility with the previous version?pid1
11/21/2022, 4:33 PM// Follow this setup guide to integrate the Deno language server with your editor:
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
import { serve } from 'https://deno.land/std@0.131.0/http/server.ts';
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.0.0';
Error:
Download https://deno.land/std@0.165.0/node/internal_binding/_winerror.ts
Check file:///home/deno/functions/test/index.ts
error: TS2314 [ERROR]: Generic type 'PostgrestQueryBuilder<Schema, Relation>' requires 2 type argument(s).
at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:57:126
TS2314 [ERROR]: Generic type 'PostgrestQueryBuilder<Schema, Relation>' requires 2 type argument(s).
from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(relation: ViewName): PostgrestQueryBuilder<View>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:58:120
TS2314 [ERROR]: Generic type 'PostgrestQueryBuilder<Schema, Relation>' requires 2 type argument(s).
from(relation: string): PostgrestQueryBuilder<any>;
~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:59:29
TS2314 [ERROR]: Generic type 'PostgrestFilterBuilder<Schema, Row, Result>' requires 3 type argument(s).
at https://esm.sh/v99/@supabase/supabase-js@2.0.0/dist/module/SupabaseClient.d.ts:72:9
Found 4 errors.
2022/11/21 11:28:48 Sent Header: Host [docker]
2022/11/21 11:28:48 Sent Header: User-Agent [Go-http-client/1.1]
2022/11/21 11:28:48 Send Done
2022/11/21 11:28:48 Recv First Byte
Error: error executing command
Execution: supabase functions serve test --debug
Thank you for any help you can offer!quentin_guerrier
11/21/2022, 4:35 PMSmardrengr
11/21/2022, 6:33 PMselect
games.name AS game,
profiles.name AS organizer
from games
left join profiles on games.organizer_id = profiles.id
where games.organizer_id = 'f316de4e-e478-4ce3-842c-00e98f475870'
or games.organizer_id in (select friends.friend_id from friends where friends.user_id = 'f316de4e-e478-4ce3-842c-00e98f475870' and friends.accepted = true)
or games.id in (select players.game_id from players where players.user_id = 'f316de4e-e478-4ce3-842c-00e98f475870')
order by games.datetime asc
;
Not sure how to proceed. Like, I think I need to do a count(players.id)
and add a where
clause that matches the user id...Stephcraft
11/21/2022, 7:54 PMdatabase > Functions
tab with a different schema?
1. The two helper functions that I need:
storage.filename(...)
that returns only the filename without the extension: avatar
instead of avatar.png
2. storage.folderpath(...)
that returns the string path of the folders folder/again/here/
instead of an array of folders [ 'folder', 'again', 'here' ]
Thank youLordZardeck
11/21/2022, 8:30 PMts
const { data, error } = await supabaseClient
.from('costs')
.select('id, title, unit:unit_type_id(name), created_at, updated_at, price_per_unit')
.eq('category_id', categoryId)
Which results in the following type:
ts
const data:
| ({ id: string } & { title: string } & {
unit: { name: unknown } | { name: unknown }[] | null
} & { created_at: string } & { updated_at: string } & { price_per_unit: unknown })[]
| null
As you can see, the unit
join has incorrect property type of unknown
, according to Supabase generated types, it should be string | null
How can this be fixed?
On another, note, unit
shouldn't be able to be an array. Supabase apparently doesn't recognize the join table at all, and that might be the root of the issueKen
11/21/2022, 8:59 PMfloyare
11/21/2022, 9:24 PMis_banned
row from user's profile from profiles table It would hide his posts that are connected by his uuid with images table. Now I want to make something like deletion his profile and posts from database after 7 days. Is it even possible? I know maybe database triggers with functions may do a trick but I'm not sure. Any ideas?Zarkex
11/21/2022, 9:56 PMmattrasto
11/21/2022, 10:03 PMsupabase link --project-ref hnewgu...vnszyprt --password <DB-PASS>
Error: failed to connect to `host=db.hnewgu...vnszyprt.supabase.co user=postgres database=postgres`: dial error (dial tcp 127.0.0.1:6543: connectex: No connection could be made because the target machine actively refused it.)
Try rerunning the command with --debug to troubleshoot the error.
Steps from start to finish:
1. Created a new project in Supabase web UI
2. Installed the CLI fresh (Windows, so using scoop)
3. Logged in using access token
4. supabase init
5. supabase start
6. supabase link
(see above)
Project ref is the same from Supabase project's URL and DB settings, and also tried with the associated output from supabase projects list
.
I'm certain I'm using the correct password, as I've used it to connect via DBeaver. I tried resetting the password as well; no beans.
Am I missing something, or is this a bug?amitmirgal
11/21/2022, 11:12 PMimport { RealtimeClient } from '@supabase/realtime-js'
const socket = new RealtimeClient(
'wss://<project-ref-id>.supabase.co/realtime/v1'
)
socket.connect()
const channel = socket.channel('public:user')
channel.on(
'postgres_changes',
{ event: '*', schema: 'public', table: 'user' },
(e) => console.log('payload ', e)
)
channel.subscribe()
srb
11/22/2022, 2:57 AMKrisGunnars
11/22/2022, 6:12 AMMartin INDIE MAKERS
11/22/2022, 7:51 AMbennypc
11/22/2022, 8:57 AMcbunge3
11/22/2022, 1:16 PMjopfre
11/22/2022, 3:51 PMerror=unauthorized_client&error_code=401&error_description=email+link+is+invalid+or+has+expired
in the url
Anyone have a fix for this? I am wondering if its because I haven't set up the custom domain yet and emails are coming from mail.app.supabase.io?
I am currently working on using OTP verification as a fallback but it would be good to get this working without, for better UX.The Little Cousin
11/22/2022, 4:42 PMindex.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Workshops</title>
<script type="module" src="./main.js"></script>
</head>
<body>
</body>
</html>
and main.js
import { createClient } from "https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2";
const SUPABASE_URL = "";
const SUPABASE_KEY = "";
// Create a single supabase client for interacting with your database
const supabase = createClient(SUPABASE_URL, SUPABASE_KEY);
// Code here waits to run until the DOM is loaded.
const getWorkshops = async () => {
try {
let { data: workshops } = await supabase
.from('workshops')
.select('*');
return workshops
} catch (error) {
console.log(`500 Internal Server Error. err: ${error}`);
}
}
console.log(getWorkshops);
All files in the root directory.
Getting the following error in the console;
Uncaught SyntaxError: ambiguous indirect export: createClient
Can anybody please help me? 🙏uneatenauthor
11/22/2022, 4:58 PMSiddharth
11/22/2022, 6:46 PMaarku
11/22/2022, 8:04 PMAl Mo
11/22/2022, 9:33 PMcaseycrogers
11/22/2022, 10:33 PMbartolomeurodrigues
11/22/2022, 10:48 PMVengeance
11/22/2022, 11:17 PM