Skip to content

Instantly share code, notes, and snippets.

@vrutik2809
Created April 14, 2022 19:56
Show Gist options
  • Save vrutik2809/4b5c09eb95f4c46c89ffa7280280704c to your computer and use it in GitHub Desktop.
Save vrutik2809/4b5c09eb95f4c46c89ffa7280280704c to your computer and use it in GitHub Desktop.
Backend workflow for Mathesar database exporting functionality

The backend workflow is illustrated in the following chart: image The exporting algorithm for exporting the table will follow as:

  • validate the body
    • check whether database exist or not
    • check whether table <schema_name>.<table_name> exist or not
    • check whether given fields are there in the table or not
  • create engine using create_mathesar_engine function by passing db_name
  • use the created engine to relfect the table with the given schema_name and table_name using reflect_table function
  • then it will follow the logic mentioned in the exporting function prototypes(e.g., refer export_table_to_dict function)

The same kind of algorithm will also follow for exporting the views and schemas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment