[sqltypes] Add support to serialize and deserialize them

Also got rid of half complete MarshalJSON implementation.
Fine point.  @rajat: could you change it back


On Wed, Aug 13, 2014 at 1:04 PM, Zviad Metreveli <notifications@github.com>
wrote:

> In database/sqltypes/sqltypes.go:
>
> > @@ -25,6 +26,16 @@ var (
> >  	nullstr    = []byte("null")
> >  )
> >
> > +type ValueType byte
> > +
> > +const (
> > +	NullType = ValueType(iota)
>
> using iota for serialization might be a bit sketchy versus using real
> values starting from 0 (and potentialyl spelling it out for every single
> one of them)
>
> right now if someone were to go and change ordering of NumericType and
> FractionalType or even added a new element in the middle of the list,
> potentially serialized data will become corrupt
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dropbox/godropbox/pull/62/files#r16201477>.
>