chit
05/24/2023, 9:49 AMatob
to a binary string, as it occupied less characters. I then want to store this result in the Supabase Postgres database, but sometimes the encrypted binary string consists \\u0000, which triggers the error ERROR: unsupported Unicode escape sequence Detail: \u0000 cannot be converted to text.
I was told that [PostgresSQL does not plan to suport \\u0000 as nul-terminated strings is used a lot in the backend](https://www.postgresql.org/message-id/8239.1500489054%40sss.pgh.pa.us).
my encryption and decryption function:
export function encryptText(text, key) {
return window.atob(AES.encrypt(text, key).toString());
}
export function decryptText(text, key) {
return AES.decrypt(window.btoa(text), key).toString(enc.Utf8);
}
Is there any other way to achieve my goal of storing encrypted text inside Supabase Postgres with as little character as possible?
I've tried assing .trim()
after the text is encrypted, to remove any trailing \\u0000.
I've also thought about replacing \\u0000 with other characters, but I if I do so, how can I accurately un-replace it before I call the decryption function?Masini
05/24/2023, 10:40 AMGrimmjoww231
05/24/2023, 11:06 AMEKI
05/24/2023, 11:24 AMGeoff
05/24/2023, 11:55 AMhttps://cdn.discordapp.com/attachments/1110898839994515556/1110898840208408606/image.pngā¾
TheRien
05/24/2023, 1:03 PMtype Post = Database['public']['Tables']['posts']['Row'] & {
comments: Database['public']['Tables']['comments']['Row'][]
}
And I have the following query:
const postId = 1;
supabase.from('posts').select('name, comments(description)').eq('id', postId).limit(1).single().returns<Post>();
However, this gives an error: Property 'returns' does not exist on type 'PostgrestBuilder<.....>
So how can I use a custom type and retrieve one row? Or is this a bug in supabase-js?happenator
05/24/2023, 1:55 PMError: WebSocket Constructor: The protocols array cannot be empty.
when calling client.subscribe
. I assume it has something to do with the Cloudflare runtime environment not being a full Node environment.greenteacoffee
05/24/2023, 2:05 PMVinny
05/24/2023, 2:09 PMjs
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [pgvector(map: "vector", schema: "extensions")]
}
generator client {
provider = "prisma-client-js"
output = env("PRISMA_CLIENT_OUTPUT_DIR")
previewFeatures = ["postgresqlExtensions"]
}
model Text {
id Int @id @default(autoincrement())
title String
content String
vector Unsupported("vector (1536)")
}
My initial migration works, but I keep getting this error on subsequent migrations:
ERROR: schema "extensions" does not exist
Waterpile
05/24/2023, 2:24 PMIshaan - berri.ai
05/24/2023, 3:19 PMVigne
05/24/2023, 3:25 PMven
05/24/2023, 4:13 PMzerosodium
05/24/2023, 4:15 PMjs
useEffect(() => {
const bidsSubscription = supabase
.channel("any")
.on(
"postgres_changes",
{
event: "*",
schema: "public",
table: "bids",
},
(payload) => {
console.log(payload);
}
)
.subscribe();
return () => {
supabase.removeAllChannels();
};
}, []);
I understand I can filter like filter: 'reservation_id=x'
but can I chain these together?silas
05/24/2023, 4:20 PMcovalenta
05/24/2023, 5:04 PMkevlust
05/24/2023, 5:07 PMvikay
05/24/2023, 5:43 PMWill_Buyers
05/24/2023, 5:47 PMWaldemar
05/24/2023, 6:27 PMminjunes
05/24/2023, 6:34 PMcoop
05/24/2023, 6:34 PMKiwiHour
05/24/2023, 6:41 PMsql
SELECT name FROM table WHERE REPLACE(name, ' ', '') ILIKE 'kiwi%'
How can I reproduce the replace function this using the supabase JS/TS client?stephenhandley
05/24/2023, 7:34 PMterrxo
05/24/2023, 8:06 PMhttps://cdn.discordapp.com/attachments/1111022415120715896/1111022415292674068/image.pngā¾
damith98kumara
05/24/2023, 8:17 PMhttps://cdn.discordapp.com/attachments/1111025083973107732/1111025084166066228/Screenshot_2023-05-25_014544.pngā¾
https://cdn.discordapp.com/attachments/1111025083973107732/1111025084526768218/Screenshot_2023-05-25_014622.pngā¾
iiPhaNatiCx
05/24/2023, 8:27 PMpreviewFeatures = ["multiSchema"]
. In doing so, when I ran npx prisma db push
it dropped the tables from the auth
schema in Supabase. Now when I try to create a user via UI or supabase.auth.admin.createUser()
I get the following error: AuthApiError: Database error checking email
. Has anyone ever ran into this before? Or is there a way I can restore the tables? Not looking to recover any data, just want to be able to create users again.terrxo
05/24/2023, 8:57 PMhttps://cdn.discordapp.com/attachments/1111035153003851888/1111035153230348379/image.pngā¾
MATTI
05/24/2023, 9:05 PMMicheal
05/24/2023, 9:07 PMhttps://cdn.discordapp.com/attachments/1111037729938079784/1111037730068111440/image.pngā¾