// OpenWithOptions -  Options must be converted into pg.Options{}, if not - use default options
Options must be converted into pg.Options{}, if not - use default options
// OpenWithOptions - Options must be converted into pg . Options {} if not - use default options
func openWithOptions(user, database, password string, data []byte) (IDatabase, error) {
	opts := pg.Options{}
	err := json.Unmarshal(data, &opts)
	if err != nil {
		pgDB := pg.Connect(defaultOptions(user, database, password))
		return NewDatabase(pgDB, log.New(os.Stdout, "", 1)), nil
	}
	pgDB := pg.Connect(&opts)
	return NewDatabase(pgDB, log.New(os.Stdout, "", 1)), nil
}
func openWithOptions ( user , database , password string , data [ ] byte ) ( IDatabase , error ) { opts := pg . Options { } err := json . Unmarshal ( data , & opts ) if err != nil { pgDB := pg . Connect ( defaultOptions ( user , database , password ) ) return NewDatabase ( pgDB , log . New ( os . Stdout , " " , 1 ) ) , nil } pgDB := pg . Connect ( & opts ) return NewDatabase ( pgDB , log . New ( os . Stdout , " " , 1 ) ) , nil }
Options must be converted into pg.Options{}, if not - use default options
Options must be converted into pg . Options {} if not - use default options
//connect with default options