Skip to content

romitamgai/orm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ORM using nodejs

  1. Go to the project folder and run: npm install
  2. Change the database connection string in index.js according to your mysql credentials
  3. Create employee table with fields id, name, designation, about_employee, created_at, updated_at, salary
  4. Run: npm start
  5. open the api in localhost:3000/employee
  6. Use the select queries:
  • localhost:3000/employee?name=Romit which is equivalent to "Select * from employee where name='Romit'"
  • localhost:3000/employee?name[like]=%a% which is equivalent to "Select * from employee where name like '%a%'"
  • localhost:3000/employee?name[like]=%a%&sort[desc]=name which is equivalent to "Select * from employee where name like '%a%' order by name desc"
  • localhost:3000/employee?start=1&offset=10 which is equivalent to "Select * from employee limit 1,10"
  1. Custom query builder is on the branch custom-query-builder

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published