Repository: proullon/ramsql (go)

Issue:
JSON
Hey,

I was playing around ramsql today and I've got a json column

```
db, err = sql.Open("ramsql", "store")
if err != nil {
	panic(fmt.Sprintf("sql.Open : Error : %s\n", err))
}
db.Exec(`CREATE TABLE test (sequence_number BIGSERIAL PRIMARY KEY, aggregate_id UUID, type TEXT, data JSON, created_at TIMESTAMP);`)
```

Insertion seems to work but unfortunately everything I put into the data column gets an extra level of escaping when I retrieve it for example: 
`{\"id\":\"c05d13bd-9d9b-4ea1-95f2-9b11ed3a7d38\",\"name\":\"\"}`

Which breaks the json.Unmarshal process.  This behaviour isn't consistent with postgresql.



Pull request description:
fix: (close #23) correctly insert []byte

Patch:
diff --git a/driver/stmt.go b/driver/stmt.go
index f8f7b0a..8dc72b2 100644
--- a/driver/stmt.go
+++ b/driver/stmt.go
@@ -163,6 +163,8 @@ func replaceArguments(query string, args []driver.Value) string {
 		var v string
 		if args[index-1] == nil {
 			v = "null"
+		} else if _, ok := args[index-1].([]byte); ok {
+			v = fmt.Sprintf("$$%v$$", string(args[index-1].([]byte)))
 		} else {
 			v = fmt.Sprintf("$$%v$$", args[index-1])
 		}


Test patch:
diff --git a/driver/driver_test.go b/driver/driver_test.go
index 0f8d5c1..558fa2f 100644
--- a/driver/driver_test.go
+++ b/driver/driver_test.go
@@ -1043,3 +1043,33 @@ func TestBracketWhereClause(t *testing.T) {
 	}
 	defer rows.Close()
 }
+
+func TestInsertByteArray(t *testing.T) {
+	log.UseTestLogger(t)
+
+	db, err := sql.Open("ramsql", "TestBracketWhereClause")
+	if err != nil {
+		t.Fatalf("sql.Open : Error : %s\n", err)
+	}
+
+	_, err = db.Exec(`CREATE TABLE test (sequence_number BIGSERIAL PRIMARY KEY, json JSON, created_at TIMESTAMP)`)
+	if err != nil {
+		t.Fatalf("sql.Exec: Error: %s\n", err)
+	}
+
+	j, _ := json.Marshal(map[string]string{"a": "a"})
+	_, err = db.Exec("INSERT INTO test (json) values ($1)", j)
+	if err != nil {
+		t.Fatalf("sql.Exec: Error: %s\n", err)
+	}
+
+	var s string
+	err = db.QueryRow("SELECT json FROM test limit 1").Scan(&s)
+	if err != nil {
+		t.Fatalf("sql.Select: Error: %s\n", err)
+	}
+
+	if s != string(j) {
+		t.Fatalf("Expected JSON to be '%s', got '%s'", string(j), s)
+	}
+}