Releases: jnterry/nano-orm
Releases · jnterry/nano-orm
Null Datetime Fix
- Fix bug where loading a null datetime from database resulted in an invalid moment instance, rather than null
JSON Schema Bug Fixes
- Add id field to JSON schema, and to toJSON output
- Ensure fields that are not required and that are null are not include in the toJSON
- Add unit tests to ensure the toJSON output meets the generated schema
- Other misc JSON schema fixes
JSON Schema Fix for Datetime Field
- Ensure that type field of generated JSON schema is always a valid value according to the JSON Schema spec
Datetime fields previously had the type "datetime" which is not valid, hence parsing a model's JSON representation through a conformant JSON object validator based on the schema resulted in errors. Datetime fields are now considered to be "strings" in the JSON schema with no further restrictions.
Datetime Fields
- Add support for "datetime" fields - automatically parse database string into moment instance
- Add jsdoc style documentation
JSON Schema
- Add a .schema property which is automatically generated and conforms to the "JSON Schema" specification
- Increase test coverage to 100%
JSON Serialization
Make toJSON include the field values only, IE: don't include any internal state of the Model instance
Instance Creation
- Add createFromRows method
- Make create() method also persist model to database
- Add constructor which creates instance without persisting to database (to replace old functionality of create)
- Ensure id field cannot be manually set - it is changed only when .save() is called on new instance
Convert to db-connection-promise
Convert the library to use the new "db-connection-promise" library, which is the successor of any-db-q.
npmignore
Dependency Fix
- Fix package.json dependencies, peerDependencies and devDependencies
- Fix pacakge.json's main field