An open API service indexing awesome lists of open source software.

https://github.com/andywer/json-sql-import

Small PHP tool to import JSON data into database tables using transformation rules.
https://github.com/andywer/json-sql-import

Last synced: 10 months ago
JSON representation

Small PHP tool to import JSON data into database tables using transformation rules.

Awesome Lists containing this project

README

          

json-sql-import
===============

Small PHP command line tool to import JSON data into database tables using transformation rules (templated SQL queries).

Usage
-----

```php
php json-import.php
```

Omit the options to print the help / usage notice.

Example
-------

Have a look at the [demo ruleset](https://github.com/andywer/json-sql-import/blob/master/rulesets/demo/test.json).

You would use this ruleset using `php json-import.php import demo/test path/to/data.json`. An appropriate JSON data file would have to look like this:

```json
[
{
"somevar": "hello world",
"somearray": [
{ "name": "somenumber", "value": 123.45 },
...
]
},

...
]
```

License
-------

This software is released under the MIT license. See [license](https://raw.github.com/andywer/json-sql-import/master/LICENSE).