add postgres where clause for table data query.

add ui for where clause
This commit is contained in:
2024-07-14 12:50:17 +02:00
parent fd076517dc
commit bb16b2db43
10 changed files with 190 additions and 21 deletions

View File

@@ -95,7 +95,13 @@ const app = new Elysia({ prefix: "/api" })
"/databases/:dbName/tables/:tableName/data",
async ({ query, params, jwt, set, cookie: { auth } }) => {
const { tableName, dbName } = params;
const { perPage = "50", page = "0", sortField, sortDesc } = query;
const {
perPage = "50",
page = "0",
sortField,
sortDesc,
whereQuery,
} = query;
const credentials = await jwt.verify(auth.value);
if (!credentials) {
@@ -111,6 +117,7 @@ const app = new Elysia({ prefix: "/api" })
page: Number.parseInt(page, 10),
sortField,
sortDesc: sortDesc === "true",
whereQuery,
});
},
)