{"action":"created","issue":{"url":"https://api.github.com/repos/simple-mvc-framework/framework/issues/281","labels_url":"https://api.github.com/repos/simple-mvc-framework/framework/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/simple-mvc-framework/framework/issues/281/comments","events_url":"https://api.github.com/repos/simple-mvc-framework/framework/issues/281/events","html_url":"https://github.com/simple-mvc-framework/framework/pull/281","id":123087118,"number":281,"title":"Database Engine and Service refactored.","user":{"login":"tomvlk","id":3877688,"avatar_url":"https://avatars.githubusercontent.com/u/3877688?v=3","gravatar_id":"","url":"https://api.github.com/users/tomvlk","html_url":"https://github.com/tomvlk","followers_url":"https://api.github.com/users/tomvlk/followers","following_url":"https://api.github.com/users/tomvlk/following{/other_user}","gists_url":"https://api.github.com/users/tomvlk/gists{/gist_id}","starred_url":"https://api.github.com/users/tomvlk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomvlk/subscriptions","organizations_url":"https://api.github.com/users/tomvlk/orgs","repos_url":"https://api.github.com/users/tomvlk/repos","events_url":"https://api.github.com/users/tomvlk/events{/privacy}","received_events_url":"https://api.github.com/users/tomvlk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":44,"created_at":"2015-12-19T14:08:47Z","updated_at":"2015-12-19T19:09:17Z","closed_at":"2015-12-19T19:04:27Z","pull_request":{"url":"https://api.github.com/repos/simple-mvc-framework/framework/pulls/281","html_url":"https://github.com/simple-mvc-framework/framework/pull/281","diff_url":"https://github.com/simple-mvc-framework/framework/pull/281.diff","patch_url":"https://github.com/simple-mvc-framework/framework/pull/281.patch"},"body":"# Changes. Merge Ready.\r\n**The following actions have been taken to improve the overall structure of the new Database Engines.**\r\n- [x] Adding a generic interface to have generic and non engine dependend functions for executing queries.\r\n- [x] Making the services work with the new engines. Adding support for multiple inserts.\r\n- [x] Adding a demo for all the newest changes.\r\n- [x] Adding more configurable stuff for engines\r\n- [x] Providing better PHPDoc.\r\n- [x] Providing legacy calls on mysql engine.\r\n- [x] Adding raw prepare function on PDO engines.\r\n\r\n## Function changes\r\nBasically, only the functions are a bit different.\r\n\r\n## Changes on replaced functions\r\nThere are only some adjustments on the above replaced functions, listed bellow:\r\n\r\n#### select\r\n- Will be using the default fetch method that you gave in the config when not giving in the parameter.\r\n- When no fetch method is given in the config it will use the FETCH_OBJ.\r\n- Will return better error status, return false on failure earlier than before. Also on empty response it will return false.\r\n\r\n#### insert\r\n- Can handle **Multiple Inserts**. You can do this by giving a multidimensional array in the $data parameter.\r\n- Can handle transactions, and will rollback if 1 error is discovererd. Default it is not being used!\r\n- Will return multiple inserted id's when giving multiple inserts.\r\n\r\n#### update\r\n- On the mysql engine it will you can use the limit parameter.\r\n\r\n#### delete\r\n- On the mysql engine it will you can use the limit parameter.\r\n\r\n#### NEW: raw / rawQuery\r\nCan execute simple queries, with no extra binding values. Will return an array or false.\r\nFor example you can use this to truncate the table.\r\nexecuteSimpleQuery(\"TRUNCATE table;\");\r\n\r\n#### NEW: rawPrepare\r\nWill return a prepared statement, for all PDO drivers this will be a PDOStatement object.\r\n\r\n\r\n## MySQL Service Changes\r\n- create: Can handle multiple inserts too.\r\n\r\n\r\n## The old helper:\r\nThe old helper is now a wrapper around the MySQL engine.\r\n\r\n## Demo's\r\nSee the file app/Controllers/Demo.php for some examples on how to use.\r\nWe need to make better examples later."},"comment":{"url":"https://api.github.com/repos/simple-mvc-framework/framework/issues/comments/166016791","html_url":"https://github.com/simple-mvc-framework/framework/pull/281#issuecomment-166016791","issue_url":"https://api.github.com/repos/simple-mvc-framework/framework/issues/281","id":166016791,"user":{"login":"LuckyCyborg","id":13488485,"avatar_url":"https://avatars.githubusercontent.com/u/13488485?v=3","gravatar_id":"","url":"https://api.github.com/users/LuckyCyborg","html_url":"https://github.com/LuckyCyborg","followers_url":"https://api.github.com/users/LuckyCyborg/followers","following_url":"https://api.github.com/users/LuckyCyborg/following{/other_user}","gists_url":"https://api.github.com/users/LuckyCyborg/gists{/gist_id}","starred_url":"https://api.github.com/users/LuckyCyborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuckyCyborg/subscriptions","organizations_url":"https://api.github.com/users/LuckyCyborg/orgs","repos_url":"https://api.github.com/users/LuckyCyborg/repos","events_url":"https://api.github.com/users/LuckyCyborg/events{/privacy}","received_events_url":"https://api.github.com/users/LuckyCyborg/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T19:09:17Z","updated_at":"2015-12-19T19:09:17Z","body":"@tomvlk BTW, you do not write a **Service** for **SQLite** too?"}}