From 51506dffc3df0f11f9d07b956bca1741fc1f478a Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Sun, 12 Nov 2023 20:31:09 +0100 Subject: [PATCH] Name Variables --- chdb/chdb.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/chdb/chdb.go b/chdb/chdb.go index 13fb5db..ad8ff5e 100644 --- a/chdb/chdb.go +++ b/chdb/chdb.go @@ -87,30 +87,30 @@ char *Session(char *query, char *format, char* path) { import "C" import "unsafe" -func Query(str1 string, str2 string) string { - if str2 == "" { - str2 = "CSV" +func Query(in_query string, in_format string) string { + if in_format == "" { + in_format = "CSV" } - query := C.CString(str1) + query := C.CString(in_query) defer C.free(unsafe.Pointer(query)) - format := C.CString(str2) + format := C.CString(in_format) defer C.free(unsafe.Pointer(format)) resultData := C.Execute(query, format) return C.GoString(resultData) } -func Session(str1 string, str2 string, str3 string) string { - if str3 == "" { - str3 = "/tmp/" +func Session(in_query string, in_format string, in_path string) string { + if in_path == "" { + in_path = "/tmp/" } - if str2 == "" { - str2 = "CSV" + if in_format == "" { + in_format = "CSV" } - query := C.CString(str1) + query := C.CString(in_query) defer C.free(unsafe.Pointer(query)) - format := C.CString(str2) + format := C.CString(in_format) defer C.free(unsafe.Pointer(format)) - path := C.CString(str3) + path := C.CString(in_path) defer C.free(unsafe.Pointer(path)) resultData := C.Session(query, format, path) return C.GoString(resultData)