ezobjects-mysql
Advanced tools
Comparing version 3.0.2 to 3.0.3
const docket = require(`docket-parser`); | ||
docket.title(`EZ Objects v3.0.2`); | ||
docket.title(`EZ Objects v3.0.3`); | ||
docket.linkClass(`text-success`); | ||
docket.parseFiles([`index.js`, `mysql-connection.js`]); | ||
docket.generateDocs(`docs`); |
@@ -96,3 +96,3 @@ /** | ||
enumerable: false, | ||
value: function (x) { const newArr = Array.from(this); newArr.push(x); this.splice(0, this.length); this.push(setIntArrayTransform(newArr, property)); return this.length; } | ||
value: function (x) { const newArr = Array.from(this); newArr.push(x); this.splice(0, this.length); this.push(setArrayTransform(newArr, property)); return this.length; } | ||
}); | ||
@@ -102,3 +102,3 @@ | ||
enumerable: false, | ||
value: function (x) { const newArr = Array.from(this); newArr.unshift(x); this.splice(0, this.length); this.push(setIntArrayTransform(newArr, property)); return this.length; } | ||
value: function (x) { const newArr = Array.from(this); newArr.unshift(x); this.splice(0, this.length); this.push(setArrayTransform(newArr, property)); return this.length; } | ||
}); | ||
@@ -108,3 +108,3 @@ | ||
enumerable: false, | ||
value: function (x, y, z) { const newArr = Array.from(this); newArr.fill(x, y, z); this.splice(0, this.length); this.push(setIntArrayTransform(newArr, property)); return this.length; } | ||
value: function (x, y, z) { const newArr = Array.from(this); newArr.fill(x, y, z); this.splice(0, this.length); this.push(setArrayTransform(newArr, property)); return this.length; } | ||
}); | ||
@@ -111,0 +111,0 @@ |
{ | ||
"name": "ezobjects-mysql", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Easy dynamic object generation with optional MySQL table linking", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,6 +0,6 @@ | ||
# EZ Objects - MySQL Edition - v3.0.2 | ||
# EZ Objects - MySQL Edition - v3.0.3 | ||
EZ Objects (MySQL Edition) is a Node.js module (that can also be usefully browserify'd) that aims to save | ||
you lots of time writing class objects that are strictly typed in JavaScript, and can be tied directly to | ||
MySQL database tablesby way of a mix of insert/update/load/delete class method signatures. All you have | ||
MySQL database tables by way of a mix of insert/update/load/delete class method signatures. All you have | ||
to do is create simple class configurations for each of your objects and then create them using the | ||
@@ -22,6 +22,6 @@ createClass() function. | ||
is a branch of the original `ezobjects` module that preserves the original MySQL table-linked capability, | ||
while the original `ezobjects` has had it removed so those who don't need to database storage can remove | ||
while the original `ezobjects` has had it removed so those who don't need the database storage can remove | ||
the dependency. It also worked out better that way so that `ezobjects` types can be different than MySQL | ||
types, which might be different from another database's types, etc. If you don't need MySQL capability, | ||
you can find the original package on [npm](https://www.npmjs.com/package/ezobjects) or [GitHub](https://github.com/om-mani-padme-hum/ezobjects.git). | ||
you can find the original `ezobjects` package on [npm](https://www.npmjs.com/package/ezobjects) or [GitHub](https://github.com/om-mani-padme-hum/ezobjects.git). | ||
@@ -34,4 +34,7 @@ ## Installation | ||
**Important Notes:** Your object must have a unique integer property named `id` to be able to use the MySQL | ||
functionality of EZ Objects. You must also use EZ Object's MySQLConnection class for your database connection. | ||
**Important Notes:** Each of your EZ Object tables must include an `int` or `integer` property named | ||
`id` that will be automatically configured to serve as an auto-incrementing primary index in the MySQL | ||
table that you are linking your object to. The `load` method will generally be based off hte `id` field, | ||
unless you specify a `stringSearchField`. Also note that ou must also use EZ Object's MySQLConnection class | ||
for your database connection for compatability purposes and to allow async/await functionality. | ||
@@ -209,7 +212,7 @@ ```javascript | ||
* **Parameter:** data - `PlainObject` - (optional) | ||
* **Description:** Create a new MyObject object and initialize it using either defaults or any provided key/value pairs in the plain object `data`. Keys can either be equal to the name of a property, or they can be have an underscore before the name of a property, as would be the case if you were to JSON.stringify() and then JSON.parse() an EZ Object. This allows for easy transferability in cases where JSON is used as the transfer medium. | ||
* **Description:** Create a new MyObject object and initialize it using either defaults or any provided key/value pairs in the plain object `data`. Keys can either be equal to the name of a property, or they can have an underscore before the name of a property, as would be the case if you were to JSON.stringify() and then JSON.parse() an EZ Object. This allows for easy transferability in cases where JSON is used as the transfer medium. | ||
### new MyObject([data]) | ||
* **Parameter:** data - `string` - (optional) | ||
* **Description:** Create a new MyObject object and initialize it using either defaults or any provided key/value pairs in the JSON encoded string `data`. Keys can either be equal to the name of a property, or they can be have an underscore before the name of a property, as would be the case if you were to JSON.stringify() an EZ Object. This allows for easy transferability in cases where JSON is used as the transfer medium. | ||
* **Description:** Create a new MyObject object and initialize it using either defaults or any provided key/value pairs in the JSON encoded string `data`. Keys can either be equal to the name of a property, or they can have an underscore before the name of a property, as would be the case if you were to JSON.stringify() an EZ Object. This allows for easy transferability in cases where JSON is used as the transfer medium. | ||
@@ -220,4 +223,3 @@ ### MyObject.init([data]) | ||
In addition, each property you define will have a single method that is a getter and setter, and | ||
it will have the following signatures: | ||
In addition, each property you define will have a single method that is a getter and setter, and it will have the following signatures: | ||
@@ -224,0 +226,0 @@ ### MyObject.myProperty() |
Sorry, the diff of this file is not supported yet
409905
390