refactor(server): use helpers for shared link queries#27088
refactor(server): use helpers for shared link queries#27088michelheusschen wants to merge 6 commits intomainfrom
Conversation
|
It's fixed in #27063, right? So this shouldn't be necessary anymore? |
|
Ah yeah you're right. The changes + migration in that PR also solve the issue. I still think this change is worth keeping. It makes |
|
I can't tell if this has any performance implications, if it doesn't I'm happy to get this in too though :) (cc @mertalev) |
| .whereRef('user.id', '=', 'album.ownerId') | ||
| .where('user.deletedAt', 'is', null) | ||
| .as('owner'), | ||
| (eb) => withAlbumOwner(eb).selectAll('user').as('owner'), |
There was a problem hiding this comment.
Is there a reason we select all columns here? It seems like it should select columns explicitly like the other one (we also have constants for selected columns in database.ts)
There was a problem hiding this comment.
The owner gets serialized by mapUser which only reads public user fields, so I changed the query to .select(columns.user)
| export const withExifInfo = (eb: ExpressionBuilder<DB, 'asset'>) => { | ||
| return eb | ||
| .selectFrom('asset_exif') | ||
| .selectAll('asset_exif') |
There was a problem hiding this comment.
Not sure if there's much benefit for this one, but I've changed it as well
getthat's already in use bygetAll