package gormjsonb

import (
	
	
	
)

// JSONB type
type JSONB map[string]interface{}

// Value for save jsonb in postgres
func ( JSONB) () (driver.Value, error) {
	,  := json.Marshal()

	return string(), 
}

// Scan unmarshal data in JSONB map
func ( *JSONB) ( interface{}) error {

	var  []byte
	 := make(map[string]interface{})

	switch .(type) {
	case []uint8:
		 = []byte(.([]uint8))
	case string:
		 = []byte(.(string))
	case nil:
		return nil
	default:
		return errors.New("incompatible type for StringInterfaceMap")
	}
	 := json.Unmarshal(, &)
	if  != nil {
		return 
	}
	* = JSONB()
	return nil
}