You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, and thanks for maintaining this wonderful library!
I encountered a problem trying to set updatedAt inside onConflict.
interfaceItemTable{uniqueKey: string;value: number;// maybe I can change something here?updatedAt: ColumnType<Date,never,string|undefined>;}typeNewItem=Insertable<ItemTable>;interfaceDatabase{item: ItemTable;}constdialect=newPostgresDialect({pool: newPool({ ...config}),});constdb=newKysely<Database>({
dialect,});functionupsertItems(items: NewItem[]): Promise<InsertResult[]>{returndb.insertInto("item").values(items).onConflict((oc)=>oc.column("uniqueKey").doUpdateSet({// no problem setting a regular value:value: (eb)=>eb.ref("excluded.value"),// TS error on the following lineupdatedAt: (eb)=>eb.ref("excluded.updatedAt"),})).execute();}
TS error:
Property '#private' in type 'ExpressionWrapper' refers to a different member that cannot be accessed from within type 'SelectQueryBuilder'
Looks like the problem is related to the fact that updatedAt is defined using ColumnType.
It's not critical though, I worked this around by changing the line inside onConflict to:
updatedAt: (eb)=>eb.sql`now()`,
The text was updated successfully, but these errors were encountered:
Hi, and thanks for maintaining this wonderful library!
I encountered a problem trying to set
updatedAt
insideonConflict
.TS error:
Looks like the problem is related to the fact that
updatedAt
is defined usingColumnType
.It's not critical though, I worked this around by changing the line inside
onConflict
to:The text was updated successfully, but these errors were encountered: