Pages

Thursday, July 4, 2013

What's new in Json Server ??

As a part of Drizzle , I just started changing the internals of JSON Server with the help of Stewart.
So, what's new ? . That is a big question for this plugin. Last time I did some re-factoring and implemented some new functionalities. Right now I am not focusing on functionality part too much. But yeah, plugin will come up with some new functionalities soon.

Previous version is capable of basic functionality like Insertion, deletion , selection etc. For more details look here. In previous versions , we generate a sql query by parsing json request and then execute that query with the help of Execute API. But Execute API restricts some functionality.

So I just tried to perform sql execution without Execute API. Now we just parse json query and uses parameter with Storage Engine API.

Right now we have two functionalities with such implementation:
  • Create Schema
  • Drop Schema
If you like to play with this, try out this branch (lp:~mohyt/drizzle/drizzle-json_server) .

How to play with it? , its too simple :
  • Start your drizzle server with json plugin enabled (./drizzled/drizzled --plugin-add=json_server)
  • Now send a curl request to create schema. For example,
 --exec curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"query":{"name":"json"}}' 'http://localhost:8086/json/ddl/schema/create'
  • And , to drop a schema , try this ,  
--exec curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"query":{"name":"json"}}' 'http://localhost:8086/json/ddl/schema/drop'

Comments are most welcome :)

No comments:

Post a Comment