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