전체 글
-
데이터 수정 하기멈멈-토이프로젝트(React)1 2024. 6. 4. 22:29
1. 리스트에서 선택 한 글 수정2. 선택 된 페이지의 id를 비교 해서 데이터 수정하기3. 사용자가 입력 했던 데이터의 상태에 따라 입력 되는 값 설정 기존 코드 fetchDb.map(async (i) => { const { error } = await supabase .from("writedb") .update({ walk: i.walk === null ? btnTopSelect : i.walk, walkimg: btnTopSelect === "" ? null : allimgList[0].walk, }) .eq("id", selectDBId); });fetchDb는 입력 된 ..
-
수파베이스에서 테이블 비교 해서 이미지 출력-3멈멈-토이프로젝트(React)1 2024. 5. 29. 22:30
기존1. 사용자가 입력한 데이터에 따라 테이블에 데이터 추가2. 입력하는 테이블과 이미지가 출력 되는 테이블 join 해서 이미지가 출력 되는 테이블에서 이미지 출력 수정1. 사용자가 입력한 데이터에 따라 테이블에 데이터 추가2. 입력 하는 테이블과 이미지 출력 되는 테이블 따로 관리 join안함3. 입력하는 테이블 값에 따라 이미지가 등록 되록 수정 기존 코드const hadletest = async () => { const { data, error } = await supabase.from("writedb").select(` a, listeat ( url ) `); if (data) { const urls: UrlsT..
-
수파베이스에서 테이블 비교 해서 이미지 출력-2멈멈-토이프로젝트(React)1 2024. 5. 26. 22:53
순서1. 사용자가 입력한 데이터에 따라 테이블에 데이터 추가2. 입력하는 테이블과 이미지가 출력 되는 테이블 join 해서 이미지가 출력 되는 테이블에서 이미지 출력 a테이블과 b테이블에서 의 조인 할때 나온 에러{ "code": "21000", "details": null, "hint": null, "message": "UPDATE requires a WHERE clause"}WHERE 절이 없어서 발생하는 문제로 수파베이스 sql확인 { "code": "23502", "details": null, "hint": null, "message": "null value in column \"id\" of relation \"writedb\" violates not-..
-
수파베이스에서 테이블 비교 해서 이미지 출력멈멈-토이프로젝트(React)1 2024. 5. 24. 23:59
A table예시key : uuid, a, b, c, d, e, f B tablekey :id, a, content 두개의 테이블을 비교 해서 B 테이블의 content 출력하기 1. A테이블과 B테이블 연동하기B 테이블에서는 겹치는 키 유니크 설정2. A 테이블에서 연동할 키 Foreign Keys로 연동3. 테이블에서 데이터 출력하기(수파베이스)const [imgW, setImgW] = useState(""); const handleWalk = async () => { const { data, error } = await supabase.from("writedb").select(` walk, listwalk ( url ..
-
실시간 위치 변경멈멈-토이프로젝트(React)1 2024. 5. 21. 15:56
사용자의 실시간 위치 변경 해보기 두개의 함수는 별개 연관 되어 있지 않다.handleMotionEvent 함수사용자의 위치가 변경 되는 걸 알 수 있게 콘솔로 확인devicemotion 장치가 움직일때 발생 하는 이벤트devicemotion 이벤트 객체의 속성 accelerationIncludingGravity.x 장치의 가로 방향 가속도accelerationIncludingGravity.y 장치의 세로 방향 가속도accelerationIncludingGravity.z 장치의 수직 방향 가속도 simulateMotionEvent 함수1초씩 값이 변화가 되는지 확인용으로 작성1. 함수정의2. 새로운 devicemotion 이벤트 객체 생성 3. 가속도 데이터 할당 event. accelerationIn..
-
수파베이스 (Bad Request) 2차 해결멈멈-토이프로젝트(React)1 2024. 4. 27. 17:59
시도 해본 방법1. RLS 업데이트 관련 정책 수정 : 에러남2. 수파베이스 가이드 보면서 테이블 조인eq 활용에러 there is no unique constraint matching given keys for referenced table "userthema" const { data, error } = await supabase .from("dogthemabgdb") .select( ` themabg ` ) .eq("userthema.themaurl", "dogthemabgdb.themaurl");3. 수파베이스 컬럼 살펴보면서 userthema 외래키 설정에러 there is no unique constraint match..
-
수파베이스 에러 400 (Bad Request) 1차멈멈-토이프로젝트(React)1 2024. 4. 27. 13:35
sql 에러작성 코드 const { data, error } = await supabase .from("userthema") .select( ` userthema.themaurl, dogthemabgdb.bg ` ) .eq("userthema.themaurl", "dogthemabgdb.themaurl"); if (error) { console.error("Error fetching data:", error.message); return; }내가 원하는 코드 각 테이블의 키를 비교 해서 다른 테이블에 있는 값을 출력 @supabase_supabase-js.js?v=b03b78a..
-
수파베이스 에러 syntax error at or near "select"멈멈-토이프로젝트(React)1 2024. 4. 27. 00:20
ERROR: syntax error at or near "select"LINE 1: create policy "Policy with table joins" on "public"."userthema" as permissive for update to public using (select dogthemabgdb.themabg from dogthemabgdb where dogthemabgdb.themaurl = userthema.themaurl); sql 문법 오류using 절에 있는 서브쿼리에서 에러 발생create policy "Policy with table joins" on "public"."userthema" as permissive for update to public using ( sele..