@@ -72,7 +72,7 @@ func (h *Handler) getTable(w http.ResponseWriter, params map[string]interface{})
7272 h .logger .Info (fmt .Sprintf ("Command: GetTable, table=%s, limit=%d, offset=%d" , table , limit , offset ))
7373
7474 var condition * Condition
75- conditionParam , ok := params ["condition" ].( interface {})
75+ conditionParam , ok := params ["condition" ]
7676 if ok {
7777 condition , ok = toCondition (conditionParam , h .logger )
7878 if ! ok {
@@ -81,7 +81,7 @@ func (h *Handler) getTable(w http.ResponseWriter, params map[string]interface{})
8181 }
8282 h .logger .Debug (fmt .Sprintf ("Condition provided: %v" , condition ))
8383 } else {
84- h .logger .Debug (fmt . Sprintf ( "No condition provided" ) )
84+ h .logger .Debug ("No condition provided" )
8585 }
8686
8787 data , err := queryTable (h .db , table , condition , limit , offset , h .logger )
@@ -241,7 +241,7 @@ func queryTable(db *sql.DB, tableName string, condition *Condition, limit int, o
241241
242242 // Iterate through rows
243243 for rows .Next () {
244- err : = rows .Scan (scanArgs ... )
244+ err = rows .Scan (scanArgs ... )
245245 if err != nil {
246246 return nil , fmt .Errorf ("error scanning row: %v" , err )
247247 }
@@ -306,6 +306,10 @@ func getClause(filter Filter) string {
306306 return fmt .Sprintf ("%s > ?" , filter .Column )
307307 case OperatorGreaterThanOrEquals :
308308 return fmt .Sprintf ("%s >= ?" , filter .Column )
309+ case OperatorIsNull :
310+ return fmt .Sprintf ("%s IS NULL" , filter .Column )
311+ case OperatorIsNotNull :
312+ return fmt .Sprintf ("%s IS NOT NULL" , filter .Column )
309313 default :
310314 return ""
311315 }
@@ -390,7 +394,7 @@ func getTableInfo(db *sql.DB, tableName string) (map[string]interface{}, error)
390394 var notNull int
391395 var defaultValue interface {}
392396 var pk int
393- if err : = rows .Scan (& cid , & name , & dataType , & notNull , & defaultValue , & pk ); err != nil {
397+ if err = rows .Scan (& cid , & name , & dataType , & notNull , & defaultValue , & pk ); err != nil {
394398 return nil , fmt .Errorf ("error scanning row: %v" , err )
395399 }
396400
0 commit comments