package database 

import scala.annotation.tailrec

type Row = Map[String, String]
type Tabular = List[Row]

case class Table (tableName: String, tableData: Tabular) {

  def header: List[String] = ???
  def data: Tabular = ???
  def name: String = ???

  // 2.1.1
  override def toString: String = ???

  // 2.1.2
  def insert(row: Row): Table = ???

  // 2.1.3
  def delete(row: Row): Table = ???

  // 2.1.4
  def sort(column: String, ascending: Boolean = true): Table = ???

  // 2.1.5
  def select(columns: List[String]): Table = ???
}

object Table {
  // 2.1.6
  def apply(name: String, s: String): Table = ???
}

extension (table: Table) {
  def apply(i: Int): Row = {
    table.data(i)
  }
}
