changed web interface to static files + json interface
[goDBhammer.git] / src / dbibridge.go
index fe26e60..48544ae 100644 (file)
@@ -6,7 +6,8 @@ import "C"
 
 import (
        "unsafe";
-       "fmt";
+       //"fmt";
+       //"strings";
 )
 
 type DBIConnection struct {
@@ -36,6 +37,7 @@ func DBIConnect(thisDBConn *DBIConnection, dbtype string, host string, username
        C.dbi_conn_set_option(thisDBConn.dbconn, C.CString("username"), C.CString(username));
        C.dbi_conn_set_option(thisDBConn.dbconn, C.CString("password"), C.CString(password));
        C.dbi_conn_set_option(thisDBConn.dbconn, C.CString("dbname"), C.CString(database));
+       C.dbi_conn_set_option(thisDBConn.dbconn, C.CString("encoding"), C.CString("UTF-8"));
        C.dbi_conn_connect(thisDBConn.dbconn);
        
        thisDBConn.dbinit = true;
@@ -43,7 +45,7 @@ func DBIConnect(thisDBConn *DBIConnection, dbtype string, host string, username
 
 func ExecSQL(thisDBConn *DBIConnection, SQL string)
 {
-       fmt.Printf("%s;\n", SQL);
+       //fmt.Printf("%s;\n", SQL);
        res := C.dbi_conn_query(thisDBConn.dbconn, C.CString(SQL));
        
        C.dbi_result_free((unsafe.Pointer)(res));
@@ -52,4 +54,4 @@ func ExecSQL(thisDBConn *DBIConnection, SQL string)
 func DBIDisconnect(thisDBConn *DBIConnection)
 {
        C.dbi_conn_close(thisDBConn.dbconn);
-}
\ No newline at end of file
+}