Miguel Espinoza
09/13/2022, 7:28 PMEthanxyz
09/13/2022, 9:10 PMhttp://localhost:3000/?error=server_error&error_description=Error+getting+user+email+from+external+provider
I assume this is because in my Twitter API Settings I left get email from user
off.
I do not want or need a user's email, but maybe I need one ?
I want to allow the user to sign in, and then save that user in my database using their user_id ( twitter user id ) as the unique ID.
Any ideas on how I can do this ?johnrees
09/13/2022, 9:14 PMConnections: Pooler
column on the pricing page? I'm guessing not because presence doesn't touch the DB?
Thanksdoot0
09/13/2022, 9:35 PMenable_signup
set to false in supabase/config.toml
?Ethanxyz
09/13/2022, 10:20 PMTwo notes about Twitter auth:
You need to use Twitter v1 and request for elevated access.
I applied for access and will update this threadojg15
09/13/2022, 10:21 PMbhaskar
09/13/2022, 10:45 PMcreate or replace function public.get_transactions_for_authenticated_user( user_id uuid)
returns setof bigint
language sql
security definer
set search_path = public
stable
as $$
select id from transactions where participants::jsonb ? auth.uid()
$$;
any pointers?bhaskar
09/13/2022, 11:36 PMauth.role() = 'anon'
but would want to have a role or id check. should i auth signin using id? or is there a serviceid that could be assigned a role?konga
09/13/2022, 11:53 PManthony
09/14/2022, 1:03 AMrlee128
09/14/2022, 1:52 AMKTibow
09/14/2022, 1:55 AMtonyhart
09/14/2022, 3:50 AMPrismism
09/14/2022, 4:47 AMdblink
extension to open a persistent connection between two of my projects.
Here are the two references I have used so far:
https://www.postgresql.org/docs/current/contrib-dblink-connect.html
https://medium.com/@joelmalone/remote-database-queries-in-postgres-2ec2addda7f6
and based off of those, I here are some things I have tried:
- SELECT dblink_connect('test_connection', 'hostaddr=db.xxxxxxxxxxxxxxxxxxxx.supabase.co port=5432 dbname=postgres user=postgres password=x')
- SELECT dblink_connect('test_connection', 'host=db.xxxxxxxxxxxxxxxxxxxx.supabase.co port=5432 dbname=postgres user=postgres password=x')
- SELECT dblink_connect('test_connection', 'hostaddr=db.xxxxxxxxxxxxxxxxxxxx.supabase.co port=5432 dbname=postgres')
- SELECT dblink_connect('test_connection', 'host=db.xxxxxxxxxxxxxxxxxxxx.supabase.co port=5432 dbname=postgres')
In each case, I get Failed to run sql query: could not establish connection
I do get a success result if I do SELECT dblink_connect('test_connection', 'dbname=postgres')
which I presume is just connecting to itself which is obviously not what I want, but figured maybe this helps troubleshoot.
I am pulling each of the values in the connection strings from the settings/database
in the other project, and I reset the database password to make sure it matches.R 0 C H E Z
09/14/2022, 5:13 AMPaul AKA TDI
09/14/2022, 7:04 AMpvtctrlalt
09/14/2022, 8:24 AMKtra99
09/14/2022, 9:38 AMSpoonz
09/14/2022, 11:10 AMpvtctrlalt
09/14/2022, 11:54 AMcode: 'PGRST202',
details: null,
hint: 'If a new function was created in the database with this name and parameters, try reloading the schema cache.',
message: 'Could not find the public.public.getauthkey() function or the public.public.getauthkey function with a single unnamed json or jsonb parameter in the schema cache'
this is my function in app
export async function GetFirstAuthKey(user:any) {
const { data, error } = await supabase.rpc('getauthkey', user.id)
if (error) console.error(error)
else console.log(data)
}
and this was my function on supabase
'create or replace function getauthkey("pid" text)
returns text as
$$
select authkey from public.userprofile where id::text = pid;
$$ language sql;'
i added the "" around pid after some googleing but it also did not work before
unsure how to solve this oneRawr XD
09/14/2022, 11:58 AMtechCS
09/14/2022, 12:27 PMConnecting to project
issue, and also I've checked the DB health, it says it has around 99% of Daily Disk IO Budget remaining, but not able to open the project. I've waited for almost 6 to 8 hours and still it behaves similarly.
Can anyone help me with this issue 🙂hko
09/14/2022, 12:46 PMError: error creating shadow database
. I started my local dev by running supabase db remote commit
and then making changes.
Running supabase db diff services -f services
results in the error. --debug
does not print additional info.
Running supabase db diff services -f services --debug --use-migra
throws the following error:
ERROR: relation "pgsodium.key_key_id_seq" does not exist
and also fails with Error: error creating shadow database
.Oskar
09/14/2022, 2:23 PMimport supabase from '~/lib/supabase'
import type { Database } from '~/lib/database.types'
async function getMovies() {
return await supabase.from('movies').select('id, title, actors(*)')
}
type actors = Database['public']['Tables']['actors']['Row']
type MoviesResponse = Awaited<ReturnType<typeof getMovies>>
type MoviesResponseSuccess = MoviesResponse['data'] & {
actors: actors[]
}
type MoviesResponseSuccess = any
tyoe MovieResponse = any
actors
is correctly typed, but actors is just a part of whole reponse
by doing this I losing types for movies
as they becoming an any
type,
Im still learning typescript and may doing an easy mistakes but I basing very much on examples from docs and other sources, and it looks like it should works, but its not.
How to do it properly?
My full +page.server.ts file looks like that:
import { error } from '@sveltejs/kit';
import { supabase } from '$lib/supabaseClient';
import type { PageServerLoad, PageServerLoadEvent } from './$types';
import type { Database } from '$lib/database.types';
export const load: PageServerLoad<{ movies }> = async ({ params }: PageServerLoadEvent) => {
const { data: movies, error: err } = await (<RankingsResponseSuccess>supabase
.from('movies')
.select(
`*, actor1 (name, slug), actor2 (name, slug),`
)
.eq('slug', params.slug)
.limit(1)
.single());
if (err) {
throw error(404, err.message);
}
if (movies) {
return {
movies: movies
};
}
};
type actor1 = Database['public']['Tables']['actors']['Row'];
type actor2 = Database['public']['Tables']['actors']['Row'];
type RankingsResponse = Awaited<ReturnType<typeof load>>;
export type RankingsResponseSuccess = RankingsResponse['movies'] & {
actor1: actor1[],
actor2: actor2[]
};
Am I doing something wrong?STILLWATER;
09/14/2022, 2:46 PMenti
09/14/2022, 2:56 PMsupabase.auth.session()
anywhere I need it instead? Or should I use a getter in my store which will call for const session = supabase.auth.session()
anytime I need this value / check if the user is still authenticated server side?hko
09/14/2022, 3:30 PMjs
const { data, error } = await client
.from("user_content_queue")
.select(
"title, content, type, target_url, format, priority, id, published_at, digest_id (id, created_at)"
)
.order("created_at", { foreignTable: "digest_id", ascending: false })
.limit(1, { foreignTable: "digest_id" })
.order("type", { ascending: false })
.order("priority", { ascending: true });
Multiple pieces of content belong to a single digest. With this query, I want to retrieve all content items that belong to the latest query. While the query runs without any errors, it does not limit the digests to the latest id, but rather returns all digests.
Any ideas on how I might get this to work?kaaloo
09/14/2022, 4:24 PMdb remote set
command doesn't seem to exist anymore! Is this the case or did I miss something between releases? The current documentation mentions the db remote changes
and db remote commit
commands which presumably still require setting the remote URL...Shecky
09/14/2022, 4:29 PM