ziggybit
05/16/2023, 1:22 PMseed.sql
file. But I want something similar for production to populate the application with a set of necessary models.
Creating a migration for this seems less than ideal. If the shape of the models change then the seed migration breaks. It really needs to be a standalone file like seed.sql
.
Interested to hear how others have populated their production database and how they do it in a way that isn't manual and tedious for each deployment.RubensNobre
05/16/2023, 1:49 PM${onlineHost}
, 'published')
.eq(hostData.hostCode, true)
.eq('dmca', false);
if (search) {
templates.textSearch('tags', search, { type: 'websearch' });
}
const { data, error } = await templates;
----
I'd like to be able to search in two columns:
tags AND caption.
Does anybody have any tip ?
Thanks in advancereno
05/16/2023, 1:53 PMPool
class because it requires --unstable
flag.
The resulting error is:
Unstable API 'Deno.connect'. The --unstable flag must be provided.
reno
05/16/2023, 2:00 PM-- supabase/seed.sql
CREATE SCHEMA foobar;
-- TODO: create a user? any other context for security?
-- Add permissions
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA foobar TO bar, baz; -- Are all these needed? Is this good/bad practice?
ALTER DEFAULT PRIVILEGES IN SCHEMA foobar GRANT ALL ON TABLES TO foo, bar;
ALTER DEFAULT PRIVILEGES IN SCHEMA foobar GRANT ALL ON FUNCTIONS TO foo, bar;
ALTER DEFAULT PRIVILEGES IN SCHEMA foobar GRANT ALL ON SEQUENCES TO foo, bar;
-- ...
CREATE TABLE my_table (
id serial PRIMARY KEY,
name text NOT NULL
);
--- etc.
formigueiro
05/16/2023, 2:40 PMJohnny Robert
05/16/2023, 3:18 PMtalpiven
05/16/2023, 3:35 PMhttps://cdn.discordapp.com/attachments/1108055037508321392/1108055037831291010/image.png▾
nimo
05/16/2023, 4:06 PMhttps://cdn.discordapp.com/attachments/1108062945012895744/1108062945172271215/Screenshot_2023-05-16_at_9.05.11_AM.png▾
Milou
05/16/2023, 4:11 PMbombillazo
05/16/2023, 4:42 PMformigueiro
05/16/2023, 5:17 PMjs
.upload(`${currentUser.id}/${imageName.value}.${extension.value}`, fileInput.value, {
cacheControl: '3600',
upsert: false
})
but files in storage as a text
https://cdn.discordapp.com/attachments/1108080694435008623/1108080694573400074/image.png▾
https://cdn.discordapp.com/attachments/1108080694435008623/1108080694825070692/image.png▾
bookvacuum
05/16/2023, 6:04 PMalex_
05/16/2023, 6:23 PMGrantly
05/16/2023, 7:42 PMEdan
05/16/2023, 7:55 PMturulix
05/16/2023, 8:06 PMts
import { corsHeaders } from "../_shared/cors.ts"
import { serve } from "https://deno.land/std@0.168.0/http/server.ts"
serve(async (req: Request) => {
if (req.method === "OPTIONS") {
return new Response("ok", { headers: corsHeaders })
}
let timerId: number | undefined;
console.log("Serving request")
const body = new ReadableStream({
start: (controller) => {
timerId = setInterval(() => {
console.log("Sending data")
controller.enqueue(new TextEncoder().encode("data: hello\r\n\r\n"));
}, 1000);
},
cancel(){
if (typeof timerId === "number") {
clearInterval(timerId);
}
}
})
return new Response(
body,
{
headers: {
...corsHeaders,
"Content-Type": "text/event-stream"
}
}
)
})
tk
05/16/2023, 8:55 PMhttps://cdn.discordapp.com/attachments/1108135716652855316/1108135717235859536/image.png▾
bruno_kiafuka
05/16/2023, 9:05 PMjs
# My Query
query {
countriesCollection(first: 1) {
edges {
node {
...CountryFragment
}
}
}
}
fragment CountryFragment on countries {
country_code
country_name
currency_code
flag
id
}
# Response
{
"data": {
"countriesCollection": {
"edges": []
}
}
}
When I test it on the SQL Editor on Supabase dashboard, I get the correct info:
sql
select graphql.resolve($$
{
countriesCollection(first: 1) {
edges {
node {
country_code
country_name
currency_code
flag
id
}
}
}
}
$$);
justJosuke
05/16/2023, 9:21 PMlennard.
05/16/2023, 9:52 PMmansedan
05/16/2023, 10:31 PMsql
UPDATE events_odds_api
SET home_team_id = (
SELECT id
FROM teams
WHERE (CASE WHEN events_odds_api.sport = 'mma_mixed_martial_arts' or events_odds_api.sport = 'soccer_uefa_champs_league'
THEN name
ELSE CONCAT(name, ' ', mascot)
END) = events_odds_api.home_team
LIMIT 1
)
WHERE home_team_id IS NULL;
The general overview of the tables is that events_odds_api
has 2 columns pointing to teams
. Columns away_team_id
and home_team_id
These relations are set by the function above, by matching the value of column `home_team`/`away_team` with either the column name
or CONCAT(name, ' ',mascot)
from the teams table.
Why is this causing a deadlock?Ruzelmania
05/16/2023, 10:32 PMblackstock
05/16/2023, 10:44 PMhttps://cdn.discordapp.com/attachments/1108163054908223508/1108163055088586863/Screenshot_2023-05-16_at_4.42.30_PM.png▾
Philipp_Nut
05/16/2023, 10:52 PMRuzelmania
05/16/2023, 11:07 PManon3498723894
05/16/2023, 11:21 PMsalzar
05/16/2023, 11:25 PMnewbie001
05/16/2023, 11:40 PMcreateClient
method on my backend as in the image below, but for each request, the supabase.auth.getUser()
method returns invalid claim: missing sub claim
I also tried to retrieve the session with supabase.auth.getSession but I get null
supabase-js version: 2.21.0
https://cdn.discordapp.com/attachments/1108177251666776265/1108177251880681522/image.png▾
cartcolombia
05/17/2023, 12:21 AMbroux
05/17/2023, 12:39 AM/realtime/v1/websocket
) is failing with a 403 error.
We haven't changed the code on our end.
On client side we see this error log every 3 seconds:
WebSocket connection to 'wss://<our supabase project code>.supabase.co/realtime/v1/websocket?apikey=xxxxxxxxxxxxxx&vsn=1.0.0' failed:
Seems like something was changed in our project that is now causing this error to occur?
We have two projects (identical, one is for dev, one is for prod) and it is only happening on our prod supabase project.