pub fn link_dimensions_unchecked<TStore: CqlType>(db_location: &str, location: &[u64]) -> io::Result<()> {
    let mut x_position = location[0];

    for x_axis_id in 1..location.len() {
        let y_axis_id = x_axis_id as u64 + 1;
        let y_position = location[x_axis_id];
        let y_axis_definition = axis_library::get_by_id(db_location, y_axis_id)?;

        let mut key = key_library::get(
            db_location,
            &key_library::AxisPoint { axis_id: x_axis_id as u64, position: x_position },
            &key_library::AxisPoint { axis_id: y_axis_id, position: y_position },
            &y_axis_definition
        )?;

        if key == 0 {
            key = key_library::add::<TStore>(
                db_location,
                x_position,
                y_position,
                &axis_library::get_by_id(db_location, x_axis_id as u64)?,
                &y_axis_definition
            )?;

            let last_axis_id = axis_library::count(db_location)?;
            if y_axis_id == last_axis_id - 1 {
                database::grow::<TStore>(&db_location, y_axis_definition.max)?;
            }
        };
        x_position = key;
    }

    Ok(())
}
/// Links dimension indexs together if they are not already linked.  Does not validate given parameters.
///
/// This is required before read-writing to a location, and allocates the file space required to store the Nth dimension data.
/// The last (Nth) dimension should not be linked.
///
/// # Errors
///
/// Will return any [I/O errors](https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html) encountered during the execution of the function.  Function may
/// partially succeed resulting in changes to the file system.
///
/// # Panics
///
/// Function does not actively defend against panics, and may do so if given invalid parameters.  Function may partially succeed resulting in changes
/// to the file system.
///
/// # Examples
/// ```
/// # use cql_u64::U64;
/// # const DATABASE_LOCATION: &str = "./.test_db";
/// #
/// # use std::error::Error;
/// # use std::fs::remove_file;
/// # fn main() -> Result<(), Box<dyn Error>> {
/// # let _ = remove_file(format!("{}{}", DATABASE_LOCATION, "/db"));
/// # let _ = remove_file(format!("{}{}", DATABASE_LOCATION, "/ax"));
/// # let _ = remove_file(format!("{}{}", DATABASE_LOCATION, "/key1_2"));
/// # let _ = remove_file(format!("{}{}", DATABASE_LOCATION, "/key2_3"));
/// // Create a database with a maximum capacity of `[2, 5, 3, 2]`
/// cql_db::create_db::<U64>(
///     DATABASE_LOCATION,
///     &[2, 5, 3, 2]
/// )?;
///
/// // Link the 2nd element of the 1st dimension with the 4th element of the 2nd dimension, and
/// // the 4th of the 2nd with the 3rd of the 3rd - for example:
/// // Turbine 2 has data for Signal 4 for Year 3
/// cql_db::link_dimensions_unchecked::<U64>(
///     DATABASE_LOCATION,
///     &[2, 4, 3], // don't link the Nth dimension
/// )?;
/// # Ok(())
/// # }
/// ```

