kroltan
kroltan
Explore posts from servers
KKysely
Created by kroltan on 7/23/2024 in #help
Subquery from a function
thank you for taking your time to explain things so clearly
16 replies
KKysely
Created by kroltan on 7/23/2024 in #help
Subquery from a function
nice, I'll use a the cast for now with a comment to upgrade when it comes out
16 replies
KKysely
Created by kroltan on 7/23/2024 in #help
Subquery from a function
Fair, yeah i need an explicit type here since it's an implementation of an abstract method, and the abstract method requires an explicit return type. $asScalar would be perfect here, since the other implementation of this method would be just a simple eb.lit(false)
16 replies
KKysely
Created by kroltan on 7/23/2024 in #help
Subquery from a function
thank you, that makes more sense yeah. what would be the return type I should use here? AliasableExpression<{ is_friend: SqlBool }> is not enough for kysely to resolve it as a single boolean. on the call site:
.select((eb) => [
"edit_mode",
session.queryIsFriendOf(eb.ref("author_id")).as("is_friend"),
])
.select((eb) => [
"edit_mode",
session.queryIsFriendOf(eb.ref("author_id")).as("is_friend"),
])
Then when accessing row.is_friend, I get back an object:
Deno: Argument of type { is_friend: SqlBool; } is not assignable to parameter of type boolean
(I can't use an implicit return type since this is actually an abstract method)
16 replies
KKysely
Created by kroltan on 7/23/2024 in #help
Subquery from a function
huh this loads something to do with publicKey or whatever which is the code from another question I had clicked earlier, idk what's up with that. must have not clicked to regenerate the hash or something, thoug i didnt see a buton for that. anyways
16 replies