-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
type/feature reqType: feature requestType: feature request
Description
Recently I wanted to transfer my CSV files into ngql DML lines, so I quickly changed as follows to do so.
I wonder if someone else has such a requirement, too, If yes, maybe I could PR to add an option to output to log instead of stdout.
@veezhang do you think this feature may be reasonable or not?
diff --git a/pkg/spec/v3/edge.go b/pkg/spec/v3/edge.go
index 71c771a..e88664c 100644
--- a/pkg/spec/v3/edge.go
+++ b/pkg/spec/v3/edge.go
@@ -193,7 +193,11 @@ func (e *Edge) Validate() error {
}
func (e *Edge) Statement(records ...Record) (statement string, nRecord int, err error) {
- return e.fnStatement(records...)
+ statement, nRecord, err = e.fnStatement(records...)
+ if err == nil && statement != "" {
+ fmt.Println("Generated command:", statement)
+ }
+ return statement, nRecord, err
}
func (e *Edge) insertStatement(records ...Record) (statement string, nRecord int, err error) {
diff --git a/pkg/spec/v3/node.go b/pkg/spec/v3/node.go
index 2c3929e..b084028 100644
--- a/pkg/spec/v3/node.go
+++ b/pkg/spec/v3/node.go
@@ -147,7 +147,11 @@ func (n *Node) Validate() error {
}
func (n *Node) Statement(records ...Record) (statement string, nRecord int, err error) {
- return n.fnStatement(records...)
+ statement, nRecord, err = n.fnStatement(records...)
+ if err == nil && statement != "" {
+ fmt.Println("Generated command:", statement)
+ }
+ return statement, nRecord, err
}
func (n *Node) insertStatement(records ...Record) (statement string, nRecord int, err error) {Metadata
Metadata
Assignees
Labels
type/feature reqType: feature requestType: feature request