[Haskell-cafe] GSOC Proposal 2012 : HDBC

pranjal pandit pranjal5215 at gmail.com
Tue Apr 3 22:29:13 CEST 2012


Hi,

I would like to work on improving the HDBC as a GSOC project 2012.

I have a previous working experience with Django and its ORM and I had a
look at Amnesia (http://amnesia.sourceforge.net/user_manual/manual.html)
which is a SQL database interface for Erlang.
Few of the features of both include:
1 ) Database operation are supported through Language Native types.
2 ) Direct table creation from native language constructs. (models.py in
Django and *tablename*.hrl in Amnesia)

I would like to make developement in HDBC so that all Database interactions
are made through Haskell Native data type.

For eg -
In using Erlang Database interface through Amnesia on would write (Quoting
example from Amnesia Documentation)

populate() ->
   {ok, Pid} = amnesia:open(sales),

   %% adding customer
   {ok, Cust1} = amnesia:add_new (Pid, #customer {customer_code =
102341, name = "John", address = "XXXXX", email = "john at xxx"}),

   %% adding product
   {ok, P1} = amnesia:add_new (Pid, #product { product_code = "001",
description = "CPU Intel", price = 231.10 }),

   %% now let's add an order for customer "Cust2"

   {ok, Order} = amnesia:add_new (Pid, #orders { order_number = 30,
order_date = {2008, 7, 17}, customer = Cust1 }),

Here each Erlang record (#customer, #product and #orders) are responsible
for different Database Tables. So writing the first statement inserts into
database and return an object Cust1 that can be used late down the line to
create an order table object.

In Django through Python one would have written:

customer = Customer.objects.create(customer_code=102341, name = "John",
address = "XXXXX", email = "john at xxx" )
order = Orders.objects.create(order_number = 30, order_date = {2008, 7,
17}, customer = customer)


Writing everything through Language type increases more readability inside
the code. Additionally this helps in abstracting the logic in code from the
underlying SQL being executed. In addition to the support for select,
insert, update queries the my work would extend support for Joins,
aggregations etc all in Haskell Native Types.

I would also like to work to handle the database queries from wire formats/
binaries instead of strings as is the case currently. I would like to close
down these two features as a GSOC project during the summer of 2012 and I
would your feedback on the same.

-- 
Regards
Pranjal Pandit


Don't communicate by sharing memory; share memory by communicating.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120404/326be3fe/attachment.htm>


More information about the Haskell-Cafe mailing list