- Knex.js is a “batteries included” SQL query builder for Postgres, MSSQL, MySQL, MariaDB, SQLite3, Oracle, and Amazon Redshift designed to be flexible, portable, and fun to use.
- https://knexjs.org/
const knex = require('knex')({
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'your_database_user',
password : 'your_database_password',
database : 'myapp_test'
}
});
- The heart of the library, the knex query builder is the interface used for building and executing standard SQL queries, such as
select, insert, update, delete.
- Identifier Syntax
- Where Clauses
- Join Methods
- OnClauses
- ClearClauses
- Having Clauses