asaushkin / jsondb

JsonDB is wrapper for the data from sql databases. With JsonDB you can retrieve data with the JSON wrap around.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsondb

JsonDB is wrapper for the data from sql databases. With JsonDB you can retrieve data with the JSON wrap around.

Example

Using the JsonDB is very simple:

package main

import (
    "database/sql"
    "fmt"
    "log"

    "github.com/asaushkin/jsondb"

    _ "github.com/lib/pq"
)

func main() {
    db, err := sql.Open("postgres", "host=10.84.0.6 dbname=timeacc sslmode=disable")
    if err != nil {
        log.Fatal(err)
    }
    defer db.Close()

    j, err := jsondb.NewJsonDB(db)
    fmt.Println(j.Json("select * from goings limit 1"))
}

About

JsonDB is wrapper for the data from sql databases. With JsonDB you can retrieve data with the JSON wrap around.

License:Mozilla Public License 2.0


Languages

Language:Go 100.0%