Jam
Why does kysely-codegen generate the schema in node_modules?
Like probably many people here, I use https://github.com/RobinBlomberg/kysely-codegen .
By default, the DB schema file is generated inside the node_modules. It can be changed of course, but I wonder why that is the default?
I was expecting that file to be something you keep in versioning.
6 replies
Convert date to timestamptz
Hello. I'm trying to convert the following query from TypeORM querybuilder to Kysely:
itemRepository
.createQueryBuilder()
.select()
.where({ id })
.andWhere('sys_period @> :timestamp::timestamptz', { timestamp })
.getOne();
My attempt:
db.selectFrom('item')
.selectAll()
.where('id', '=', id)
.where('sys_period', '@>', [timestamp]);
However type is mismatched, I need to somehow convert the Date to a timestamptz. Any idea where I could define such mapping?
7 replies