Links dimension indexs together if they are not already linked.  Does not validate given parameters.
This is required before read-writing to a location, and allocates the file space required to store the Nth dimension data.
The last (Nth) dimension should not be linked.
Links dimension indexs together if they are not already linked . Does not validate given parameters . This is required before read - writing to a location and allocates the file space required to store the Nth dimension data . The last ( Nth ) dimension should not be linked .
pub fn link_dimensions_unchecked<TStore: CqlType>(db_location: &str, location: &[u64]) -> io::Result<()> {
    let mut x_position = location[0];
    for x_axis_id in 1..location.len() {
        let y_axis_id = x_axis_id as u64 + 1;
        let y_position = location[x_axis_id];
        let y_axis_definition = axis_library::get_by_id(db_location, y_axis_id)?;
        let mut key = key_library::get(
            db_location,
            &key_library::AxisPoint { axis_id: x_axis_id as u64, position: x_position },
            &key_library::AxisPoint { axis_id: y_axis_id, position: y_position },
            &y_axis_definition
        )?;
        if key == 0 {
            key = key_library::add::<TStore>(
                db_location,
                x_position,
                y_position,
                &axis_library::get_by_id(db_location, x_axis_id as u64)?,
                &y_axis_definition
            )?;
            let last_axis_id = axis_library::count(db_location)?;
            if y_axis_id == last_axis_id - 1 {
                database::grow::<TStore>(&db_location, y_axis_definition.max)?;
            }
        };
        x_position = key;
    }
    Ok(())
}
pub fn link_dimensions_unchecked < TStore : CqlType > ( db_location : & str , location : & [ u64 ] ) -> io :: Result < ( ) > { let mut x_position = location [ 0 ] ; for x_axis_id in 1 .. location . len ( ) { let y_axis_id = x_axis_id as u64 + 1 ; let y_position = location [ x_axis_id ] ; let y_axis_definition = axis_library :: get_by_id ( db_location , y_axis_id ) ? ; let mut key = key_library :: get ( db_location , & key_library :: AxisPoint { axis_id : x_axis_id as u64 , position : x_position } , & key_library :: AxisPoint { axis_id : y_axis_id , position : y_position } , & y_axis_definition ) ? ; if key == 0 { key = key_library :: add :: < TStore > ( db_location , x_position , y_position , & axis_library :: get_by_id ( db_location , x_axis_id as u64 ) ? , & y_axis_definition ) ? ; let last_axis_id = axis_library :: count ( db_location ) ? ; if y_axis_id == last_axis_id - 1 { database :: grow :: < TStore > ( & db_location , y_axis_definition . max ) ? ; } } ; x_position = key ; } Ok ( ( ) ) }
Links dimension indexs together if they are not already linked.
Links dimension indexs together if they are not already linked .
db_location
&str
location
&[u64]
db_location
&str
location
&[u64]
errors

Will return any [I/O errors] encountered during the execution of the function.  Function may
partially succeed resulting in changes to the file system.
Will return any [ I / O errors ] encountered during the execution of the function . Function may partially succeed resulting in changes to the file system .
panics

Function does not actively defend against panics, and may do so if given invalid parameters.  Function may partially succeed resulting in changes
to the file system.
Function does not actively defend against panics and may do so if given invalid parameters . Function may partially succeed resulting in changes to the file system .
examples

None
use cql_u64::u64;

None
const database_location: &str = "./.test_db";

None
None
use std::error::error;

None
use std::fs::remove_file;

None
fn main() -> result<(), box<dyn error>> {

None
let _ = remove_file(format!("{}{}", database_location, "/db"));

None
let _ = remove_file(format!("{}{}", database_location, "/ax"));

None
let _ = remove_file(format!("{}{}", database_location, "/key1_2"));

None
let _ = remove_file(format!("{}{}", database_location, "/key2_3"));

Create a database with a maximum capacity of `[2, 5, 3, 2]`
cql_db::create_db::(
DATABASE_LOCATION,
&[2, 5, 3, 2]
)?.

Link the 2nd element of the 1st dimension with the 4th element of the 2nd dimension, and
the 4th of the 2nd with the 3rd of the 3rd - for example:
Turbine 2 has data for Signal 4 for Year 3
cql_db::link_dimensions_unchecked::(
DATABASE_LOCATION,
&[2, 4, 3], // don't link the Nth dimension
)?.
Create a database with a maximum capacity of ` [ 2 5 3 2 ] ` cql_db :: create_db :: ( DATABASE_LOCATION & [ 2 5 3 2 ] ) ? . Link the 2nd element of the 1st dimension with the 4th element of the 2nd dimension and the 4th of the 2nd with the 3rd of the 3rd - for example : Turbine 2 has data for Signal 4 for Year 3 cql_db :: link_dimensions_unchecked :: ( DATABASE_LOCATION & [ 2 4 3 ] // don ' t link the Nth dimension ) ? .
ok(())

None
}

None