Git Product home page Git Product logo

db-to-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

db-to-api's Issues

Rewrite Rules

I am very weak in the department of rewrite rules. So, if my current rewrite rule is this:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

and all pages are in the form of http://example.com/controller/action/params/, how should I update the rewrite rules for db-to-api or is it best just to run it along side of the application instead of trying to integrate with? Thanks.

Auth Keys

I am new to RESTful API. How would I go about adding an authentication key for making this a private RESTful API?

Error: "Invalid Database"

I've tried to use this on three different MySQL databases on two different servers, but it always yields the same error message: "Invalid Database." I haven't chased down the source of the problem, though I'm working on it.

Deployment Issue

Running into what seems like it should be a minor issue.

I am using a MySQL DB outlined here https://github.com/tyronegrandison/DOL-ILAB/blob/master/CREATE%20DATABASE%20DOLILAB

I set the config file as specified in the readme to:

DOLILAB, 'username' => '', 'password' => '', 'server' => 'localhost', 'port' => 8889, 'type' => 'mysql', 'table_blacklist' => array('cache', 'passwords'), 'column_blacklist' => array('password_hint'), ); register_db_api( 'ilab', $args ); When I look up http://localhost:8889/ilab/good.json, I get the error that can be seen here https://drive.google.com/file/d/0B0bPjGaTVcWed1lrb1dGVlpuck0/view?usp=sharing

Resolve semantic conflicts

There are some inconsistencies and formatting problems between CSV to API and DB to API, and I think it would be wise to standardize between the two. Those inconsistencies are:

  • Should the sorting of results be done via "sort" or "order"?
  • Should the direction of sorting be done via "sort_by" or "order_by"?
  • Should the readme file be README.md or readme.md?
  • Given the generic nature of the names of these programs, should there be a stylized display of them each time that they're used (e.g., in italics or in bold) in order to set them apart?
  • Is the name of this project "DB to API," "Database to API," or "Database to Restful API"?

Connect ORACLE

@KristenHoney is correct for connect in Oracle?
#14

$args = array( 
            'name' => '//192.168.96.93:1521/ORCL',
            'username' => 'user',
            'password' => 'pass',
            'type' => 'oracle',
            'table_blacklist' => array(),
            'column_blacklist' => array(),
);

register_db_api( 'oradw', $args );

"Must select a database"

I set up the config.php as instructed and I'm getting "Must select a database." Is there nothing else I need to edit?

Abstract the PDO connection

The PDO connection is being made like such:

new PDO("mysql:host={$db->server};dbname={$db->name}", $db->username, $db->password );

This is obviously not database agnostic, as it needs to be.

api specs

[Enhancement] Is there a way to avoid the [database-name] in the request url ?

I mean to specify in the config that this, and only this, database will be used.

The user would then only specify /table[/column][/value].format, with the classical convention that fields between brackets are optional.

HTML and XML rendering functions don't yet exist

DB_API has the following two functions:

function render_html( $data ) {

    var_dump( $data );
}


function render_xml( $data ) {

    echo "XML HERE";

}

These two functions need to actually perform the advertised tasks.

HTML render should be escaped

The render_html() method does not sanitize outputs. If a database field contains <script>alert(1)</script>, this will lead to code execution in the user's browser.

Simple fix, change from this:

    		echo "\t<td>$cell</td>\n";

...to this:

    		$cell = htmlspecialchars($cell);
    		echo "\t<td>$cell</td>\n";

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.