Ammar Almuain
04/15/2023, 6:02 PMconst data = async () => {
let { data: todos, error } = await supabase
.from('todos')
.select('id')
return todos
}
kylelovesyou
04/15/2023, 7:12 PMMaz
04/15/2023, 7:28 PMMaz
04/15/2023, 7:56 PMprofiles
table that references auth.users
. This works fine when profiles
contains additional columns the auth.users
table does not, but what if I want to expose the auth.users
email
field to this profiles
table and keep them in sync?
Should I use a trigger or is there some new postgres feature I'm not aware of to "mirror" a column from another table, like generated columns?jarnold
04/15/2023, 8:36 PMAMZ7860
04/15/2023, 9:50 PMnahtnam
04/15/2023, 9:52 PMcreateClient
(at the root level, not inside of a function/component).
https://cdn.discordapp.com/attachments/1096915884532060241/1096915885068918884/image.pngâ–¾
JamieGreg
04/15/2023, 10:05 PM.select(`
*,
moduleId: lists(boards(modules(id)))
)
`)
Im looking for the returned value to be something like
moduleId: 11
rather than
moduleId: {
boards: {
id: 11
}
}
zach
04/15/2023, 10:08 PM${data.user.id}
2) properties
Code for my handler function on signup is attached.
The first part of it works (signing up the user with email, password, first_name, and last_name).
Its just the three storage requests after that which are not working.
I get the below error for all 3 storage requests (attached is the name of each from my Network tab in Chrome dev tools): {statusCode: "404", error: "Not found", message: "The resource was not found"}
I'm guessing its something to do with the path parameters I'm passing into .upload() for each of the 3 requests. If it is, can someone guide in the right direction here?
https://cdn.discordapp.com/attachments/1096919987681243146/1096919987886751914/handler-function.pngâ–¾
https://cdn.discordapp.com/attachments/1096919987681243146/1096919988260048977/name-of-requests.pngâ–¾
https://cdn.discordapp.com/attachments/1096919987681243146/1096919988503326800/ideal-structure.pngâ–¾
DanMossa
04/15/2023, 11:37 PMGuy Rozen
04/16/2023, 12:05 AMsupafloh
04/16/2023, 1:11 AMhttps://cdn.discordapp.com/attachments/1096966101503586324/1096966101704908840/image.pngâ–¾
jarnold
04/16/2023, 1:23 AMsupafloh
04/16/2023, 1:41 AMjs
const {data : updateData, error} = await supabase
.from('posts')
.update({
description: descriptionValue
})
.eq('id', data.id)
.select('*')
.single()
if (error) console.log(error)
console.log(updateData)
Request URL
``https://[myproject].supabase.co/rest/v1/posts?id=eq.52&select=*``
Result:
code: "PGRST116"
​
details: "Results contain 0 rows, application/vnd.pgrst.object+json requires 1 row"
​
hint: null
​
message: "JSON object requested, multiple (or no) rows returned"
Canman
04/16/2023, 2:28 AMElias
04/16/2023, 3:35 AMsupabase functions new test
Error
Version 1.30.3 is already installed
Bundling posts
Error: Error bundling function: signal: abort trap
file:///src/import_map.json
file:///src/index.ts
assertion failed [block != nullptr]: BasicBlock requested for unrecognized address
(BuilderBase.h:550 block_for_offset)
KBar
04/16/2023, 7:03 AMmonkykap
04/16/2023, 10:21 AMimport supabase from "lib/supabaseClient"
export const loader = async({}) => {
console.log("entered");
const { data } = await supabase.from('themes').select();
console.log("exited")
return { data };
}
export default function Index() {
const{ data } = useLoaderData();
return <pre>{JSON.stringify(data, null, 2)}</pre>;
}
Function enters but doesn't exit for a long time, and then shows null.COLD1
04/16/2023, 10:46 AMjavascript
exports.updateArticle = [
body('article_id').isInt(),
body('author_id').isInt(),
body('article_title').optional().notEmpty(),
body('summary').optional().notEmpty(),
body('content').optional().notEmpty()
,
async (req, res, next) => {
try {
const errors = validationResult(req);
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() });
}
const { data: article, error } = await supabase
.from('articles')
.update({
article_id: req.body.article_id,
author_id: req.body.author_id,
article_title: req.body.article_title,
summary: req.body.summary,
content: req.body.content,
})
.eq('article_id', parseInt(req.params.id))
if (error) {
return next(error);
}
res.json({ message: 'Article updated successfully!' });
} catch (error) {
next(error);
}
},
];
https://cdn.discordapp.com/attachments/1097110669041610793/1097110669389746247/image.pngâ–¾
Limuz
04/16/2023, 12:45 PMven
04/16/2023, 2:57 PMhttps://cdn.discordapp.com/attachments/1097173938913689770/1097173939144368168/browser_console.jpgâ–¾
https://cdn.discordapp.com/attachments/1097173938913689770/1097173939416993892/studio_view_of_the_storage_bucket.jpgâ–¾
jarnold
04/16/2023, 3:12 PMsupabase functions serve --all
https://cdn.discordapp.com/attachments/1097177678412533903/1097177679150727168/CleanShot_2023-04-16_at_11.09.32.pngâ–¾
https://cdn.discordapp.com/attachments/1097177678412533903/1097177679494652005/CleanShot_2023-04-15_at_19.53.36.pngâ–¾
https://cdn.discordapp.com/attachments/1097177678412533903/1097177679771488388/CleanShot_2023-04-15_at_19.55.00.pngâ–¾
https://cdn.discordapp.com/attachments/1097177678412533903/1097177680069271552/CleanShot_2023-04-15_at_19.54.49.pngâ–¾
Peterson
04/16/2023, 3:19 PMMATTI
04/16/2023, 3:31 PMhkg
04/16/2023, 3:50 PMnpx supabase link --project-ref <id>
then
npx supabase start
then tried to get initial migration from remote
npx supabase remote db commit
and when I tried to:
npx supabase db reset
I got:
Applying migration 20230416154524_remote_commit.sql...
Error: ERROR: schema "vault" does not exist (SQLSTATE 3F000)
At statement 15: --
-- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS "supabase_vault" WITH SCHEMA "vault"
lecookie
04/16/2023, 4:11 PMmagenta
04/16/2023, 4:55 PMhttps://i.imgur.com/mLPxI6B.pngâ–¾
js
const { data: restaurantId, error } = await supabase
.from('restaurants')
.select('*')
.overlaps('domains', ["restaurant.gastrobit.de"]) // this doesn't work
However, this results in an empty array if applied on the table from above.
[1] https://supabase.com/docs/reference/javascript/overlapsmarc
04/16/2023, 5:00 PMsupabase functions serve --env-file ./supabase/.env --import-map ./supabase/functions/import_map.json
and I get :
at async HttpConn.nextRequest (ext:deno_http/01_http.js:93:21)
at async serve (https://deno.land/x/oak@v12.1.0/http_server_native.ts:62:46)
[uncaught application error]: Error - Bad resource ID
at async HttpConn.nextRequest (ext:deno_http/01_http.js:93:21)
at async serve (https://deno.land/x/oak@v12.1.0/http_server_native.ts:62:46)
[uncaught application error]: Error - Bad resource ID
... (in an infinit loop when i make an http call to the function)
it's working fin when I use the cmd to serve only one function
I use supabase js in my fonctions
maybe this can came from the host of the docker,
when my edge function try to call with supabase-js...
supabase_deno_relay_supabase
(I see the --allow-net https://github.com/denoland/deno_docker options for docker but not sure if it can help)
(i'm on mac os M2)
thanks for your time 🙂Jaaneek
04/16/2023, 5:27 PM