X
Xata5mo 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
Rick1825mo 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?
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server