TheMelonAssassin
Making Updateable<X> fields required
Excuse me if this has already been posted, but I recently turned on strict mode after completing my migration to TS and I'm struggling to make certain fields required when updating an entity.
When I hover over
UpdateableActivity
it shows:
but hovering over Updateable
shows:
if possible I'd like it to be something like:
https://kyse.link/MA3jQ is my playground link if that helps!6 replies
Issue with how timestamptz is returned depending on main or subquery
I'm running into the following issue where my date is returned in two different ways. Date is a
timestamptz
type column
When I grab the lesson as followed:
I receive "date": "2024-09-13T22:00:00.000Z"
When I use a subquery like this:
I receive "date": "2024-09-14T00:00:00+02:00"
15 replies
Creating helper functions
I've gotten to the point in my application where a lot of the objects I'm building in my queries are returning in other queries.
In the following example I'd like to extract the module (with color) into something I can use in other queries.
I've been trying to find the correct (and working) way to this
14 replies
Issue with select
How would I handle doing what I'm doing in the raw part during the select?
I get the following error:
No overload matches this call.
Overload 1 of 3, '(selections: readonly SelectExpression<Database & { townhallDistribution: { level: number; amount: string | number | bigint; }; }, "clan">[]): SelectQueryBuilder<Database & { ...; }, "clan", { ...; }>', gave the following error.
Type 'RawBuilder<unknown>' is not assignable to type 'SelectExpression<Database & { townhallDistribution: { level: number; amount: string | number | bigint; }; }, "clan">'.
Type 'RawBuilder<unknown>' is missing the following properties from type 'DynamicReferenceBuilder<any>': #private, dynamicReference, refType
Overload 2 of 3, '(callback: SelectCallback<Database & { townhallDistribution: { level: number; amount: string | number | bigint; }; }, "clan">): SelectQueryBuilder<Database & { ...; }, "clan", { ...; }>', gave the following error.
Argument of type '(string | RawBuilder<unknown>)[]' is not assignable to parameter of type 'SelectCallback<Database & { townhallDistribution: { level: number; amount: string | number | bigint; }; }, "clan">'.
Type '(string | RawBuilder<unknown>)[]' provides no match for the signature '(eb: ExpressionBuilder<Database & { townhallDistribution: { level: number; amount: string | number | bigint; }; }, "clan">): readonly SelectExpression<Database & { ...; }, "clan">[]'.
Overload 3 of 3, '(selection: SelectExpression<Database & { townhallDistribution: { level: number; amount: string | number | bigint; }; }, "clan">): SelectQueryBuilder<Database & { ...; }, "clan", { ...; }>', gave the following error.
Argument of type '(string | RawBuilder<unknown>)[]' is not assignable to parameter of type 'SelectExpression<Database & { townhallDistribution: { level: number; amount: string | number | bigint; }; }, "clan">'.ts(2769)
14 replies
Issue with migrating from knex
I've recently learned about Kysely and how it is very compatible with TS compared to Knex.
I'm also very new to coding in general and have been following the structure I was taught at school earlier this year but I'm struggling right now to migrate the file that initializes data and shuts it down.
If anyone would be so kind to help me figure out how to move this from Knex to Kysely!
5 replies