Skip to content

Commit

Permalink
Fixed SQL Server JSON support
Browse files Browse the repository at this point in the history
Closes #298
  • Loading branch information
sauls8t committed Jul 18, 2019
1 parent 69077ce commit b31f330
Show file tree
Hide file tree
Showing 5 changed files with 1,060 additions and 1,058 deletions.
1 change: 1 addition & 0 deletions domain/setting/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func (h *Handler) SetSMTP(w http.ResponseWriter, r *http.Request) {
}

cfg := GetSMTPConfig(h.Store)
h.Runtime.Log.Infof("%v", cfg)
dialer, err := smtp.Connect(cfg)
em := smtp.EmailMessage{}
em.Subject = "Documize SMTP Test"
Expand Down
3 changes: 2 additions & 1 deletion domain/setting/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import (
"database/sql"
"fmt"

"github.com/documize/community/domain/store"
"github.com/pkg/errors"

"github.com/documize/community/domain/store"
)

// Store provides data access to user permission information.
Expand Down
4 changes: 2 additions & 2 deletions edition/community.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func main() {
rt.Product = domain.Product{}
rt.Product.Major = "3"
rt.Product.Minor = "1"
rt.Product.Patch = "0"
rt.Product.Revision = "190629131646"
rt.Product.Patch = "1"
rt.Product.Revision = "190718095543"
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
rt.Product.Edition = domain.CommunityEdition
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)
Expand Down
2 changes: 1 addition & 1 deletion edition/storage/sqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func (p SQLServerProvider) JSONEmpty() string {
// Typically used in SELECT <my_json_field> query.
func (p SQLServerProvider) JSONGetValue(column, attribute string) string {
if len(attribute) > 0 {
return fmt.Sprintf("JSON_VALUE(%s, '$.%s'", column, attribute)
return fmt.Sprintf("JSON_VALUE(%s, '$.%s')", column, attribute)
}

return fmt.Sprintf("JSON_QUERY(%s)", column)
Expand Down
Loading

0 comments on commit b31f330

Please sign in to comment.