Ejemplo n.º 1
0
 def header_bytes(self) -> AnyStr:
     return b''.join([
         int_to_bytes(self.PAGE_TYPE, 1),
         int_to_bytes(len(self.cells), 2),
         int_to_bytes(512 - self.payload_size(), 2),
         int_to_bytes(self.page_number),
         int_to_bytes(self.page_parent),
         self.cell_locations_bytes()])
Ejemplo n.º 2
0
 def cell_locations_bytes(self) -> AnyStr:
     locations_bytes = b''
     location = 512
     for row_id in self.cells:
         location -= len(self.cells[row_id])
         locations_bytes += int_to_bytes(location, 2)
     return locations_bytes
Ejemplo n.º 3
0
 def header_bytes(self) -> AnyStr:
     return int_to_bytes(self.left_child_page) + int_to_bytes(self.row_id)
Ejemplo n.º 4
0
 def header_bytes(self) -> bytes:
     return int_to_bytes(len(self.values), 1) + bytes([value.get_type_number() for value in self.values])
Ejemplo n.º 5
0
 def header_bytes(self) -> AnyStr:
     return int_to_bytes(len(self.record), 2) + int_to_bytes(self.row_id)