Irfan Ahmed
01/11/2023, 7:19 PMmiky2fois
01/11/2023, 8:47 PMselect * from get_captions_by_word(E'I don\'t') limit 10;
However, I don't know how to do it with supabase.rpc
Any solution?Esore
01/11/2023, 9:15 PMconst deleteProduct = async (id: string) => {
try {
const { data, error } = await supabaseClient
.from("product")
.delete()
.eq("id", id)
.select()
console.log(`delete + ${id}`)
if (error) throw error
getProducts()
} catch (error: any) {
alert(error.message);
}
}
any help would be great!Vik
01/11/2023, 9:21 PMALTER TABLE friend_requests
ADD CONSTRAINT status_constraint
CHECK (status = "pending" OR status = "accepted" OR status = "declined" OR status = "blocked");
Dbugger
01/11/2023, 9:54 PMAmara
01/11/2023, 11:07 PMDYELbrah
01/11/2023, 11:21 PMREVOKE ALL PRIVILEGES ON DATABASE "postgres" FROM "anon";
REVOKE ALL PRIVILEGES ON SCHEMA "public" FROM "anon";
REVOKE ALL PRIVILEGES ON SCHEMA "storage" FROM "anon";
REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA "public" FROM "anon";
REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA "storage" FROM "anon";
REVOKE ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA "public" FROM "anon";
REVOKE ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA "storage" FROM "anon";
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA "public" FROM "anon";
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA "storage" FROM "anon";
also
alter default privileges in schema public revoke all on tables from anon;
alter default privileges in schema public revoke all on functions from anon;
alter default privileges in schema public revoke all on sequences from anon;
-- the above will only work for future database objects, to revoke current privileges
revoke select on all tables in schema public from anon;
revoke usage on all sequences in schema public from anon;
revoke execute on all functions in schema public from anon;
After running these in my local db instance, I do get insufficient privileges messages when attempting to view any table data.
I do have RLS in place as well. I want to remove all ANON access since at no point should any data from my app be visible to unauthenticated users.
Thank you in advance.logemann
01/11/2023, 11:30 PMDYELbrah
01/11/2023, 11:58 PMsupabase db diff --use-migra --file revoke_anon_privileges
The changes are NOT added the migration file, as a matter of fact no changes are detected.
When I remove the flag --use-migra, the changes are effectively added to the migration file (using this command):
supabase db diff --file revoke_anon_privileges
I'm not sure when my team should be using --use-migra, vs not? Anyone got some insight?
Thank you in advance.Will Ernst
01/12/2023, 1:10 AMDYELbrah
01/12/2023, 2:38 AMCabtn
01/12/2023, 4:52 AM_app
is wrapped like so:
const MyApp = ({ Component, pageProps }: AppProps) => {
// Create a new supabase browser client on every first render.
const [supabaseClient] = useState(() => createBrowserSupabaseClient());
return (
<SessionContextProvider
supabaseClient={supabaseClient}
initialSession={pageProps.initialSession}
>
<Component {...pageProps} />
</SessionContextProvider>
);
};
do I need to do the step described in this egghead lesson linked below? If so, why? What is the difference between the two context. https://egghead.io/lessons/next-js-make-user-state-globally-accessible-in-next-js-with-react-context-and-providersCabtn
01/12/2023, 5:26 AMimport { useEffect } from 'react';
import { useSupabaseClient, useUser } from '@supabase/auth-helpers-react';
import { Auth, ThemeSupa } from '@supabase/auth-ui-react';
import { useRouter } from 'next/router';
import { getURL } from '../utils/helpers';
import { axiosRequest } from '../utils/utils';
const Login = () => {
const router = useRouter();
const user = useUser();
const supabaseClient = useSupabaseClient();
console.log('User', user);
useEffect(() => {
if (user) {
console.log('We are going to make a request');
axiosRequest('/api/create-customer', { id: user.id, email: user.email });
router.replace('/shopping-cart');
}
}, [router, user]);
if (!user)
return (
<div className="flex justify-center height-screen-helper">
<div className="flex flex-col justify-between max-w-lg p-3 m-auto w-80 ">
<div className="flex justify-center pb-12 "></div>
<div className="flex flex-col space-y-4">
<Auth
supabaseClient={supabaseClient}
providers={['google']}
redirectTo={getURL()}
appearance={{
theme: ThemeSupa,
variables: {
default: {
colors: {
brand: '#404040',
brandAccent: '#52525b',
},
},
....
export default Login;
c0rrupt
01/12/2023, 7:00 AManggoran
01/12/2023, 7:25 AMBuradorii
01/12/2023, 7:28 AMMarkeem
01/12/2023, 7:50 AMkanintesova
01/12/2023, 7:58 AM"headers": [
{
"accept": "*/*",
"cf_cache_status": null,
"cf_connecting_ip": "retracted",
"cf_ipcountry": "SE",
"cf_ray": "78843d233ce30a2c",
"content_length": null,
"content_location": null,
"content_range": null,
"content_type": null,
"date": null,
"host": "retracted.supabase.co",
"referer": null,
"sb_gateway_version": null,
"user_agent": "undici",
"x_client_info": "supabase-js/2.4.0",
"x_forwarded_proto": "https",
"x_forwarded_user_agent": null,
"x_kong_proxy_latency": null,
"x_kong_upstream_latency": null,
"x_real_ip": "retracted"
}
],
"host": "retracted.supabase.co",
"method": "GET",
"path": "/rest/v1/public.checkout",
"port": null,
"protocol": "https:",
"sb": [],
"search": "?select=resource",
"url": "https://retracted.supabase.co/rest/v1/public.checkout?select=resource"
}
And here is the relevant app code:
// Initialize the JS client
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY);
app.get('/', async (req, res) => {
try {
// make request to Supabase API
const { data } = await supabase.from('public.checkout').select('resource');
I don't know what is wrong really, and what I am missing. Any help or pointers would be lovely. Thanks people. ❤️MoreeZ
01/12/2023, 8:01 AMsql
SELECT DISTINCT namespace FROM file_system
In JavaScript I can select all "namespace" columns but I only need the distinct ones.
js
supabase.from("file_system").select("namespaces");
itog
01/12/2023, 8:09 AMrealtime
for the tables?
When I use local server, I always have to enable realtime manually.
And after enabling it, `supabase db diff`don't find any changes.
So, I have to enable again when I restart the server.
Is there anyway to set tables realtime on starging the server?AntDX316
01/12/2023, 9:11 AMMoreeZ
01/12/2023, 11:28 AMsql
select distinct namespace from file_system
But when I try to make an sql function I can only get a single record back. When I try to return either json or jsonb I get this error return type mismatch in function declared to return jsonb
Could someone maybe help me convert this query into a working plpgsql function?Deidara
01/12/2023, 12:09 PMrem
01/12/2023, 1:08 PMawait supa.from("teams").insert(newTeam) // returns with error prop
All the fields in the teams
table are being included as properties in newTeam
with the exception of id
which I've assumed will auto assign (as it's doing this when some earlier records were inserted).
I've also checked the column properties and they all have "allow nullable" on them, but this error seems to be coming from inside of supabase trying to destructure… something.
Has anyone else seen this or have any suggestions I might be able to poke around?Migu
01/12/2023, 1:13 PM/object/{bucketName}/{wildcard}
replaces the file with the buffer we send…
I have very little knowledge in the domain so it gets a bit confusing reading some stuff but I reckon it may involve at least fs
.
Has anyone already tackled the subject?
My use-case is a very large XLSX file (200k lines) that I create with libraries like xlsx-populate and I need to stream it otherwise I get timed-out quite quickly.
Thanks!ItsEthra
01/12/2023, 1:47 PM.env
and also page where I am suppose to set my secret key is missing from studio.pepegc
01/12/2023, 1:54 PMa guy
01/12/2023, 2:05 PMBad Gifter
01/12/2023, 2:11 PMDbugger
01/12/2023, 2:32 PM