WHAT IS KNEX ?
The SQL Query builder for java script. It features both traditional node style callbacks as well as a promise interface for cleaner asynchronize flow control, a stream interface, full featured query and schema builders, transaction support , connection pooling and standardized responses between different query clients and dialects.
WHY USING KNEX?
instead of just doing some query of your data bases to get data ,you can do a lots of things with the result of your query using java script
If you want to build something and you need your data from data bases you have to learn knex
HOW TO LEARN KNEX?
To start learning knex ,you should know about:
- java script
- data bases(specially migration)
- synchronize VS Asynchronize
If you know this 4 ,my suggestion for learning knex is ,first just go around the knex documentation and reads about the important question that you have to pay attention
- how query in knex working
- what does knex return(a promise!)
- how can we access the data bases from knex
- how we can do some stuff on the result of query of knex
make a small project for yourself and open the knex documentations to see how does query in knex works.
On that level you are going to learn details about how does knex works
My experience was on inserting data : the documentation mentioned that if you insert some data in your table, the result of the insert is you ides ,but in my project wasn’t working!!!, after a while i just find that i should use returning(id) to get my id back.
don’t be upset when you are beginner in learning knex ,specially when you used to sql ,be patient,you will get your goal:)