decho
decho
Explore posts from servers
KKysely
Created by tzezar on 7/3/2024 in #help
Is it possible to change type of returned value with jsonBuildObject?
👍
16 replies
KKysely
Created by tzezar on 7/3/2024 in #help
Is it possible to change type of returned value with jsonBuildObject?
not that i advice doing that but if you have no other option
16 replies
KKysely
Created by tzezar on 7/3/2024 in #help
Is it possible to change type of returned value with jsonBuildObject?
you can "lie" to kysely and use the .$castTo helper.
jsonBuildObject({
id: eb.ref('domyslnaStawkaVatSprzedazy.id'),
nazwa: eb.ref('domyslnaStawkaVatSprzedazy.nazwa'),
wartosc: eb.ref('domyslnaStawkaVatSprzedazy.wartosc').$castTo<number>(),
}).as('domyslnaStawkaVatSprzedazy'),
jsonBuildObject({
id: eb.ref('domyslnaStawkaVatSprzedazy.id'),
nazwa: eb.ref('domyslnaStawkaVatSprzedazy.nazwa'),
wartosc: eb.ref('domyslnaStawkaVatSprzedazy.wartosc').$castTo<number>(),
}).as('domyslnaStawkaVatSprzedazy'),
16 replies
KKysely
Created by decho on 7/1/2024 in #help
How to infer an aggregated column with `filterWhere` clause as nullable?
All right, thank you @Igal I will figure something out, most likely with $castTo or maybe even restructure my query. I was also thinking, if $nonNull is a helper, shouldn't there be a $nullable helper as well, not sure if that's a good idea or not haha 🙂 But anyway, cheers!
5 replies
KKysely
Created by bombillazo on 6/20/2024 in #help
How to do `LIKE ANY` query in Kysely?
you can try something like this: https://kyse.link/0RE11 However, I am not sure this is the best possible way to do this. Not particularly happy I had to use sql for the array.
3 replies
KKysely
Created by decho on 6/11/2024 in #help
Question about ColumnTypes and dates.
I will settle for sticking with date objects and do all the transformations in the app itself
10 replies
KKysely
Created by decho on 6/11/2024 in #help
Question about ColumnTypes and dates.
I think this answers my question, appreciate the reply as always
10 replies
KKysely
Created by decho on 6/11/2024 in #help
Question about ColumnTypes and dates.
but yeah i can understand if you add a 4th type that can cause some issues, so it's probably more trouble than it's worth
10 replies
KKysely
Created by decho on 6/11/2024 in #help
Question about ColumnTypes and dates.
so I was just wondering if there was a workaround within kysely
10 replies
KKysely
Created by decho on 6/11/2024 in #help
Question about ColumnTypes and dates.
I think node-postgres does this DATE->JS Date transformation out of the box, and yes I'm aware I can tweak it: pg.types.setTypeParser(pg.types.builtins.DATE, v => String(v)); (something like this), but then if i need to work with a Date object in my JS application, I would then need to convert it back once more, it becomes ugly
10 replies
KKysely
Created by EspadaV8 on 1/3/2024 in #help
"Correct" way to create a unique index with some raw SQL
yeah
17 replies
KKysely
Created by EspadaV8 on 1/3/2024 in #help
"Correct" way to create a unique index with some raw SQL
ah right, you have to right click a comment in this thread
17 replies
KKysely
Created by EspadaV8 on 1/3/2024 in #help
"Correct" way to create a unique index with some raw SQL
good question
17 replies
KKysely
Created by EspadaV8 on 1/3/2024 in #help
"Correct" way to create a unique index with some raw SQL
👏
17 replies
KKysely
Created by EspadaV8 on 1/3/2024 in #help
"Correct" way to create a unique index with some raw SQL
and no problem
17 replies
KKysely
Created by EspadaV8 on 1/3/2024 in #help
"Correct" way to create a unique index with some raw SQL
im happy to hear that man
17 replies