X
Xata8mo ago
Rick182

Non-default file attributes not accessible via Kysely query builder

If I try to fetch a file.signedUrl or file.uploadUrl using the Kysely query builder, null is returned even though the file exists. Are these properties only accessible via the Xata SDK as of now? If yes, this is a bit annoying because my Schema is very normalized and I need a lot of JOINs that are unsupported by the SDK atm. I tried several different methods to access the file.signedUrl property but this one would be the easiest way to access it (if it would work):
await kyseleyClient
.selectFrom('Files')
.select(({ ref }) => [ref('file', '->').key('signedUrl')])
.execute();
await kyseleyClient
.selectFrom('Files')
.select(({ ref }) => [ref('file', '->').key('signedUrl')])
.execute();
2 Replies
Rick182
Rick182OP8mo ago
Another thing that is a bit weird is the reserved xata column. Properties of it are not accessible using the syntax I mentioned above but only using raw SQL like this:
await kyseleyClient
.selectFrom('Files')
.select([sql<Date>`"Files"."xata.updatedAt"`])
.execute()
await kyseleyClient
.selectFrom('Files')
.select([sql<Date>`"Files"."xata.updatedAt"`])
.execute()
Isn't it a jsonb object aswell?
exekias
exekias8mo ago
Hi @Rick182 ! I'm afraid it's not possible to access signedUrl via SQL as of today, you would need to use the data API (ie with the Xata SDK) to get this field. We have been discussing this issue internally and want to eventually expose signedUrl & others via SQL!
Want results from more Discord servers?
Add your server