neo4j-go-driver
neo4j-go-driver copied to clipboard
Add `GqlStatusObject` support as notifications to `ResultSummary`
⚠️ This API is released as preview.
Introduces GQL-compliant status objects to the ResultSummary.
GqlStatusObject is a GQL-compliant Notification object and status of query execution, this new object includes GqlStatus and StatusDescription.
ResultSummary.GqlStatusObjects() always contains at least 1 status representing the Success, No Data or Omitted Result.
The GqlStatusObjects will be presented in the following order:
- A “no data” (
02xxx) has precedence over a warning; - A warning (
01xxx) has precedence over a success. - A success (
00xxx) has precedence over anything informational (03xxx)
Migration from Notification
Most properties in Notification exist in the new GqlStatusObject, except Code and Title.
The GqlStatusObject.GqlStatus is equivalent to Code in Notification, but with values compliant with GQL.
The properties GqlStatusObject.Classification and GqlStatusObject.RawClassification are equivalent to Notification.Category and Notification.RawCategory. The name change is needed because Category has a different meaning in GQL.
Usage
Disabling GqlStatusObjects can be done in the same way as disabling Notifications. However, non-notification status can not be filtered (such as Success or No Data):
neo4j.NewDriverWithContext("neo4j://localhost", neo4j.BasicAuth("neo4j", "password", ""), func(config *config.Config) {
config.NotificationsDisabledClassifications = notifications.DisableClassifications(notifications.Deprecation, notifications.Performance)
})
Iterating through GqlStatusObjects is also done in the same way as Notifications:
gqlStatusObjects := result.Summary.GqlStatusObjects()
for _, gqlStatusObject := range gqlStatusObjects {
fmt.Printf(gqlStatusObject.GqlStatus())
fmt.Printf(gqlStatusObject.StatusDescription())
fmt.Printf(gqlStatusObject.DiagnosticRecord())
// and so on
}
Deprecations
-
notifications.NotificationCategoryhas been deprecated in favor ofnotifications.NotificationClassification. -
notifications.NotificationDisabledCategorieshas been deprecated in favor ofnotifications.NotificationDisabledClassifications. -
notifications.DisableCategories()has been deprecated in favor ofnotifications.DisableClassifications(). -
notifications.DisableNoCategories()has been deprecated in favor ofnotifications.DisableNoClassifications(). -
config.NotificationsDisabledCategorieshas been deprecated in favor ofconfig.NotificationsDisabledClassificationsinconfig.Config. -
ResultSummary.Notifications()has been deprecated in favor ofResultSummary.GqlStatusObjects() -
neo4j.NotificationSeverityplease usenotifications.NotificationSeveritydirectly. -
neo4j.Warningplease usenotifications.Warningdirectly. -
neo4j.Informationplease usenotifications.Informationdirectly. -
neo4j.UnknownSeverityplease usenotifications.UnknownSeveritydirectly. -
neo4j.NotificationCategoryplease usenotifications.NotificationCategorydirectly. -
neo4j.Hintplease usenotifications.Hintdirectly. -
neo4j.Unrecognizedplease usenotifications.Unrecognizeddirectly. -
neo4j.Unsupportedplease usenotifications.Unsupporteddirectly. -
neo4j.Performanceplease usenotifications.Performancedirectly. -
neo4j.Deprecationplease usenotifications.Deprecationdirectly. -
neo4j.Genericplease usenotifications.Genericdirectly. -
neo4j.Securityplease usenotifications.Securitydirectly. -
neo4j.Topologyplease usenotifications.Topologydirectly. -
neo4j.UnknownCategoryplease usenotifications.Unknowndirectly.