Skip to content

Commit 3a4ab7c

Browse files
added alasql query in editor query panel
1 parent 8c7348a commit 3a4ab7c

File tree

7 files changed

+34
-1
lines changed

7 files changed

+34
-1
lines changed

client/packages/lowcoder/src/components/ResCreatePanel.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ const ResButton = (props: {
169169
compType: "streamApi",
170170
},
171171
},
172+
alasql: {
173+
label: trans("query.quickAlasql"),
174+
type: BottomResTypeEnum.Query,
175+
extra: {
176+
compType: "alasql",
177+
},
178+
},
172179
graphql: {
173180
label: trans("query.quickGraphql"),
174181
type: BottomResTypeEnum.Query,
@@ -319,6 +326,7 @@ export function ResCreatePanel(props: ResCreateModalProps) {
319326
<DataSourceListWrapper $placement={placement}>
320327
<ResButton size={buttonSize} identifier={"restApi"} onSelect={onSelect} />
321328
<ResButton size={buttonSize} identifier={"streamApi"} onSelect={onSelect} />
329+
<ResButton size={buttonSize} identifier={"alasql"} onSelect={onSelect} />
322330
<ResButton size={buttonSize} identifier={"graphql"} onSelect={onSelect} />
323331
{datasource.map((i) => (
324332
<ResButton size={buttonSize} key={i.id} identifier={i} onSelect={onSelect} />

client/packages/lowcoder/src/comps/queries/queryComp/queryPropertyView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ function useDatasourceStatus(datasourceId: string, datasourceType: ResourceType)
734734
datasourceType === "js" ||
735735
datasourceType === "streamApi" ||
736736
datasourceType === "libraryQuery" ||
737+
datasourceType === "alasql" ||
737738
datasourceId === QUICK_REST_API_ID ||
738739
datasourceId === QUICK_GRAPHQL_ID
739740
) {

client/packages/lowcoder/src/comps/queries/resourceDropdown.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ const QuickGraphqlValue: ResourceOptionValue = {
102102
type: "graphql",
103103
};
104104

105+
const QuickAlasqlValue: ResourceOptionValue = {
106+
id: "",
107+
type: "alasql",
108+
};
109+
105110
interface ResourceDropdownProps {
106111
changeResource: (datasourceId: string, value: string) => void;
107112
selectedResource: ResourceOptionValue;
@@ -265,6 +270,17 @@ export const ResourceDropdown = (props: ResourceDropdownProps) => {
265270
<SelectOptionLabel>{trans("query.quickStreamAPI")} </SelectOptionLabel>
266271
</SelectOptionContains>
267272
</SelectOption>
273+
274+
<SelectOption
275+
key={JSON.stringify(QuickAlasqlValue)}
276+
label={trans("query.quickAlasql")}
277+
value={JSON.stringify(QuickAlasqlValue)}
278+
>
279+
<SelectOptionContains>
280+
{getBottomResIcon("restApi")}
281+
<SelectOptionLabel>{trans("query.quickAlasql")} </SelectOptionLabel>
282+
</SelectOptionContains>
283+
</SelectOption>
268284

269285
<SelectOption
270286
key={JSON.stringify(QuickGraphqlValue)}

client/packages/lowcoder/src/comps/queries/sqlQuery/SQLQuery.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export const NOT_SUPPORT_GUI_SQL_QUERY: string[] = [
255255
"snowflake",
256256
"tdengine",
257257
"dameng",
258+
"alasql",
258259
];
259260
const SUPPORT_UPSERT_SQL_QUERY: string[] = [
260261
"mysql",

client/packages/lowcoder/src/constants/datasourceConstants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const databasePlugins: Partial<DatasourceType>[] = [
1515
"clickHouse",
1616
"snowflake",
1717
"mariadb",
18+
"alasql",
1819
];
1920

2021
export const apiPluginsForQueryLibrary: Partial<DatasourceType>[] = [

client/packages/lowcoder/src/constants/queryConstants.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { GraphqlQuery } from "../comps/queries/httpQuery/graphqlQuery";
1313
import { toPluginQuery } from "comps/queries/pluginQuery/pluginQuery";
1414
import { MultiCompConstructor } from "lowcoder-core";
1515
import { DataSourcePluginMeta } from "lowcoder-sdk/dataSource";
16+
import { AlaSqlQuery } from "@lowcoder-ee/comps/queries/httpQuery/alasqlQuery";
1617

1718
export type DatasourceType =
1819
| "mysql"
@@ -29,13 +30,15 @@ export type DatasourceType =
2930
| "googleSheets"
3031
| "graphql"
3132
| "snowflake"
32-
| "mariadb";
33+
| "mariadb"
34+
| "alasql";
3335

3436
export type ResourceType = DatasourceType | "js" | "libraryQuery" | "view";
3537

3638
export const QueryMap = {
3739
js: JSQuery,
3840
mysql: SQLQuery,
41+
alasql: AlaSqlQuery,
3942
restApi: HttpQuery,
4043
streamApi: StreamQuery,
4144
mongodb: MongoQuery,

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,9 @@ export const en = {
731731
"quickRestAPI": "REST Query",
732732
"quickStreamAPI": "Stream Query",
733733
"quickGraphql": "GraphQL Query",
734+
"quickAlasql": "Local SQL Query",
735+
"databaseType": "Database Type",
736+
"chooseDatabase": "Choose Database",
734737
"lowcoderAPI": "Lowcoder API",
735738
"executeJSCode": "Run JavaScript Code",
736739
"importFromQueryLibrary": "Import from Query Library",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy