seanee
03/08/2023, 5:02 AMsquallsama
03/08/2023, 5:03 AMstylishbob
03/08/2023, 5:16 AMAuth
component be lazily loaded with ssr: false
as well.czypnt
03/08/2023, 5:29 AMJackBiscuits
03/08/2023, 7:37 AMkillerthief
03/08/2023, 7:47 AMEntropy
03/08/2023, 7:48 AM+layout.server.ts
. I checked out the types and everything looks fine to me. Here's a link to an github with all my code:
https://github.com/Entropy-10/sveltekit-auth-helper-issueKazuto
03/08/2023, 10:21 AMshows
, movies
and genres
and two intermediate tables genre_movie
and genre_show
.
Both intermediate tables contain two columns:
`genre_movie`:
sql
CREATE TABLE "public"."genre_movie" (
"genre_id" uuid REFERENCES "public"."genres" NOT NULL,
"movie_id" uuid REFERENCES "public"."movies" NOT NULL,
CONSTRAINT fk_genre FOREIGN KEY(genre_id) REFERENCES genres(id),
CONSTRAINT fk_movie FOREIGN KEY(movie_id) REFERENCES movies(id),
PRIMARY KEY (genre_id, movie_id)
);
CREATE TABLE "public"."genre_show" (
"genre_id" uuid REFERENCES "public"."genres" NOT NULL,
"show_id" uuid REFERENCES "public"."shows" NOT NULL,
CONSTRAINT fk_genre FOREIGN KEY(genre_id) REFERENCES genres(id),
CONSTRAINT fk_show FOREIGN KEY(show_id) REFERENCES shows(id),
PRIMARY KEY (genre_id, show_id)
);
But I'm not able to get the genres through the select()
statement.
select('*, genres(*)')
results in
Try changing 'genres' to one of the following: 'genres!genre_show', 'genres!genre_show', 'genres!genre_show', 'genres!genre_show'. Find the desired relationship in the 'details' key.
Could not embed because more than one relationship was found for 'shows' and 'genres'
select('*, genres!genre_show')
results in
unexpected end of input expecting letter, digit, "-", "!" or "("
and select('*, genres!genre_show(*)')
results again in
Try changing 'genres' to one of the following: 'genres!genre_show', 'genres!genre_show', 'genres!genre_show', 'genres!genre_show'. Find the desired relationship in the 'details' key.
Could not embed because more than one relationship was found for 'shows' and 'genres'
SELIM HÜR
03/08/2023, 1:31 PMTrevvy
03/08/2023, 1:39 PMjs
const { data, error } = await supabase.auth.signInWithPassword({
email,
password,
});
What's wrong?viktor
03/08/2023, 1:47 PMsql
ALTER SYSTEM SET log_statement = 'all';
How/where can I view the generated logs?
I'm using local development as described here:
https://supabase.com/docs/guides/cli/local-developmentsigma-andex
03/08/2023, 1:56 PMbrew upgrade supabase
to 1.42.3
and now I'm getting an error when running `supabase start`:
Error: ERROR: role "pgbouncer" already exists (SQLSTATE 42710)
At statement 11: CREATE ROLE pgbouncer
How can I fix this?JY
03/08/2023, 2:21 PM"Unhandled Runtime Error
Error: Dynamic server usage: revalidate: 0 configured "
.
Both Rootlayout and '/app/posts/page.tsx' set "export const revalidate = 0"
.
Below are the codes in /app/posts/[id]/page.tsx
import "server-only";
import { notFound } from "next/navigation";
import { supabase } from "@/utils/supabase";
export async function generateStaticParams() {
const { data: posts } = await supabase.from("posts").select("id");
console.log("posts", posts);
return posts
? posts.map((post) => ({
id: post.id.toString(),
}))
: [];
}
export let revalidate = 0;
export default async function Post({
params: { id },
}: {
params: { id: string };
}) {
const { data: post } = await supabase
.from("posts")
.select()
.match({ id })
.single();
if (!post) {
notFound();
}
// console.log("post", post);
return <pre>{JSON.stringify({ post }, null, 2)}</pre>;
}
JackBiscuits
03/08/2023, 3:29 PM[plugin:vite-plugin-svelte] /src/routes/+page.svelte:15:13 Unexpected token
/src/routes/+page.svelte:15:13
15 | import type { PageData } from './$types';
^
Why is PageData an unexpected token?ostoto
03/08/2023, 3:37 PMMohannad Hussain
03/08/2023, 3:43 PMcredentials
file into the storage container as per https://github.com/supabase/storage-api/issues/135 and again, still no luck.
Any thoughts on what I might be doing wrong? Thanks in advance for any assistance.Derek
03/08/2023, 3:45 PMFayyaz
03/08/2023, 4:20 PMInASunshineState
03/08/2023, 4:28 PMSunTzu
03/08/2023, 4:45 PMCREATE OR REPLACE FUNCTION generate_uid(size INT) RETURNS TEXT AS $$
DECLARE
characters TEXT := 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
bytes BYTEA := gen_random_bytes(size);
l INT := length(characters);
i INT := 0;
output TEXT := '';
BEGIN
WHILE i < size LOOP
output := output || substr(characters, get_byte(bytes, i) % l + 1, 1);
i := i + 1;
END LOOP;
RETURN output;
END;
$$ LANGUAGE plpgsql VOLATILE;
This works on the supabase hosted database I tried it on, however does not work with self hosted solution, and when it tries to trigger this function it states that gen_random_bytes does not exist
anything I can dO?horigome
03/08/2023, 4:51 PMKcrik
03/08/2023, 4:54 PMjinsley8
03/08/2023, 5:09 PMRubensNobre
03/08/2023, 5:50 PMconst realtimeProfile = supabase
.channel("realtimeUserProfile")
.on(
"postgres_changes",
{ event: "UPDATE", schema: "public", table: "profile" },
(payload) => {
console.log("profile change received!", payload);
setUser((prevUser: any) => ({
...prevUser,
profile: { ...prevUser.user_items, ...payload.new },
}));
}
)
.on(
"postgres_changes",
{ event: "INSERT", schema: "public", table: "user_items" },
(payload) => {
console.log("New user item received!", payload);
setUser((prevUser: any) => ({
...prevUser,
user_items: { ...prevUser.user_items, ...payload.new },
}));
}
)
.on(
"postgres_changes",
{ event: "UPDATE", schema: "public", table: "user_items", filter: 'username=eq.rubensnobre' },
(payload) => {
console.log("User item change received!", payload);
alert('userId = ' + JSON.stringify(user))
setUser((prevUser: any) => ({
...prevUser,
user_items: { ...prevUser.user_items, ...payload.new },
}));
}
)
.on(
"postgres_changes",
{ event: "DELETE", schema: "public", table: "user_items" },
(payload) => {
console.log("User item deleted!", payload);
setUser((prevUser: any) => ({
...prevUser,
user_items: { ...prevUser.user_items, ...payload.new },
}));
}
)
.subscribe();
Ari
03/08/2023, 6:27 PMDallas
03/08/2023, 7:33 PMrbl
03/08/2023, 7:43 PMathomas
03/08/2023, 7:45 PMModfreq
03/08/2023, 7:46 PM