NicoY
12/21/2022, 6:02 AMsaadsiddiqui7
12/21/2022, 6:44 AMgaIaxy
12/21/2022, 9:12 AMElon Salfati
12/21/2022, 9:25 AMak4zh
12/21/2022, 11:02 AMsupabase link
suggests to change major_version to 15.
Error: Remote database Postgres version 15 is incompatible with db.major_version 14. If you are setting up a fresh Supabase CLI project, try changing db.major_version in supabase/config.toml to 15.
When you change it to 15 it says 15 is invalid version.
Error Failed reading config Invalid db.major_version 15.
Delfini
12/21/2022, 11:12 AMak4zh
12/21/2022, 11:36 AMbash
Bundling create-stripe-customer
Error: Error bundling function: exit status 1
file:///src/import_map.json
file:///src/index.ts
error: Uncaught (in promise) Error: Relative import path "http" not prefixed with / or ./ or ../ and not in import map from "https://esm.sh/v99/@types/node@16.18.3/http.d.ts"
const ret = new Error(getStringFromWasm0(arg0, arg1));
^
at __wbg_new_8d2af00bc1e329ee (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:312:19)
at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:79439)
at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1388039)
at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1862894)
at __wbg_adapter_18 (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:146:6)
at real (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:130:14)
Try rerunning the command with --debug to troubleshoot the error.
iStun4Fun
12/21/2022, 12:10 PMexport function tracklistOfRelease(stringId) {
return useQuery(
["tracks", { stringId }],
() =>
supabase
.from("tracks")
.select()
.innerJoin('releases', 'releases.string_id', 'tracks.string_id')
.eq('releases.string_id', stringId)
.order("createdAt", { ascending: false })
.then(handle)
);
}
What can may be wrong here?Makne
12/21/2022, 12:20 PMizurugi
12/21/2022, 12:35 PMSentry
12/21/2022, 1:04 PMjavascript
const { error } = await supabase
('sites')
.update({ 'settings->enable_customevents': toggle })
.eq('id', currentSite.id)
Example doesnt work, but is a good example of what I'm trying to do, updating a single entry of a JSON object without disturbing the others.
Is this possible? Firebase handles it really nicely by using settings.enable_customevents
CheapSmokes
12/21/2022, 1:12 PMlake_mattiato
12/21/2022, 1:52 PMjs
let buttons = {
'connected': false,
'pending': false,
'nothing': true,
'accept_or_decline': false
}
and i have to change the values in this object depending on the results of a query.
so i have the following block of code:
js
console.log(buttons)
console.log('Before the if statement')
if (response.is_accepted === true) {
console.log('is_accepted == true')
buttons.connected = true
buttons.nothing = false
} else if (response.is_accepted === false){
console.log('is_accepted == false')
buttons.pending = true
buttons.nothing = false
}
console.log(buttons)
console.log('After the if statement')
Which should only set the connected key or pending key to true. This works when i deploy the function and call it for the first time.
But every other time it somehow sets both of them to true.
Any idea why?
PS: Also when i check the log the buttons object is changed even before the if statement is executedlake_mattiato
12/21/2022, 3:26 PMsql
CREATE or REPLACE function get_list_of_connected_users(user_id uuid)
RETURNS users_data
AS
$func$
SELECT * FROM users_data
WHERE id
IN
(
SELECT target_id as id FROM connections
WHERE
source_id = $1
AND is_accepted = true
UNION
SELECT source_id as id FROM connections
WHERE
target_id = $1
AND is_accepted = true
)
$func$
language sql;
but when calling the function i only get one result.
However when i execute this
sql
SELECT * FROM users_data
WHERE id
IN
(
SELECT target_id as id FROM connections
WHERE
source_id = 'some_uuid'
AND is_accepted = true
UNION
SELECT source_id as id FROM connections
WHERE
target_id = 'some_uuid'
AND is_accepted = true
)
i get 3 results
I test the function like this
sql
select * from get_list_of_connected_users('some_uuid')
Florian
12/21/2022, 4:18 PMcsmithxc
12/21/2022, 4:19 PMsupabase-js
can generate a redirect url and have seen the guide, but it's a bit suboptimal for me.
It makes sense that Supabase would use a redirect url here, but I would much rather directly use the native Apple sign-in popup than have to redirect the user through a web url.
My current idea:
1. User signs in with Apple through Expo AppleAuthentication
2. I pass the credential result to a Supabase edge function
3. The edge function uses the user email and some identifying part of the jwt token as a password
So basically this is a thin veil over an email/pass sign in. I'm aware this is hacky though, and am concerned about security implications.
Has anyone figured out how to use Supabase auth with Apple signin, without having to go through the redirect url? Ideally I'm looking to use a combination of this Expo module (https://docs.expo.dev/versions/latest/sdk/apple-authentication/#appleauthenticationcredentialstate) and a supabase-js
method.happy-sean
12/21/2022, 4:26 PMprovider_token
after the user authenticates to gitlab... if the user logout then login again (using email and password), the provider_token
is null
...
As a temporary fix what I do is to re-authenticate the user every-time they try to access features that access gitlab REST API...
I reauthenticate them using supabase.auth.signInWithOAuth()
goldyman
12/21/2022, 5:17 PMIllia
12/21/2022, 6:07 PMBralz
12/21/2022, 6:20 PMxvvvyz
12/21/2022, 6:51 PMjavascript
const { data } = await supabase.rpc(
'upsert_subject_with_observations',
// ...
);
// Property 'id' does not exist on type 'string[]'.
console.log(data?.id);
Function signature looks like this:
sql
public.upsert_subject_with_observations(
in observation_ids uuid[],
in subject subjects,
out id uuid)
deviloversaad
12/21/2022, 7:06 PMTableA
and on the INSERT
event I want to trigger a DB function which will insert
a new column in TableB
but I need to save the invoker id
in that column along with the new.id
of the TableA
column.
I can do it with function hooks too but I was just wondering if it's possible with functions only 🤔 - LMK please if it's possible like some magic auth.id
🥲 variable.
Thanks. ❣️ #1006358244786196510mlc
12/21/2022, 7:09 PMmatt-j-stevenson
12/21/2022, 8:02 PMThomas.
12/21/2022, 8:45 PM@supabase/auth-helpers-nextjs
package for my Next.js project and as i see, it does not completely works because i'm logged in as i can see my informations and access protected places, but i cannot insert new data.... any idea?jopfre
12/21/2022, 9:22 PM[{}]
. `'{}'::jsonb[]`just gives an empty array, and I have tried multiple permutations of {}
and ''
nested in different ways but nothing seems to be working. Any ideas?Kris Niles
12/21/2022, 11:40 PMjoin
, but I just can't get it to work. Here are the details:
Table 1: user_details
This table contains my user's details, and has two important columns:
`id`: This column contains the auth.uid()
for the user.
`token`: this is a "friendly" token that is unique to each user. Example: JON-123
. The user includes this token when saving a highlight to their account, because the endpoint they save through is not authenticated.
This table has a simple RLS Policy for update and select, which is: (auth.uid() = id)
Table 2: `highlights`:
This table contains all highlights submitted by all users. It has several columns:
`token`: This is the same value as the token
column above.
`highlight_text`: text of the highlight..
`highlight_url`: url of the highlight..
and a few more columns..
This table currently has no RLS policies - and I need to make one for it, that will allow users to see only their own highlights - i.e. only rows with their token.
Essentially, I need to get the token
for the current user from the user_details
table, and then only return rows from highlights
table that have a matching value in the token
column.
It seems like this would be a simple join of the user_details
table with the highlights
table, but everything I tried returns zero results. Here's my most recent try (which returns zero rows):
( auth.uid() IN ( SELECT user_details.id AS uuid
FROM (highlights JOIN user_details ON ((user_details.token) = (highlights.token)))))
I'm not sure what I'm doing wrong - any help would be greatly appreciated!yxgen4
12/22/2022, 12:14 AMDrip
12/22/2022, 12:18 AMgaryaustin
12/22/2022, 1:39 AM.in
like you show is the way.