Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: remove shared sql script feature from free plan (#5550)

boojacka46f85cd0389
diff --git a/backend/legacyapi/plan.go b/backend/legacyapi/plan.go
index e322a2ab39..f6c97ed229 100644
--- a/backend/legacyapi/plan.go
+++ b/backend/legacyapi/plan.go
@@ -157,6 +157,13 @@ const (
// approval chain definition.
FeatureCustomApproval FeatureType = "bb.feature.custom-approval"
+ // Collaboration.
+
+ // FeatureSharedSQLScript enables sharing sql script.
+ FeatureSharedSQLScript FeatureType = "bb.feature.shared-sql-script"
+
+ // Plugins.
+
// FeaturePluginOpenAI enables AI features powered by OpenAI.
FeaturePluginOpenAI FeatureType = "bb.feature.plugin.openai"
)
@@ -222,6 +229,9 @@ func (e FeatureType) Name() string {
return "Access Control"
case FeatureCustomApproval:
return "Custom Approval"
+ // Collaboration
+ case FeatureSharedSQLScript:
+ return "Shared SQL script"
// Plugins
case FeaturePluginOpenAI:
return "OpenAI"
@@ -281,6 +291,8 @@ var FeatureMatrix = map[FeatureType][3]bool{
FeatureSensitiveData: {false, false, true},
FeatureAccessControl: {false, false, true},
FeatureCustomApproval: {false, false, true},
+ // Collaboration
+ FeatureSharedSQLScript: {false, true, true},
// Plugins
FeaturePluginOpenAI: {false, false, true},
}
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 36fd8c1940..0f59b6cd42 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1828,6 +1828,10 @@
"bb-feature-plugin-openai": {
"title": "AI Augmentation",
"desc": "AI augmented SQL Editor features powered by OpenAI."
+ },
+ "bb-feature-shared-sql-script": {
+ "title": "Shared SQL script",
+ "desc": "Share your SQL scripts with teammates or make them public to the internet."
}
}
},
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 47592662b7..24f31e03a6 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1827,6 +1827,10 @@
"bb-feature-plugin-openai": {
"title": "AI 增强",
"desc": "AI 增强的 SQL 编辑器功能,基于 OpenAI 技术驱动。"
+ },
+ "bb-feature-shared-sql-script": {
+ "title": "共享 SQL 脚本",
+ "desc": "将 SQL 脚本分享至团队,或者公开到互联网。"
}
}
},
diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.ts
index 14ddead90b..dc20e6d013 100644
--- a/frontend/src/types/plan.ts
+++ b/frontend/src/types/plan.ts
@@ -40,6 +40,8 @@ export type FeatureType =
| "bb.feature.sensitive-data"
| "bb.feature.access-control"
| "bb.feature.custom-approval"
+ // Collaboration
+ | "bb.feature.shared-sql-script"
// Plugins
| "bb.feature.plugin.openai";
diff --git a/frontend/src/types/plan.yaml b/frontend/src/types/plan.yaml
index 24370ba24f..e3e2cf4cab 100644
--- a/frontend/src/types/plan.yaml
+++ b/frontend/src/types/plan.yaml
@@ -90,7 +90,6 @@ planList:
- type: gitops-workflow
content: gitops-workflow-basic
tooltip: gitops-workflow-basic-tooltip
- - type: shared-sql-script
- type: webhook-integration
content: webhook-integration-basic
tooltip: webhook-integration-basic-tooltip
diff --git a/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue b/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue
index 8307e9dae7..6622c0496a 100644
--- a/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue
@@ -50,7 +50,12 @@
<span class="ml-1">{{ $t("common.save") }}</span>
<span class="hidden sm:inline ml-1">(⌘+S)</span>
</NButton>
- <NPopover trigger="click" placement="bottom-end" :show-arrow="false">
+ <NPopover
+ trigger="click"
+ placement="bottom-end"
+ :show-arrow="false"
+ :disabled="!hasSharedSQLScriptFeature"
+ >
<template #trigger>
<NButton
:disabled="
@@ -58,8 +63,13 @@
tabStore.isDisconnected ||
!tabStore.currentTab.isSaved
"
+ @click="handleShareButtonClick"
>
<carbon:share class="h-5 w-5" /> &nbsp; {{ $t("common.share") }}
+ <FeatureBadge
+ :feature="'bb.feature.shared-sql-script'"
+ class="ml-2 text-accent"
+ />
</NButton>
</template>
<template #default>
@@ -69,22 +79,33 @@
</template>
</div>
</div>
+
+ <FeatureModal
+ v-if="state.requiredFeatureName"
+ :feature="state.requiredFeatureName"
+ @cancel="state.requiredFeatureName = undefined"
+ />
</template>
<script lang="ts" setup>
-import { computed, defineEmits } from "vue";
+import { computed, defineEmits, reactive } from "vue";
import {
useInstanceStore,
useTabStore,
useSQLEditorStore,
useInstanceById,
useWebTerminalStore,
+ featureToRef,
} from "@/store";
-import type { ExecuteConfig, ExecuteOption } from "@/types";
+import type { ExecuteConfig, ExecuteOption, FeatureType } from "@/types";
import { TabMode, UNKNOWN_ID } from "@/types";
import SharePopover from "./SharePopover.vue";
import AdminModeButton from "./AdminModeButton.vue";
+interface LocalState {
+ requiredFeatureName?: FeatureType;
+}
+
const emit = defineEmits<{
(e: "save-sheet", content?: string): void;
(
@@ -96,10 +117,12 @@ const emit = defineEmits<{
(e: "clear-screen"): void;
}>();
+const state = reactive<LocalState>({});
const instanceStore = useInstanceStore();
const tabStore = useTabStore();
const sqlEditorStore = useSQLEditorStore();
const webTerminalStore = useWebTerminalStore();
+const hasSharedSQLScriptFeature = featureToRef("bb.feature.shared-sql-script");
const connection = computed(() => tabStore.currentTab.connection);
@@ -190,4 +213,10 @@ const handleFormatSQL = () => {
const handleClearScreen = () => {
emit("clear-screen");
};
+
+const handleShareButtonClick = () => {
+ if (!hasSharedSQLScriptFeature.value) {
+ state.requiredFeatureName = "bb.feature.shared-sql-script";
+ }
+};
</script>