Browse files

Updated make file, readme and docs

  • Loading branch information...
1 parent dd0bd6b commit 837c09adeee9b9a333847890669a7b6930329c30 @doug-martin doug-martin committed Jan 31, 2012
Showing with 134 additions and 26 deletions.
  1. +3 −0 .gitmodules
  2. +21 −0 LICENSE
  3. +1 −1 Makefile
  4. +100 −21 README.md
  5. +4 −1 docs/index.html
  6. +4 −2 package.json
  7. +0 −1 support/jsdoc
  8. +1 −0 support/jsdoc
View
3 .gitmodules 100755 → 100644
@@ -1,3 +1,6 @@
[submodule "support/jscoverage"]
path = support/jscoverage
url = git://github.com/visionmedia/node-jscoverage.git
+[submodule "support/jsdoc"]
+ path = support/jsdoc
+ url = git@github.com:doug-martin/jsDoc-code-view.git
View
21 LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2012 Pollenware
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
2 Makefile
@@ -3,7 +3,7 @@ PWD = `pwd`
JSCOV = support/jscoverage/node-jscoverage
JS_FILES = $(shell find ./lib | grep index.js && find lib | awk '!/index.js/ && /.js/' )
BENCHMARKS = `find benchmark -name *.benchmark.js `
-DOC_COMMAND=java -jar ./support/jsdoc/jsrun.jar ./support/jsdoc/app/run.js -t=./support/jsdoc/templates/CoolTemplate -d=./docs/api -D="github:doug-martin/patio-query"
+DOC_COMMAND=java -jar ./support/jsdoc/jsrun.jar ./support/jsdoc/app/run.js -t=./support/jsdoc/templates/CoolTemplate -d=./docs/api -D="github:pollenware/patio"
test:
export NODE_PATH=$NODE_PATH:lib && node test/runner.js
View
121 README.md
@@ -1,28 +1,107 @@
-#Patio
-
-##Overview
-
-ORM for node. See usage
+##[Patio](http://pollenware.github.com/patio/index.html)
+
+Patio-query is a [Sequel](http://sequel.rubyforge.org/" target="patioapi") inspired query engine and [ORM](http://en.wikipedia.org/wiki/Object-relational_mapping).
## Installation
npm install patio
-##Usage
-
-* [Patio](http://pollenware.github.com/patio/symbols/patio.html)
-* [Connecting to a database.](http://pollenware.github.com/patio/symbols/patio.html#createConnection)
-* Models
- * [Define a model](http://pollenware.github.com/patio/symbols/patio.html#addModel)
- * [Model Class](http://pollenware.github.com/patio/symbols/Model.html) returned from defining a model
- * [Associations](http://pollenware.github.com/patio/symbols/patio.plugins.AssociationPlugin.html)
- * [Querying](http://pollenware.github.com/patio/symbols/patio.plugins.QueryPlugin.html)
- * [Caching](http://pollenware.github.com/patio/symbols/patio.plugins.CachePlugin.html)
- * [Timestamp](http://pollenware.github.com/patio/symbols/patio.plugins.TimeStampPlugin.html)
-* [Migrations](http://pollenware.github.com/patio/symbols/Migrations.html)
-* Adapters
- * [mysql](http://pollenware.github.com/patio/symbols/patio.adapters.mysql.html)
- * [Types](http://pollenware.github.com/patio/symbols/patio.adapters.mysql.types.html)
+
+##Example
+
+```javascript
+
+ var patio = require("./index");
+ var comb = require("comb");
+
+ patio.camelize = true;
+var createSchema = patio.connectAndExecute("mysql://test:testpass@localhost:3306/airports", function (db) {
+ db.forceDropTable(["legInstance", "flightLeg", "flight", "airplane", "canLand", "airplaneType", "airport"]);
+ db.createTable("airport", {engine:"innodb"}, function () {
+ this.primaryKey("id");
+ this.airportCode(String, {size:4, allowNull:false, unique:true});
+ this.name(String, {allowNull:false});
+ this.city(String, {allowNull:false});
+ this.state(String, {size:2, allowNull:false});
+ });
+ db.createTable("airplaneType", {engine:"innodb"}, function () {
+ this.primaryKey("id");
+ this.name(String, {allowNull:false});
+ this.maxSeats(Number, {size:3, allowNull:false});
+ this.company(String, {allowNull:false});
+ });
+ db.createTable("flight", {engine:"innodb"}, function () {
+ this.primaryKey("id");
+ this.weekdays("set", {elements:["M", 'T', "W", "TH", "F", "S", "SU"], allowNull:false});
+ this.airline(String, {allowNull:false});
+ });
+ db.createTable("canLand", {engine:"innodb"}, function () {
+ this.foreignKey("airplaneTypeId", "airplaneType", {key:"id"});
+ this.foreignKey("airportId", "airport", {key:"airportCode", type : String, size : 4});
+ });
+ db.createTable("airplane", {engine:"innodb"}, function () {
+ this.primaryKey("id");
+ this.totalNoOfSeats(Number, {size:3, allowNull:false});
+ this.foreignKey("typeId", "airplaneType", {key:"id"});
+ });
+ db.createTable("flightLeg", {engine:"innodb"}, function () {
+ this.primaryKey("id");
+ this.scheduledDepartureTime("time");
+ this.scheduledArrivalTime("time");
+ this.foreignKey("departureCode", "airport", {key:"airportCode", type : String, size : 4});
+ this.foreignKey("arrivalCode", "airport", {key:"airportCode", type : String, size : 4});
+ this.foreignKey("flightId", "flight", {key:"id"});
+ });
+ db.createTable("leg_instance", {engine:"innodb"}, function () {
+ this.primaryKey("id");
+ this.date("date");
+ this.arrTime("datetime");
+ this.depTime("datetime");
+ this.foreignKey("airplaneId", "airplane", {key:"id"});
+ this.foreignKey("flight_legId", "flightLeg", {key:"id"});
+ });
+});
+createSchema.then(function(DB){
+ var ds = DB.from('airport');
+ comb.executeInOrder(ds, patio, function(ds, patio){
+ ds.multiInsert([{airportCode:"OMA", name:"Eppley Airfield", city:"Omaha", state:"NE"},
+ {airportCode:"ABR", name:"Aberdeen", city:"Aberdeen", state:"SD"},
+ {airportCode:"ASE", name:"Aspen Pitkin County Airport", city:"Aspen", state:"CO"}]);
+ ds.forEach(function(airport){
+ console.log(airport.airportCode);
+ });
+ patio.disconnect();
+ });
+});
+```
+
+##Features
+* [Comprehensive documentation with examples](http://pollenware.github.com/patio/index.html).
+* > 80% test coverage
+* [Support for connection URIs and objects](http://pollenware.github.com/patio/connecting.html)
+* Supported Databases
+ * MySQL
+ * Postgres - Coming Soon!
+* [Models](http://pollenware.github.com/patio/models.html)
+* [Associations](http://pollenware.github.com/patio/associtaions.html)
+* Simple adapter extensions
+* [Migrations](http://pollenware.github.com/patio/migrations.html)
+ * Integer and Timestamp based.
+* [Powerful query API](http://pollenware.github.com/patio/querying.html)
+* [Transactions](http://pollenware.github.com/patio/api/symbols/patio.Database.html#transaction)
+ * Savepoints
+ * Isolation Levels
+ * Two phase commits
+* SQL Datatype casting
+* [Full database CRUD operations](http://pollenware.github.com/patio/DDL.html)
+ * [createTable](http://pollenware.github.com/patio/api/symbols/patio.Database.html#createTable)
+ * [alterTable](http://pollenware.github.com/patio/api/symbols/patio.Database.html#alterTable)
+ * [dropTable](http://pollenware.github.com/patio/api/symbols/patio.Database.html#dropTable)
+ * [insert](http://pollenware.github.com/patio/api/symbols/patio.Dataset.html#insert)
+ * [multiInsert](http://pollenware.github.com/patio/api/symbols/patio.Dataset.html#multiInsert)
+ * [update](http://pollenware.github.com/patio/api/symbols/patio.Dataset.html#update)
+ * [remove](http://pollenware.github.com/patio/api/symbols/patio.Dataset.html#remove)
+ * [filter](http://pollenware.github.com/patio/api/symbols/patio.Dataset.html#filter)
##License
@@ -33,4 +112,4 @@ MIT <https://github.com/Pollenware/patio/raw/master/LICENSE>
* Code: `git clone git://github.com/pollenware/patio.git`
* JsDoc: <http://pollenware.github.com/patio>
-* Website: <http://pollenware.com> - Twitter: <http://twitter.com/pollenware> - 877.465.4045
+* Website: <http://pollenware.com> - Twitter: <http://twitter.com/pollenware> - 877.465.4045
View
5 docs/index.html
@@ -177,7 +177,10 @@ <h1 class="classTitle">Patio</h1>
</ul>
</li>
<li>Simple adapter extensions</li>
- <li>Powerful <a href="./api/symbols/patio.Dataset.html#filter" target="patioapi">query</a> API</li>
+ <li><a href="./migrations.html">Migrations</a>
+ <ul>Integer and Timestamp based.</ul>
+ </li>
+ <li>Powerful <a href="./querying.html">query</a> API</li>
<li><a href="./api/symbols/patio.Database.html#transaction" target="patioapi">Transactions</a> with
<ul>
<li>Savepoints</li>
View
6 package.json
@@ -2,11 +2,13 @@
"name": "patio",
"description": "Patio query engine and ORM",
"version": "0.0.1",
- "keywords" : ["ORM", "object relation mapper", "relational", "mapper", "moose","mysql", "MySQL", "MySql", "SQL", "sql", "query", "database", "dataset"],
+ "keywords" : ["ORM", "object relation mapper", "relational", "mapper", "moose","mysql", "MySQL", "MySql",
+ "SQL", "sql", "query", "database", "dataset", "transactions", "DDl", "Sequel", "migrations"],
"repository": {
"type": "git",
- "url": "git@github.com:doug-martin/patio-query.git"
+ "url": "git@github.com:pollenware/patio.git"
},
+ "homepage": "http://pollenware.github.com/patio/index.html",
"author": "Pollenware (http://pollenware.github.com)",
"main": "index.js",
"dependencies" :
View
1 support/jsdoc
1 support/jsdoc
@@ -0,0 +1 @@
+Subproject commit c330f34e4bbc0ffba1ef828eb23d8d5fe5a659ea

0 comments on commit 837c09a

Please sign in to comment.