bobmolgui
11/05/2022, 4:12 PMismael1234
11/05/2022, 3:25 PMgtims123
11/05/2022, 4:27 PMLeDragunov
11/05/2022, 4:55 PMnish
11/05/2022, 5:58 PMShoaib
11/05/2022, 7:51 PMKarbust
11/05/2022, 8:10 PMGOTRUE_JWT_EXP
on the default value of 3600 I don't get any error, but if I extend it to like a month (2592000) I get the error in the screenshot while loading the session on the website.
Do I need to change something else?
Doing something like this also returns the same error every single time:
ts
setInterval(async () => {
await supabase.auth.refreshSession()
}, 1000)
stefikira
11/05/2022, 8:23 PMclient!.auth.currentSession
still shows the user as logged in.Solid Snake
11/05/2022, 9:21 PM<SessionContextProvider
supabaseClient={supabaseClient}
initialSession={pageProps.initialSession}
>
<Navigationbar />
<Component {...pageProps} />
</SessionContextProvider>
navbar.js
export default function Navigationbar() {
const router = useRouter()
const session = useSession()
const currentPath = router.asPath
if (!session) {
return (
<NavbarPresentation router={router} />
)
}
else if (session)
return (
<NavbarLoggedIn router={router} />
)
}
Unknown Member
11/06/2022, 1:57 AMnako
11/06/2022, 2:58 AMxHect
11/06/2022, 3:45 AMMATTI
11/06/2022, 10:02 AMStephenBawks
11/06/2022, 12:18 PMsupabase
in my Vercel serverless function.
Seems to be failing during the build phase and pukes out an error.Aqshol Afid
11/06/2022, 12:20 PMlewisd
11/06/2022, 2:28 PMpokemon
table called document
. This column is basically a ts_query
I currently have a function which works ok like so:
...
LANGUAGE plpgsql
AS $$
begin
return query
select p.* FROM "pokemonView" p
where p.document @@ to_tsquery('english', search_query);
end
$$;
In this example, I'll use a Pokemon name as an example of what my app is currently doing.
1. Searching Bulbasaur
returns the correct rows.
2. Searching Bulbasau
returns no results.
3. Searching Bulbasaer
returns no results.
So basically I would like to have partial text search and fuzzy text search.
Does anyone know how I could amend the above function to help with this?
I have the PG_TRGM
extension enabled but also have the FUZZYSTRMATCH
extension enabled, however i don't think im utilising the latter.httpteapot
11/06/2022, 3:38 PMfetch(mySupabaseEndpoint, {method: "POST", headers, body})
. It works when I run this function locally, but not when I deploy it to a Vercel edge function.
What is weird is that :
- It's unpredictable, it works 1/4 of the time
- there is no error or exception
- I don't get result from the fetch
, it hangs indefinitely. If I await fetch(...); console.log('hello')
, the text hello
is not displayed
I'm calling other API from this same Vercel edge function with no issue. Any idea what could be the problem here?talpiven
11/06/2022, 5:47 PMselect COLUMN_NAME, data_type
from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME = 'cards'
CREATE OR REPLACE FUNCTION public.get_cards()
RETURNS TABLE(id bigint, updated_at timestamp with time zone, user_id uuid, name character varying, images_urls character varying[], description character varying, is_tradeable boolean, type smallint, favorites integer, views bigint)
LANGUAGE sql
AS $function$
select car.* , count(fav.collectible_id) as favorites, view.count as views
from cards car
join favorites fav on car.id=fav.collectible_id join views view on fav.collectible_id=view.collectible_id
where fav.collectible_type=1 and view.collectible_type=1
group by car.id , fav.collectible_id, view.count
LIMIT 20 OFFSET 0;
$function$
kingweb
11/06/2022, 6:06 PMAskar
11/06/2022, 6:49 PMconst { data: user, error } = await supabase.auth.admin.listUsers()
this always returns an empty list so not sure how to get the data after signing in
How does one have a twitter authentication just for verifying the twitter login they have without making it the main login on the site? I already have an __authentication method using Rainbowkit to sign in with Wallet__, but i just want to authenticate Twitter handle for user profile
js
import supabaseClient from "../utils/supabaseClient.js"
export default function Home(props) {
const [name, setName] = useState("Verify Twitter")
const [session, setSession] = useState(null);
const supabase = supabaseClient()
async function signInWithTwitter() {
console.log(supabase)
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'twitter',
})
console.log("data", data)
const { data: { sessionData } } = await supabase.auth.getSession();
console.log(sessionData)
}
...
in picture: not sure how to get existing data after logging in as it redirects and that data is lostkingweb
11/06/2022, 7:05 PMCody
11/06/2022, 8:15 PMsupabase gen types typescript
utility in the CLI tool. One thing I can't get to work is when I define Postgres Functions, it won't determine the return type based on the the function. For example, given this function
sql
create or replace function shifts_by_week(date timestamp default null)
returns setof shifts
as $$
select * from shifts where date_trunc('week', coalesce($1, current_date) + interval '1 day') - interval '1 day' = date_trunc('week', shifts.date + interval '1 day') - interval '1 day';
$$ language sql;
Where I'm specifying the return is setof shifts
which is a table in my schema. The generated type for this is
typescript
Functions: {
shifts_by_week: {
Args: { date: string }
Returns: unknown
}
}
I can manually update the file, sure, but it is auto-generated, so I'd rather not. And yes, I could also build a bash script that will generate the types and then mutate them at the end, but I'd rather not.kha
11/06/2022, 8:48 PMPatD
11/06/2022, 9:33 PMuseUser
to pass it custom data from another table?Deleted User
11/06/2022, 10:07 PMapi.supabase.io/platforms/...
. However, the local Nextjs API route doesn't seem to match this endpoint.
Where can I find the directory to inspect the platforms endpoint?gtims123
11/06/2022, 11:56 PM((()))
11/07/2022, 1:24 AMjs
let claim = 'claims_admin', claim_value = toString(admin);
const { error: claimErr } = await supabaseClient.rpc('set_claim', { user_id, claim_value, claim });
I am trying as code above but getting error
text
Could not find the public.set_claim(claim, claim_value, user_id) function or the public.set_claim function with a single unnamed json or jsonb parameter in the schema cache
urth
11/07/2022, 2:08 AMawait locals.supabase.rpc('set_online', {user_id: user.id, online: true});
Was delaying the API response for a simple SET call ( I was not reading anything, nor was there a reason to wait for this call to finish ).
I checked the Networks tab, saw that the API response is 200ms. Alright, what if I do this without awaiting for the call:
locals.supabase.rpc('set_online', {user_id: user.id, online: true});
Instant improvement, 60ms call. However, no change was made inside the database. What's the fix? It is:
locals.supabase.rpc('set_online', {user_id: user.id, online: true}).then(f => f)
Response is sent back in 60ms and the value is updated, which made me wonder why I had to call then(f => f) when I do nothing with the resolved promise. As I understand it, the type which is returned from:
locals.supabase.rpc('set_online', {user_id: user.id, online: true})
Is a query builder,. To my understanding, a query builder type has to be built in an async way, and after it's done with setting up the paramaters, we actually make the call ( why I have to use await or useless then ).
Questions:
1. Is my understanding of the supabase ways correct?
2. If it is, why is there a need for the query builder type to be build in an async fashion? If possible, could you point me to the code which is responsible for the query builder type to be built async?
3. Is this mentioned in the docs anywhere?
Thanks!jar
11/07/2022, 2:19 AMJingly
11/07/2022, 2:34 AM