code: func (db *SQLDB) getTableDef(tableName string) (*types.SQLTable, error) {
  	table := &types.SQLTable{
  		Name: safe(tableName),
  	}
  	found, err := db.findTable(table.Name)
  	if err != nil {
  		return nil, err
  	}
  
  	if !found {
  		db.Log.Info("msg", "Error table not found", "value", table.Name)
  		return nil, errors.New("Error table not found " + table.Name)
  	}
  
  	query := db.DBAdapter.TableDefinitionQuery()
  
  	db.Log.Info("msg", "QUERY STRUCTURE", "query", query, "value", table.Name)
  	rows, err := db.DB.Query(query, safe(tableName))
  	if err != nil {
  		db.Log.Info("msg", "Error querying table structure", "err", err)
  		return nil, err
  	}
  	defer rows.Close()
  
  	var columns []*types.SQLTableColumn
  
  	for rows.Next() {
  		var columnName string
  		var columnSQLType types.SQLColumnType
  		var columnIsPK int
  		var columnLength int
  
  		if err = rows.Scan(&columnName, &columnSQLType, &columnLength, &columnIsPK); err != nil {
  			db.Log.Info("msg", "Error scanning table structure", "err", err)
  			return nil, err
  		}
  
  		if _, err = db.DBAdapter.TypeMapping(columnSQLType); err != nil {
  			return nil, err
  		}
  
  		columns = append(columns, &types.SQLTableColumn{
  			Name:    columnName,
  			Type:    columnSQLType,
  			Length:  columnLength,
  			Primary: columnIsPK == 1,
  		})
  	}
  
  	if err = rows.Err(); err != nil {
  		db.Log.Info("msg", "Error during rows iteration", "err", err)
  		return nil, err
  	}
  
  	table.Columns = columns
  	return table, nil
  }
docs: // getTableDef returns the structure of a given SQL table