#knexjs

2024-02-07

First time using knexjs.org/ today 😬 I have a lot to learn

#knexjs

nosh :fosstodon: (ʘ‿ʘ)nosherwan@fosstodon.org
2023-08-21

Unit Testing
Jest
Knex.js

I am looking for suggestions for testing knex.js functions in jest.
mocking knex via jest automock still leaves out knex.raw function.

How do you guys test your functions that utilise knex.js?

#db
#knexjs
#jest
#mock

nosh :fosstodon: (ʘ‿ʘ)nosherwan@fosstodon.org
2023-04-26

@wiredprairie nice to know.

For some years I was using ORMs but in the end that were too much of a hassle.

I use knex.js now, it is a middle ground between having complete string based queries to have some type safety that does not get in one's way.

#knexjs

nosh :fosstodon: (ʘ‿ʘ)nosherwan@fosstodon.org
2023-02-25

@sirber sorry autocorrect screwed my comment.

I used to use orms but they caused more problems.

I was spending more time figuring out how to write a query in orm syntax where as I knew already how to do it in sql.

Query builders come to the rescue they are in between orms and plain typless sql in code.

They provide some type safety but you can use sql in your backend framework.

Knex.js is the one I use.

#knexjs
#orm
#sql
#QueryBuilders

2022-04-28

For I use:





I only use typescript for loose typing and syntax completion. I dont use it for OOP.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst