pub fn read_grid(conn: &rusqlite::Connection, tile_id: TmsTileId) -> rusqlite::Result<Option<Vec<u8>>> {
    let mut select_grid =
        conn.prepare_cached("SELECT grid FROM grids WHERE zoom_level = ?1 AND tile_column = ?2 AND tile_row = ?3")?;
    let mut rows = select_grid.query(params![tile_id.z(), tile_id.x(), tile_id.y()])?;

    if let Some(row) = rows.next()? {
        let grid: Vec<u8> = row.get(0)?;
        Ok(Some(grid))
    } else {
        Ok(None)
    }
}
/// Reads the given grid from the database.
///
/// If the grid is not found, `None` is returned.
Reads the given grid from the database.
If the grid is not found, `None` is returned.
Reads the given grid from the database . If the grid is not found ` None ` is returned .
pub fn read_grid(conn: &rusqlite::Connection, tile_id: TmsTileId) -> rusqlite::Result<Option<Vec<u8>>> {
    let mut select_grid =
        conn.prepare_cached("SELECT grid FROM grids WHERE zoom_level = ?1 AND tile_column = ?2 AND tile_row = ?3")?;
    let mut rows = select_grid.query(params![tile_id.z(), tile_id.x(), tile_id.y()])?;
    if let Some(row) = rows.next()? {
        let grid: Vec<u8> = row.get(0)?;
        Ok(Some(grid))
    } else {
        Ok(None)
    }
}
pub fn read_grid ( conn : & rusqlite :: Connection , tile_id : TmsTileId ) -> rusqlite :: Result < Option < Vec < u8 > > > { let mut select_grid = conn . prepare_cached ( " " ) ? ; let mut rows = select_grid . query ( params ! [ tile_id z ( ) tile_id x ( ) tile_id y ( ) ] ) ? ; if let Some ( row ) = rows . next ( ) ? { let grid : Vec < u8 > = row . get ( 0 ) ? ; Ok ( Some ( grid ) ) } else { Ok ( None ) } }
Reads the given grid from the database.
Reads the given grid from the database .
conn
&rusqlite::Connection
tile_id
TmsTileId