code: def _add_raster_layer(self, raster_layer, layer_name, save_style=False):
          
  
          source = gdal.Open(raster_layer.source())
          array = source.GetRasterBand(1).ReadAsArray()
  
          x_size = source.RasterXSize
          y_size = source.RasterYSize
  
          output = self.raster_driver.Create(
              self.uri.absoluteFilePath(),
              x_size,
              y_size,
              1,
              gdal.GDT_Byte,
              ['APPEND_SUBDATASET=YES', 'RASTER_TABLE=%s' % layer_name]
          )
  
          output.SetGeoTransform(source.GetGeoTransform())
          output.SetProjection(source.GetProjection())
          output.GetRasterBand(1).WriteArray(array)
  
          # Once we're done, close properly the dataset
          output = None
          source = None
          return True, layer_name
docs: Add a raster layer to the folder.
  
          :param raster_layer: The layer to add.
          :type raster_layer: QgsRasterLayer
  
          :param layer_name: The name of the layer in the datastore.
          :type layer_name: str
  
          :param save_style: If we have to save a QML too. Default to False.
          Not implemented in geopackage !
          :type save_style: bool
  
          :returns: A two-tuple. The first element will be True if we could add
              the layer to the datastore. The second element will be the layer
              name which has been used or the error message.
          :rtype: (bool, str)
  
          .. versionadded:: 4.0