JpStRanGer / sqlite-query-tool-vuejs-flask

VueJS and Flask-powered tool for database analysis. Allows users to select tables from SQLite database, execute queries, and display results in a table format. Includes pre-written queries and displays all available tables. Uses custom delimiters and asynchronous method for fast retrieval of table names.
GNU General Public License v3.0
0 stars 0 forks source link

Change DB view column names to match api format #1

Open JpStRanGer opened 1 year ago

JpStRanGer commented 1 year ago

Today: sending: /todos?name=merit given result:

{
    "data": [
        {
            "TodoName": "merit",
            "Todo_ID": 1
        }
    ],
    "meta": {
        "count_filtered": 1,
        "count_total": 3
    }
}

GOAL:

{
    "data": [
        {
            "name": "merit",
            "id": 1
        }
    ],
    "meta": {
        "count_filtered": 1,
        "count_total": 3
    }
}
JpStRanGer commented 1 year ago

Search_columns is a dictonary and can be changed to list when column name match between view and API

https://github.com/JpStRanGer/sqlite-query-tool-vuejs-flask/blob/41e14eba40c39c4bd805971a15e8123990ca462e/blueprints/api.py#L5-L20