feat: add cassandra database support
This commit is contained in:
parent
d96e2b5485
commit
355390b68a
|
@ -59,7 +59,13 @@ const queryDataFromTable = (data: QueryData) => {
|
|||
executeQuery()
|
||||
}
|
||||
const describeTable = (data: QueryData) => {
|
||||
switch (kind.value) {
|
||||
case 'atest-store-cassandra':
|
||||
sqlQuery.value = `@describeTable_${queryDataMeta.value.currentDatabase}:${data.label}`
|
||||
break
|
||||
default:
|
||||
sqlQuery.value = `@describeTable_${data.label}`
|
||||
}
|
||||
executeQuery()
|
||||
}
|
||||
const queryTables = () => {
|
||||
|
@ -69,6 +75,7 @@ const queryTables = () => {
|
|||
watch(kind, (k) => {
|
||||
switch (k) {
|
||||
case 'atest-store-orm':
|
||||
case 'atest-store-cassandra':
|
||||
case 'atest-store-iotdb':
|
||||
queryTip.value = 'Enter SQL query'
|
||||
executeQuery()
|
||||
|
@ -157,6 +164,7 @@ const executeWithQuery = async (sql: string) => {
|
|||
const data = await API.DataQueryAsync(store.value, kind.value, queryDataMeta.value.currentDatabase, sql);
|
||||
switch (kind.value) {
|
||||
case 'atest-store-orm':
|
||||
case 'atest-store-cassandra':
|
||||
case 'atest-store-iotdb':
|
||||
ormDataHandler(data)
|
||||
success = true
|
||||
|
@ -188,7 +196,7 @@ const executeWithQuery = async (sql: string) => {
|
|||
<template>
|
||||
<div>
|
||||
<el-container style="height: calc(100vh - 50px);">
|
||||
<el-aside v-if="kind === 'atest-store-orm' || kind === 'atest-store-iotdb'">
|
||||
<el-aside v-if="kind === 'atest-store-orm' || kind === 'atest-store-iotdb' || kind === 'atest-store-cassandra'">
|
||||
<el-scrollbar>
|
||||
<el-select v-model="queryDataMeta.currentDatabase" placeholder="Select database"
|
||||
@change="queryTables" filterable>
|
||||
|
@ -204,7 +212,7 @@ const executeWithQuery = async (sql: string) => {
|
|||
<span @click="queryDataFromTable(data)">
|
||||
{{ node.label }}
|
||||
</span>
|
||||
<el-icon style="margin-left: 6px;" @click="describeTable(data)" v-if="kind === 'atest-store-orm'"><Document /></el-icon>
|
||||
<el-icon style="margin-left: 6px;" @click="describeTable(data)" v-if="kind === 'atest-store-orm' || kind === 'atest-store-cassandra'"><Document /></el-icon>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
|
|
|
@ -788,9 +788,7 @@ var DataQueryAsync = (store: string, kind: string, currentDatabase: string, quer
|
|||
const queryObj = {} as QueryObject;
|
||||
switch (kind) {
|
||||
case 'atest-store-orm':
|
||||
queryObj['sql'] = query;
|
||||
queryObj['key'] = currentDatabase;
|
||||
break;
|
||||
case 'atest-store-cassandra':
|
||||
case 'atest-store-iotdb':
|
||||
queryObj['sql'] = query;
|
||||
queryObj['key'] = currentDatabase;
|
||||
|
|
|
@ -88,6 +88,14 @@ const storeExtensions = [
|
|||
params: [],
|
||||
link: 'https://github.com/LinuxSuRen/atest-ext-store-iotdb'
|
||||
},
|
||||
{
|
||||
name: 'atest-store-cassandra',
|
||||
params: [{
|
||||
key: 'keyspace',
|
||||
defaultValue: ''
|
||||
}],
|
||||
link: 'https://github.com/LinuxSuRen/atest-ext-store-cassandra'
|
||||
},
|
||||
{
|
||||
name: 'atest-store-etcd',
|
||||
params: [],
|
||||
|
|
|
@ -9,6 +9,7 @@ Ports in extensions:
|
|||
| Store | [mongodb](https://github.com/LinuxSuRen/atest-ext-store-mongodb) | 4075 |
|
||||
| Store | [redis](https://github.com/LinuxSuRen/atest-ext-store-redis) | |
|
||||
| Store | [iotdb](https://github.com/LinuxSuRen/atest-ext-store-iotdb) | |
|
||||
| Store | [Cassandra](https://github.com/LinuxSuRen/atest-ext-store-cassandra) | |
|
||||
| Monitor | [docker-monitor](https://github.com/LinuxSuRen/atest-ext-monitor-docker) | |
|
||||
| Agent | [collector](https://github.com/LinuxSuRen/atest-ext-collector) | |
|
||||
| Secret | [Vault](https://github.com/LinuxSuRen/api-testing-vault-extension) | |
|
||||
|
|
Loading…
Reference in New Issue