ezobjects
Advanced tools
Comparing version 2.5.5 to 2.5.6
const docket = require('docket-parser'); | ||
docket.title(`EZ Objects v2.5.5`); | ||
docket.title(`EZ Objects v2.5.6`); | ||
docket.linkClass('text-success'); | ||
docket.parseFiles(['index.js', 'mysql-connection.js']); | ||
docket.generateDocs('docs'); |
{ | ||
"name": "ezobjects", | ||
"version": "2.5.5", | ||
"version": "2.5.6", | ||
"description": "Easy dynamic object generation with optional MySQL table linking", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
# EZ Objects v2.5.5 | ||
# EZ Objects v2.5.6 | ||
@@ -343,16 +343,24 @@ EZ Objects is a Node.js module (that can also be usefully browserify'd) that aims to save you lots of time | ||
### An object configuration can have the following: | ||
### A basic object configuration can have the following: | ||
* **className** - `string` - (required) Name of the class | ||
* **properties** - `Array` - (required) An array of properties that the object (and MySQL table, if applicable) should contain | ||
* **properties** - `Array` - (required) An array of property configurations that the object (and MySQL table, if applicable) should have corresponding properties for | ||
* **extends** - `mixed` - (optional) The object that the new object should be extended from [required to extend object] | ||
### A MySQL object configuration can also have the following: | ||
* **extendsConfig** - `object` - (optional) The EZ Object configuration for the object that is being extended from [required to extend object for use with MySQL table link] | ||
* **tableName** - `string` - (optional) Provide if object should be linked with MySQL database table | ||
* **stringSearchField** - `string` - (optional) The name of a unique property of type `string` that you want to be able to load with as an alternative to `id` | ||
* **indexes** - `Array` - (optional) An array of indexes that should be created in the MySQL table, if applicable | ||
* **indexes** - `Array` - (optional) An array of MySQL index configurations that should be created in the MySQL table | ||
### A property configuration can have the following: | ||
### A basic property configuration can have the following: | ||
* **name** - `string` - (required) Name of the property, must conform to both JavaScript and MySQL rules | ||
* **type** - `string` - (required) JavaScript data type for the property | ||
* **getTransform** - `function` - (optional) Function that transforms and returns the property value prior to getting | ||
* **setTransform** - `function` - (optional) Function that transforms and returns the property value prior to setting | ||
### A MySQL property configuration can also have the following: | ||
* **mysqlType** - `string` - (optional) MySQL data type for the property [required for MySQL table association] | ||
@@ -372,8 +380,6 @@ * **length** - `number` - (optional) MySQL data length for the property [required for MySQL table association on some data types like VARCHAR] | ||
* **autoIncrement** - `boolean` - (optional) Indicates the property should be auto-incremented in the MySQL table | ||
* **getTransform** - `function` - (optional) Function that transforms and returns the property value prior to getting | ||
* **setTransform** - `function` - (optional) Function that transforms and returns the property value prior to setting | ||
* **saveTransform** - `function` - (optional) Function that transforms and returns the property value prior to saving in the database | ||
* **loadTransform** - `function` - (optional) Function that transforms and returns the property value after loading from the database | ||
### An index configuration can have the following (for MySQL table association only): | ||
### An MySQL index configuration can have the following (for MySQL table association only): | ||
@@ -380,0 +386,0 @@ * **name** - `string` - (required) Name of the index, can be arbitrary, but must be unique and not PRIMARY |
Sorry, the diff of this file is not supported yet
384949
408