Skip to content
Simple Object.js ORM example copied from Vincit/objection.js
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cypress
images
migrations
src
.gitignore
README.md
circle.yml
client.js
cypress.json
knexfile.js
package-lock.json
package.json
renovate.json

README.md

objection-example renovate-app badge CircleCI

Simple Object.js ORM example copied from Vincit/objection.js

This example was copied from folder examples/express-es7 of github.com/Vincit/objection.js. See Objection.js docs

The original client code that makes HTTP requests is in client.js but for this demo we are going to use Cypress Test Runner with @bahmutov/cy-api plugin.

Tests

Install

npm ci

Run

To start local server and open Cypress

npm run dev

Tests

There are several specs in cypress/integration folder

  • movies-spec.js shows how to add a new movie, and how the API checks for required fields to be present
  • spec.js shows complex calls to insert multiple entities in a single call, updating multiple objects using "upsert"

More info

Small print

Author: Gleb Bahmutov <gleb.bahmutov@gmail.com> © 2019

Original License: See github.com/Vincit/objection.js Additions showing logs and Cypress tests under MIT License - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github

You can’t perform that action at this time.