nperez0111 / Pizza

Pizza Web App Point of Sale and API
1 stars 0 forks source link

Relational DataBase implementation #45

Closed nperez0111 closed 8 years ago

nperez0111 commented 8 years ago

The API needs to be expanded in order to run this type of query

SELECT symbols.Name, choiceHeadings.Title
FROM possibleChoices
INNER JOIN symbols
INNER JOIN choiceHeadings
ON symbols.ID=possibleChoices.SymbolID 
AND possibleChoices.HeadingID = choiceHeadings.ID

Other important implementations is the ability to create and drop tables for each special item. These of course would be added as features to the table class.

nperez0111 commented 8 years ago

Possible request JSON

{
 "data":{
  "tables":[
    "symbols",
    "choiceHeadings"
   ],
  "from":"possibleChoices",
  "relations":[
   [
     "symbols.ID",
     "possibleChoices.SymbolID"
   ]
  ],
  "select":[
     "symbols.Name",
     "choiceHeadings.Title"
   ]
  }
}
nperez0111 commented 8 years ago

Pretty Useful Stuff.

nperez0111 commented 8 years ago
tele.sendToDataBase({
    type: "GET",
    data: {
        tables: ["symbols", "choiceHeadings"],
        from: "possibleChoices",
        relations: [
            ["symbols.ID", "possibleChoices.SymbolID"],
            ["possibleChoices.HeadingID", "choiceHeadings.ID"]
        ],
        select: ["symbols.Name", "choiceHeadings.Title"]
    }
}, "join");

Working Code since 9465da153dd48468bee4a30b97903861b0059cdc