Dska
Dska
KKysely
Created by Dska on 11/22/2023 in #help
Typing issue when working with onConflict
Hi, so i was trying to use some of examples https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#onConflict I want to update column of json type in case of conflict
.onConflict((co) =>
co
.columns(['clinicId', 'eventGroupTag'])
.doUpdateSet((eb) => ({
dayLimit: eb.ref('excluded.dayLimit')
})),
)
.onConflict((co) =>
co
.columns(['clinicId', 'eventGroupTag'])
.doUpdateSet((eb) => ({
dayLimit: eb.ref('excluded.dayLimit')
})),
)
and get this error
TS2322: Type '(eb: ExpressionBuilder<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">>) => ExpressionWrapper<...>' is not assignable to type 'ValueExpression<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">, string | null> | undefined'.   Type '(eb: ExpressionBuilder<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">>) => ExpressionWrapper<...>' is not assignable to type 'OperandExpressionFactory<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">, string | null>'.     Type 'ExpressionWrapper<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">, JsonValue>' is not assignable to type 'OperandExpression<string | null>'.       Property 'isSelectQueryBuilder' is missing in type 'ExpressionWrapper<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">, JsonValue>' but required in type 'SelectQueryBuilderExpression<Record<string, string | null>>'.
TS2322: Type '(eb: ExpressionBuilder<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">>) => ExpressionWrapper<...>' is not assignable to type 'ValueExpression<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">, string | null> | undefined'.   Type '(eb: ExpressionBuilder<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">>) => ExpressionWrapper<...>' is not assignable to type 'OperandExpressionFactory<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">, string | null>'.     Type 'ExpressionWrapper<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">, JsonValue>' is not assignable to type 'OperandExpression<string | null>'.       Property 'isSelectQueryBuilder' is missing in type 'ExpressionWrapper<OnConflictDatabase<DB, "clinicEventSetting">, OnConflictTables<"clinicEventSetting">, JsonValue>' but required in type 'SelectQueryBuilderExpression<Record<string, string | null>>'.
However query goes ok I guess that might be connected with https://github.com/RobinBlomberg/kysely-codegen because I am working with generated types
9 replies