Generating JSON output from Databases on the Command Line
April 17, 2011 on 12:00 pm | In software-dev |Hello, JSON fans,
This morning i wrote a small C application which can be used to fetch data from sqlite3 and MySQLv5 databases and convert it to JSON. While it was originally written as a test app for my C JSON library, it certainly has other uses.
It can be found here:
http://fossil.wanderinghorse.net/repos/cson/index.cgi/wiki/select-to-json
It “should” compile fine out of the box on any Linux-like system with gcc, bash, and GNU Make. Building on other platforms requires either converting the included Makefile logic to the platform’s build tool, or linking it against the “amalgamation build” of the underlying JSON library. The code is portable ANSI C-89 and should not require any platform-specific fixes.
Happy Hacking!
—– stephan beal
1 Comment »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^