1
0
Fork 0
mirror of synced 2024-06-29 03:20:34 +12:00

improve database.select performance

This commit is contained in:
Keviin Åberg Kultalahti 2021-03-19 13:51:21 +01:00
parent 1bb2b45d67
commit 16e401737d
3 changed files with 9 additions and 119 deletions

View file

@ -22,14 +22,15 @@ export const getBackendUiStore = () => {
reset: () => store.set({ ...INITIAL_BACKEND_UI_STATE }),
database: {
select: async db => {
const tablesResponse = await api.get(`/api/tables`)
const tables = await tablesResponse.json()
const datasourcesResponse = await api.get(`/api/datasources`)
const datasources = await datasourcesResponse.json()
const queriesResponse = await api.get(`/api/queries`)
const queries = await queriesResponse.json()
const integrationsResponse = await api.get("/api/integrations")
const integrations = await integrationsResponse.json()
const [tables, datasources, queries, integrations] = await Promise.all([
api.get(`/api/tables`).then(r => r.json()),
api.get(`/api/datasources`).then(r => r.json()),
api.get(`/api/queries`).then(r => r.json()),
api.get("/api/integrations").then(r => r.json())
])
console.log(tables)
const permissionLevels = await store.actions.permissions.fetchLevels()
store.update(state => {

View file

@ -1,111 +0,0 @@
export const componentsAndScreens = () => ({
components: [
{
_instanceName: "TextBox",
tags: ["Text", "input"],
children: false,
props: {
size: { type: "options", options: ["small", "medium", "large"] },
isPassword: "bool",
placeholder: "string",
label: "string",
},
},
{
_instanceName: "Button",
tags: ["input"],
children: true,
props: {
size: { type: "options", options: ["small", "medium", "large"] },
css: "string",
contentText: "string",
},
},
{
_instanceName: "div",
tags: ["input"],
props: {
width: "number",
},
},
{
_instanceName: "Row View",
tags: ["row"],
props: {
data: "state",
},
},
],
screens: [
{
props: {
_component: "budibase-components/TextBox",
_instanceName: "SmallTextbox",
size: "small",
},
},
{
name: "common/PasswordBox",
tags: ["mask"],
props: {
_component: "budibase-components/TextBox",
_instanceName: "PasswordBox",
isPassword: true,
size: "small",
},
},
{
props: {
_component: "budibase-components/Button",
_instanceName: "PrimaryButton",
css: "btn-primary",
},
},
{
route: "",
props: {
_component: "budibase-components/div",
width: 100,
_instanceName: "Screen 1",
_children: [
{
_component: "budibase-components/Button",
contentText: "Button 1",
_instanceName: "Button 1",
},
{
_component: "budibase-components/Button",
contentText: "Button 2",
_instanceName: "Button 2",
},
{
_component: "budibase-components/TextBox",
_instanceName: "TextBox",
isPassword: true,
size: "small",
},
],
},
},
{
props: {
_component: "budibase-components/div",
_instanceName: "Field",
_children: [
{
_component: "common/SmallTextbox",
},
],
},
},
],
})
export const stripStandardProps = props => {
delete props._id
delete props._styles
}