stunna
02/13/2023, 8:15 AMHugoDuprez
02/13/2023, 8:41 AMSSHSRN
02/13/2023, 9:04 AManimeshjain
02/13/2023, 9:46 AMpg_net
(to setup scheduled invocations eventually), but I am stumbling upon a weird behaviour
My pg_net query looks like follows:
select
net.http_post(
url:='https://ixrnmjhxqamwctmuiymp.functions.supabase.co/track-data',
headers:='{"Content-Type": "application/json", "Authorization": "Bearer <redacted_token>", "random-header": "test"}'::jsonb
body:=concat('{"time": "', now(), '"}')::jsonb
) as request_id;
My function invocation is happening, but I am getting an http 500 or 502 status in response. When I look at the invocation log, I see that none of the headers are getting included.
Log ID
9caba173-af16-47cd-98db-049d8d90d5d7
.
.
.
Log Metadata
[
{
"deployment_id": "ixrnmjhxqamwctmuiymp_27bcaf6d-84c0-4739-b672-aeff23314a52_3",
"execution_time_ms": 254,
"function_id": "27bcaf6d-84c0-4739-b672-aeff23314a52",
"project_ref": "ixrnmjhxqamwctmuiymp",
"request": [
{
"headers": [
{
"accept": "*/*",
"accept_encoding": null,
"connection": null,
"content_length": "41",
"cookie": null,
"host": "ixrnmjhxqamwctmuiymp.functions.supabase.co",
"user_agent": "pg_net/0.7"
}
],
"host": "subhosting-v1.deno-aws.net",
"method": "POST",
"pathname": "/track-data",
"port": null,
"protocol": "https:",
"search": null,
"url": "https://subhosting-v1.deno-aws.net/track-data"
}
],
"response": [
{
"headers": [
{
"content_length": null,
"content_type": "text/plain;charset=UTF-8",
"date": "Mon, 13 Feb 2023 09:29:34 GMT",
"server": "deno/aws-us-east-1",
"vary": "Accept-Encoding"
}
],
"status_code": 500
}
],
"version": "3"
}
]
Any idea what I am missing here? Thanks!MarcoSantonastasi
02/13/2023, 10:03 AMtypescript
import { assertEquals } from "https://deno.land/std@0.177.0/testing/asserts.ts";
import handler from "./handler.ts";
Deno.test("handler", (_t) => {
const expected = new Response("Hello World!");
const received = handler(
new Request(new URL("/testing", "http://localhost")),
);
assertEquals(expected, received);
});
I feel that testing each property one by one is tedious and error prone, but shallow assertEquals
does not seems to work and I really expected it to work...
What am I missing?
I also tried the Deno community, since I believe it's more of a Deno question, but amybe people here are more reactive:
https://discord.com/channels/684898665143206084/1074629346448384051/1074629346448384051Sanctus
02/13/2023, 10:14 AMak4zh
02/13/2023, 11:33 AMJWSInvalidSignature
when selecting any table in local development.
js
PUBLIC_SUPABASE_URL=http://localhost:54321
PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
js
{
code: 'PGRST301',
details: null,
hint: null,
message: 'JWSError JWSInvalidSignature'
}
Hypersigils
02/13/2023, 12:17 PMhttps://i.imgur.com/BHjkdlT.png▾
https://i.imgur.com/azP7mgm.png▾
const { data, error } = await supabase
.from('maps_tags')
.select()
.eq('map', mapID);
I had read access RLS on all tables, then shut RLS off when it wasn't working.ICAZ117
02/13/2023, 1:01 PMjs
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/v106/@types/node@16.18.10/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)
edgaras
02/13/2023, 1:02 PMjobs
or job_filters
row, a related jobs_job_filter
row should be automatically deleted?Sriniketh J
02/13/2023, 1:14 PMfrom dotenv import load_dotenv
load_dotenv()
import os
from supabase import create_client
url = os.environ.get("SUPABASE_URL")
key = os.environ.get("SUPABASE_KEY")
Client = create_client(url, key)
email = ""
password = ""
user = Client.auth.sign_up(email=email, password=password)
But I get the following error:
Traceback (most recent call last):
File "/Users/srini/Documents/supabase-py/auth.py", line 8, in <module>
user = Client.auth.sign_up(email=random_email, password=random_password)
TypeError: sign_up() got an unexpected keyword argument 'email'
Is there something I am missing?lake_mattiato
02/13/2023, 1:36 PMjson
{
statusCode: "401",
error: "Invalid JWT",
message: 'new row violates row-level security policy for table "objects"'
}
However, i am uploading like this:
js
const path = 'documents/invoices/ab20f0af-50c5-4ecb-a169-3f4a77ff1036/Test 1.jpeg'
console.log(path)
const { data, error } = await supabase
.storage
.from('documents')
.upload(path, file, {
cacheControl: '3600',
upsert: false
})
Any ideas? Thanksactraiser
02/13/2023, 2:06 PMMarty
02/13/2023, 2:11 PMconst { data, error } = await supabase.from('cities').select(`name, country_id (name)`)
This query would return the data as:
[
{
"name": "Munich",
"country_id": [
{
"name": "Germany"
}
]
}
]
What I want to get back is:
[
{
"name": "Munich",
"country_name": "Germany"
]
}
]
I know that this could be done using an rpc function but I'd like to know if it would be possible to do it directly with a query like this:
const { data, error } = await supabase.from('cities').select(`name, country_id (name) as country_name`)
Thank you for your help!enti
02/13/2023, 2:47 PMsql
const { data, count, error } = await supabase
.from("table1")
.select(***)
.like("table2.label", "%" + word + "%")
...
The problem is that some table1
entries don't have any reference in table2
. That makes these table1
entries filtered out even when the filtering word
isn't provided.
Is there another way to include them? Is there a way to make my .like
request optional when word
isn't provided?phoenix
02/13/2023, 2:57 PMDaemon
02/13/2023, 2:58 PM# Get the code
git clone --depth 1 https://github.com/supabase/supabase
# Go to the docker folder
cd supabase/docker
# Copy the fake env vars
cp .env.example .env
# Start
docker compose up
I initially replaced the following env variables in .env
with the values from my cloud project, but that never finished building. The documentation however says that replacing these variables are only recommended before going to production so I would expect it to work locally without changing them.
POSTGRES_PASSWORD=
JWT_SECRET=
ANON_KEY=
SERVICE_ROLE_KEY=
My ultimate goal is to create a local dev environment and I will use Supabase Cloud for my production environment.Krysalist
02/13/2023, 3:36 PMhttp://supabase_kong_myproject:8000/storage/v1/object/public/locations/file1-1676302351169.jpeg▾
http://localhost:54321/storage/v1/object/public/locations/file1-1676302351169.jpeg▾
JOCKER
02/13/2023, 3:56 PMsupabase start
i got an error failed to connect to host=localhost user=postgres database=postgres: dial error (timeout: dial tcp 127.0.0.1:54322: i/o timeout)
im running Docker on WSL on windows if anone have an idea about the issue, thanks1Hugos
02/13/2023, 3:58 PMLukas V
02/13/2023, 4:32 PM/therock
?
Is it possible to recreate this seamless sign up flow for create user with email and password
?Jackw3434
02/13/2023, 4:37 PMzhay
02/13/2023, 4:49 PMlogemann
02/13/2023, 5:15 PMShelby
02/13/2023, 5:18 PMsql
BEGIN
NEW.is_approved = false;
RETURN NEW;
END;
Señor Bruno
02/13/2023, 6:30 PMsuitedcode
02/13/2023, 7:00 PMonClick
handler)
2. Initiate the download in a Next.js serverless function.
- In the serverless function, I'll have access to the fs
module to read the blob and write a file back to the client.
I haven't had to write my own function to handle blobs and file streams to initiate a download, so this is beyond my scope of knowledge in what needs to happen. Any guidance would be greatly appreciated (especially on the core concepts of blobs, streams, etc.)jh
02/13/2023, 7:04 PMMawinOnAMac
02/13/2023, 7:29 PMabaum
02/13/2023, 7:34 PMWe tried to find a middle ground, where you pay for the number of images you want to transform rather than the number of transformations:
- You can transform 100 images per project, at no additional cost. Beyond this, it is $5 per additional 1000 images transformed.
- Each image can be transformed up to 20 times. This is based on fair-usage. If you exceed the limit, we won't return an error and your site will continue to function (but you will get a sternly-worded email from @ AntWilson).
https://supabase.com/blog/storage-image-resizing-smart-cdn#availability-and-pricing
I'm interpreting this to mean that we pay once per image per size that we want it transformed to. however, the second bullet point confused me – does "Each image can be transformed up to 20 times" refer to the different possible sizes? or CDN cache misses? or something else that I'm missing?