增加同步的获取结果的方法

This commit is contained in:
rulego-team
2025-12-20 11:10:21 +08:00
parent 16778f2ac3
commit b405a935b7
4 changed files with 48 additions and 4 deletions
+14
View File
@@ -338,6 +338,20 @@ func (s *Streamsql) AddSink(sink func([]map[string]interface{})) {
}
}
// AddSyncSink directly adds synchronous result processing callback functions.
// Convenience wrapper for Stream().AddSyncSink() for cleaner API calls.
//
// Parameters:
// - sink: Result processing function, receives []map[string]interface{} type result data
//
// Note: Sync sinks are executed sequentially in the result processing goroutine.
// Use this when order of execution matters.
func (s *Streamsql) AddSyncSink(sink func([]map[string]interface{})) {
if s.stream != nil {
s.stream.AddSyncSink(sink)
}
}
// PrintTable prints results to console in table format, similar to database output.
// Displays column names first, then data rows.
//