src.utils.sqlquery module

this file contains code for generating .sql queries

src.utils.sqlquery.returnInsertQuery(table, df, ignoreDuplicateOn=None)[source]

returns a INSERT query

For a passed dict, this method constructs a INSERT query, where the keys function as the table heads and the values, ofc as the values.

Parameters:
  • table (GameTable) – the name of the table

  • df (pd.DataFrame) – the dataframe, you want to get a query for

  • ignoreDuplicateOn (str, optional) – if passed, ignores duplicates on the passed key

Returns:

query – the final INSERT query

Return type:

str

src.utils.sqlquery.returnSelectQuery(table, columns, where_cond=None)[source]

generates a SELECT query

this method generates a sql query for selecting the colums in table.

Parameters:
  • table (str) – the name of the table

  • columns (list[str]) – the columns to select

  • where_cond (str | None)

Returns:

query – the wanted SELECT query

Return type:

str

Dependency Diagrams (without externals):

digraph imports {
  rankdir=LR;
  node [shape=box];
  "src.core.analyse.plotting" -> "src.utils.sqlquery";
  "src.core.process.reading" -> "src.utils.sqlquery";
  "src.core.process.writing" -> "src.utils.sqlquery";
  "src.core.team" -> "src.utils.sqlquery";
  "src.visuals.windows.main_window" -> "src.core.process.reading";
  "src.visuals.windows.main_window" -> "src.utils.sqlquery";
}

Import dependencies (collapsed)

Dependency Diagrams:

digraph imports {
  rankdir=LR;
  node [shape=box];
  "src.core.analyse.plotting" -> "src.utils.sqlquery";
  "src.core.process.reading" -> "src.utils.sqlquery";
  "src.core.process.writing" -> "src.utils.sqlquery";
  "src.core.team" -> "src.utils.sqlquery";
  "src.visuals.windows.main_window" -> "src.core.process.reading";
  "src.visuals.windows.main_window" -> "src.utils.sqlquery";
}

Import dependencies (collapsed)