Max52
08/22/2022, 1:36 PMauth.users
. So maybe I could call my api from there?
Since supabase sends a confirmation email instead of a sign in email on a user creation (even when using signIn()
), could I do something with that?raae (queen.raae.codes)
08/22/2022, 2:25 PM(node:9) UnhandledPromiseRejectionWarning: TypeError: Right-hand side of 'instanceof' is not an object at /tmp/55fe830c-c9b9-5321-be71-95aa92bd9b63/index.js:18036:17 at Generator.next () at fulfilled (/tmp/55fe830c-c9b9-5321-be71-95aa92bd9b63/index.js:18025:58) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:95:5)
16:16:13 PM:
(node:9) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 28)
Max52
08/22/2022, 3:25 PMcourse_id
column in this table. There is however a thread_id
which further references course_id
. How can I make something like the following policy work?
sql
(is_admin(uid()) OR has_course(thread_id.course_id, uid()))
Carter
08/22/2022, 3:27 PMDeleted User
08/22/2022, 4:31 PMa
which is exposed. It has a table called a
(a.a
) which has rls enabled using alter table a.a enable row level security;
and allowing select operations using CREATE POLICY "view a"
ON a.a
FOR SELECT USING (
true
);
. Upon using ilike
with supabase-js, I get permission denied for table a
. Am I missing something here?madsbuch
08/22/2022, 4:37 PMconfig.toml
file at least contains the entries of a newly generated file.theprosecution
08/22/2022, 5:01 PManderjaska
08/22/2022, 5:07 PMRelisora
08/22/2022, 5:14 PMbattle
, teams
and user
. They are linked to each other in this order, but battle
does not have a direct relation with user
.
I want to query every user
that has at least one battle that is public. For this I have battle.public IS TRUE
.
How do I join user
and battle
with supabase-js?
Here is a code example of my (failed) attempt:
js
const { data: users } = await this.$supabase
.from('user')
.select('id, name, team:inner(battle:inner(*))')
.eq('battle.public', 'true')
Does anyone know?Village
08/22/2022, 5:38 PMDeadlyDev
08/22/2022, 5:58 PMvramana
08/22/2022, 9:27 PMdocker-compose -f docker-compose.dev.yml
- Run the node-js
example
- Add some inserts in to users
table that created and I don't see any real time updates being pushed.
I tried to drop publication and recreate it. I don't have any luck so far.sergiofra98
08/22/2022, 10:17 PMVik
08/22/2022, 11:14 PMdaviscup
08/23/2022, 5:40 AM2022-08-23T05:30:11.864679+00:00 app[web.1]: /app/node_modules/@supabase/supabase-js/dist/main/SupabaseClient.js:51
2022-08-23T05:30:11.864681+00:00 app[web.1]: throw new Error('supabaseUrl is required.');
2022-08-23T05:30:11.864682+00:00 app[web.1]: ^
2022-08-23T05:30:11.864682+00:00 app[web.1]:
2022-08-23T05:30:11.864682+00:00 app[web.1]: Error: supabaseUrl is required.
On my local machine, everything works fine. I'm using
const { createClient } = require('@supabase/supabase-js')
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_SERVICE_KEY)
in my server to perform db queries as described in the documentation. The env variables seem to be configured correctly in my .env otherwise it wouldn't work locally.
What could be the problem here?Zed
08/23/2022, 11:00 AMselect first_name, last_name, schedule as "Thursday" from "Employees" where schedule#>'{4}' is not null
Sample Record:
First_Name | Last_Name | Schedule
John | Doe | {"4":[8,9]}
I've tried:
supabaseClient.from('Employees') .select('first_name,last_name,schedule')
.not('schedule#>{4}', 'is', null)
supabaseClient.from('Employees') .select('first_name,last_name,schedule')
.not('schedule->>4', 'is', null)
but it's either: returning nothing or returning more than expected.
Am I missing anything?wiesson
08/23/2022, 11:58 AMposts (id, title)
post_tag (post_id, tag_id)
tags(id, title)
And I'd like to get all posts that have n tags. An or filter works fine, but I'm looking for an AND
My query looks like
supabase
.from<Post>("posts")
.select(*, filterTags:tags!inner(id), tags(*))
STILLWATER;
08/23/2022, 1:14 PMsql
order by (SP.target_impressions-SP.served_impressions) desc, updated_at desc
Abend
08/23/2022, 1:39 PMTARS
08/23/2022, 1:56 PMpedrodiaz
08/23/2022, 1:58 PMrefresh token
is invalid, but how?MrGandalfAndhi
08/23/2022, 2:05 PMstukennedy
08/23/2022, 2:55 PMonAuthStateChange
and handle all the cases ... and would also mean it doesn't get triggered everytime I move away from the tab and back again (which annoyingly forces a refreshed signin)maija
08/23/2022, 3:54 PMimport { createClient } from '@supabase/supabase-js'
import AsyncStorage from '@react-native-async-storage/async-storage'
import { API_ANON_KEY, API_BASE_URL, REST_API_PATH } from '../constants/Api'
const supabaseUrl = `${API_BASE_URL}${REST_API_PATH}`
const supabaseKey = API_ANON_KEY
const supabase = createClient(supabaseUrl, supabaseKey, {
localStorage: AsyncStorage,
})
let { user, error } = await supabase.auth.signUp({
email: 'someone@email.com',
password: 'CFWSEubppfanYfvhXYSo'
})
What I get in response is a 404 with an empty object. This I can also see in the API logs. Has anyone here an idea what I am doing wrong? Would be very much appreciated! 🙏 Thank you in advance!W7T2A
08/23/2022, 3:56 PMQueaxtra
08/23/2022, 4:30 PMhttps://i.imgur.com/HdJfdic.png▾
donocode
08/23/2022, 5:10 PMsql
CREATE OR REPLACE FUNCTION aggregated_track_analytics(_activity_type text, _user_id uuid)
RETURNS SETOF (track_id text, user_id uuid, activity_type text, play_count int, last_played_date timestamp, distance numeric, ascent numeric, descent numeric)
AS $$
SELECT
t.track_id,
CASE WHEN _user_id IS NULL THEN NULL ELSE t.user_id END AS user_id,
CASE WHEN _activity_type IS NULL THEN NULL ELSE a."type" END as activity_type,
COUNT(t.id) as play_count,
MAX(t.last_played_date) as last_played_date,
SUM(t.distance) as distance,
SUM(t.ascent) as ascent,
SUM(t.descent) as descent
FROM track_analytics t
INNER JOIN activities a on a.id = t.activity_id
WHERE t.distance > 0
AND (_user_id IS NULL OR t.user_id = _user_id)
AND (_activity_type IS NULL OR a."type" = _activity_type)
GROUP BY activity_type, t.user_id, track_id;
$$ LANGUAGE sql;
t.track_id has a relationship to the tracks table that I want to join to but I am guessing because the function returns TABLE instead of SETOF track_analytics that the join errors from the supabase client.
Is there any way to make it so this works?
ts
this._client.rpc<DBAggregatedTrackAnalytics>(
DB_FUNCTIONS.aggregated_track_analytics,
{
_user_id: filters.userId ?? null,
_activity_type: filters.activityType ?? null,
}
).select(`
*,
track:tracks!inner(
id,
name,
duration
)
`)
nickreed
08/23/2022, 5:41 PMyarn add @supabase/supabase-js@next
?
2. How do I know if I am on the correct release (there is no version number in the package.json??)
3. Will the reference docs be updated to include Broadcast information? (https://supabase.com/docs/reference/javascript/next/subscribe)Sand Kingston
08/23/2022, 5:42 PMknoppoly
08/23/2022, 5:58 PM