1 parent
a90b00e77a
commit
320e37aa42
17 files changed
+781
-15
No files matched your search
@@ -9,7 +9,7 @@ import { copyToClipboard } from "@/lib/common/clipboard";
|
||||
import { formatSqlForDisplay, type SqlFormatDialect } from "@/lib/sql/sqlFormatter";
|
||||
import { buildEditableObjectSource, buildExecutableObjectSourceStatements, executeObjectSourceSave, formatObjectSourceSaveError, resolveObjectSourceEditDraft } from "@/lib/table/objectSourceEditor";
|
||||
import { loadObjectSourceWithRoutineFallback } from "@/lib/table/objectSourceLoad";
|
||||
import { xuguRoutineMetadataFromDefinition, type XuguRoutineMetadata } from "@/lib/table/routineParameters";
|
||||
import { jdbcRoutineMetadata, xuguRoutineMetadataFromDefinition, type RoutineMetadata } from "@/lib/table/routineParameters";
|
||||
import { executeWithProductionSqlGuard } from "@/lib/database/productionExecutionGuard";
|
||||
import * as api from "@/lib/backend/api";
|
||||
import QueryEditor from "@/components/editor/QueryEditor.vue";
|
||||
@@ -57,7 +57,7 @@ const editing = ref(false);
|
||||
const sourceEditable = ref(true);
|
||||
const error = ref("");
|
||||
const saveError = ref("");
|
||||
const routineMetadata = ref<XuguRoutineMetadata | null>(null);
|
||||
const routineMetadata = ref<RoutineMetadata | null>(null);
|
||||
/** May differ from props.objectType after PROCEDURE/FUNCTION/PACKAGE fallback resolution. */
|
||||
const resolvedObjectType = ref<ObjectSourceKind>(props.objectType);
|
||||
let loadSerial = 0;
|
||||
@@ -111,7 +111,8 @@ async function loadSource(nextEditing = props.initialEditing && canEdit.value) {
|
||||
});
|
||||
if (serial !== loadSerial) return;
|
||||
resolvedObjectType.value = resolvedType;
|
||||
routineMetadata.value = props.databaseType === "xugu" && (resolvedType === "PROCEDURE" || resolvedType === "FUNCTION") ? xuguRoutineMetadataFromDefinition(result.source) : null;
|
||||
const isRoutine = resolvedType === "PROCEDURE" || resolvedType === "FUNCTION";
|
||||
routineMetadata.value = !isRoutine ? null : result.routine_parameters !== undefined ? jdbcRoutineMetadata(result.routine_parameters) : target.databaseType === "xugu" ? xuguRoutineMetadataFromDefinition(result.source) : null;
|
||||
sourceEditable.value = editableAllowed;
|
||||
const displaySource = resolvedType === "SEQUENCE" ? result.source : editable;
|
||||
const formatted = await formatSqlForDisplay(displaySource, target.formatDialect ?? target.dialect, settingsStore.editorSettings.sqlFormatter);
|
||||
@@ -259,6 +260,7 @@ function closeDialog() {
|
||||
<div v-else class="flex min-h-0 flex-col gap-3 overflow-hidden">
|
||||
<RoutineMetadataPanel v-if="hasRoutineMetadata && routineMetadata" :parameters="routineMetadata.parameters" :return-type="routineMetadata.returnType" />
|
||||
<QueryEditor
|
||||
v-if="content || !hasRoutineMetadata"
|
||||
:key="`${props.connectionId}:${props.database}:${props.schema || ''}:${props.name}:${props.objectType}`"
|
||||
:model-value="content"
|
||||
class="object-source-dialog-editor min-h-0 flex-1 overflow-hidden rounded border"
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import type { RoutineParameter } from "@/lib/table/routineExecutionSql";
|
||||
|
||||
defineProps<{
|
||||
const props = defineProps<{
|
||||
parameters: RoutineParameter[];
|
||||
returnType?: string;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const showNullable = computed(() => props.parameters.some((parameter) => parameter.nullable !== undefined && parameter.nullable !== null));
|
||||
|
||||
function defaultLabel(parameter: RoutineParameter): string {
|
||||
if (!parameter.hasDefault) return "-";
|
||||
return parameter.defaultValue?.trim() || "DEFAULT";
|
||||
}
|
||||
|
||||
function nullableLabel(parameter: RoutineParameter): string {
|
||||
if (parameter.nullable === true) return t("structureEditor.nullable");
|
||||
if (parameter.nullable === false) return t("structureEditor.notNull");
|
||||
return "-";
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -21,17 +29,25 @@ function defaultLabel(parameter: RoutineParameter): string {
|
||||
<span class="font-semibold text-muted-foreground">RETURN</span>
|
||||
<span class="font-mono">{{ returnType }}</span>
|
||||
</div>
|
||||
<div v-if="parameters.length" class="min-w-[620px]">
|
||||
<div class="grid grid-cols-[minmax(140px,1.2fr)_minmax(150px,1.3fr)_80px_minmax(150px,1.3fr)] border-b bg-muted px-3 py-2 text-xs font-medium text-muted-foreground">
|
||||
<div v-if="parameters.length" :class="showNullable ? 'min-w-[720px]' : 'min-w-[620px]'">
|
||||
<div class="grid border-b bg-muted px-3 py-2 text-xs font-medium text-muted-foreground" :class="showNullable ? 'grid-cols-[minmax(140px,1.2fr)_minmax(150px,1.3fr)_80px_100px_minmax(150px,1.3fr)]' : 'grid-cols-[minmax(140px,1.2fr)_minmax(150px,1.3fr)_80px_minmax(150px,1.3fr)]'">
|
||||
<div>{{ t("contextMenu.parameterName") }}</div>
|
||||
<div>{{ t("contextMenu.parameterType") }}</div>
|
||||
<div>{{ t("contextMenu.parameterMode") }}</div>
|
||||
<div v-if="showNullable">{{ t("structureEditor.nullable") }}</div>
|
||||
<div>{{ t("contextMenu.parameterDefault") }}</div>
|
||||
</div>
|
||||
<div v-for="parameter in parameters" :key="`${parameter.ordinal}:${parameter.name}`" class="grid grid-cols-[minmax(140px,1.2fr)_minmax(150px,1.3fr)_80px_minmax(150px,1.3fr)] gap-2 border-b px-3 py-2 text-xs last:border-b-0" data-routine-parameter>
|
||||
<div
|
||||
v-for="parameter in parameters"
|
||||
:key="`${parameter.ordinal}:${parameter.name}`"
|
||||
class="grid gap-2 border-b px-3 py-2 text-xs last:border-b-0"
|
||||
:class="showNullable ? 'grid-cols-[minmax(140px,1.2fr)_minmax(150px,1.3fr)_80px_100px_minmax(150px,1.3fr)]' : 'grid-cols-[minmax(140px,1.2fr)_minmax(150px,1.3fr)_80px_minmax(150px,1.3fr)]'"
|
||||
data-routine-parameter
|
||||
>
|
||||
<div class="truncate font-medium" :title="parameter.name">{{ parameter.name }}</div>
|
||||
<div class="truncate font-mono text-muted-foreground" :title="parameter.dataType">{{ parameter.dataType }}</div>
|
||||
<div class="text-muted-foreground">{{ parameter.mode }}</div>
|
||||
<div v-if="showNullable" class="text-muted-foreground" data-routine-nullable>{{ nullableLabel(parameter) }}</div>
|
||||
<div class="truncate font-mono text-muted-foreground" :title="defaultLabel(parameter)">
|
||||
{{ defaultLabel(parameter) }}
|
||||
</div>
|
||||
|
||||
Vendored
+111
@@ -0,0 +1,111 @@
|
||||
// @vitest-environment happy-dom
|
||||
|
||||
import { createApp, defineComponent, h, type App } from "vue";
|
||||
import { createPinia, setActivePinia } from "pinia";
|
||||
import { createI18n } from "vue-i18n";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { useConnectionStore } from "@/stores/connectionStore";
|
||||
import ObjectSourceDialog from "@/components/objects/ObjectSourceDialog.vue";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
getObjectSource: vi.fn(),
|
||||
buildEditableObjectSource: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/backend/api", async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import("@/lib/backend/api")>()),
|
||||
...mocks,
|
||||
}));
|
||||
vi.mock("@/components/editor/QueryEditor.vue", () => ({
|
||||
default: defineComponent({
|
||||
name: "QueryEditorStub",
|
||||
props: { modelValue: { type: String, default: "" } },
|
||||
template: "<div data-query-editor-stub>{{ modelValue }}</div>",
|
||||
}),
|
||||
}));
|
||||
|
||||
const mountedApps: Array<{ app: App; host: HTMLElement }> = [];
|
||||
|
||||
afterEach(() => {
|
||||
for (const { app, host } of mountedApps.splice(0)) {
|
||||
app.unmount();
|
||||
host.remove();
|
||||
}
|
||||
vi.restoreAllMocks();
|
||||
Object.values(mocks).forEach((mock) => mock.mockReset());
|
||||
});
|
||||
|
||||
async function mountDialog() {
|
||||
const pinia = createPinia();
|
||||
setActivePinia(pinia);
|
||||
const connectionStore = useConnectionStore();
|
||||
vi.spyOn(connectionStore, "ensureConnected").mockResolvedValue(undefined);
|
||||
const host = document.createElement("div");
|
||||
document.body.append(host);
|
||||
const app = createApp({
|
||||
render: () =>
|
||||
h(ObjectSourceDialog, {
|
||||
open: true,
|
||||
connectionId: "jdbc-1",
|
||||
database: "catalog1",
|
||||
schema: "APP",
|
||||
name: "calculate_total",
|
||||
objectType: "FUNCTION",
|
||||
databaseType: "jdbc",
|
||||
dialect: "mysql",
|
||||
}),
|
||||
});
|
||||
app.use(pinia);
|
||||
app.use(createI18n({ legacy: false, locale: "en", messages: { en: {} }, missingWarn: false, fallbackWarn: false }));
|
||||
app.mount(host);
|
||||
mountedApps.push({ app, host });
|
||||
return host;
|
||||
}
|
||||
|
||||
describe("ObjectSourceDialog generic JDBC routine metadata", () => {
|
||||
it("renders a source-less function as read-only structured metadata", async () => {
|
||||
mocks.getObjectSource.mockResolvedValue({
|
||||
name: "calculate_total",
|
||||
object_type: "FUNCTION",
|
||||
schema: "APP",
|
||||
source: "",
|
||||
editable: false,
|
||||
routine_parameters: [
|
||||
{ name: "result", mode: "OUT", jdbc_type: 12, type_name: "VARCHAR", length: 32, nullable: true, ordinal: 2 },
|
||||
{ name: "RETURN", mode: "RETURN", jdbc_type: 3, type_name: "DECIMAL", precision: 12, scale: 2, ordinal: 0 },
|
||||
{ name: "amount", mode: "IN", jdbc_type: 3, type_name: "DECIMAL", precision: 10, scale: 2, nullable: false, ordinal: 1 },
|
||||
],
|
||||
});
|
||||
mocks.buildEditableObjectSource.mockResolvedValue("");
|
||||
|
||||
await mountDialog();
|
||||
await vi.waitFor(() => expect(document.querySelectorAll("[data-routine-parameter]")).toHaveLength(2));
|
||||
|
||||
expect(document.querySelector("[data-routine-return-type]")?.textContent).toContain("DECIMAL(12,2)");
|
||||
const rows = [...document.querySelectorAll("[data-routine-parameter]")];
|
||||
expect(rows[0].textContent).toContain("amount");
|
||||
expect(rows[0].textContent).toContain("DECIMAL(10,2)");
|
||||
expect(rows[1].textContent).toContain("VARCHAR(32)");
|
||||
expect(document.querySelector("[data-query-editor-stub]")).toBeNull();
|
||||
expect(document.body.textContent).not.toContain("Object source is not supported");
|
||||
expect(mocks.getObjectSource).toHaveBeenCalledTimes(1);
|
||||
expect([...document.querySelectorAll("button")].some((button) => button.textContent?.trim() === "contextMenu.editView")).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps a legacy source payload without the optional field on the existing preview path", async () => {
|
||||
mocks.getObjectSource.mockResolvedValue({
|
||||
name: "calculate_total",
|
||||
object_type: "FUNCTION",
|
||||
schema: "APP",
|
||||
source: "CREATE FUNCTION calculate_total() RETURNS INTEGER RETURN 1",
|
||||
editable: false,
|
||||
});
|
||||
mocks.buildEditableObjectSource.mockResolvedValue("CREATE FUNCTION calculate_total() RETURNS INTEGER RETURN 1");
|
||||
|
||||
await mountDialog();
|
||||
await vi.waitFor(() => expect(document.querySelector("[data-query-editor-stub]")).not.toBeNull());
|
||||
|
||||
expect(document.querySelector("[data-routine-metadata]")).toBeNull();
|
||||
expect(document.querySelector("[data-query-editor-stub]")?.textContent).toContain("CREATE FUNCTION");
|
||||
});
|
||||
});
|
||||
@@ -50,4 +50,22 @@ describe("RoutineMetadataPanel", () => {
|
||||
expect(host.querySelector("[data-routine-return-type]")?.textContent).toContain("INTEGER");
|
||||
expect(host.querySelectorAll("[data-routine-parameter]")).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("renders known JDBC nullability without changing legacy parameter rows", () => {
|
||||
const host = document.createElement("div");
|
||||
document.body.append(host);
|
||||
const app = createApp(RoutineMetadataPanel, {
|
||||
parameters: [
|
||||
{ name: "required_id", dataType: "BIGINT", mode: "IN", ordinal: 1, nullable: false },
|
||||
{ name: "optional_note", dataType: "VARCHAR(64)", mode: "OUT", ordinal: 2, nullable: true },
|
||||
{ name: "unknown", dataType: "OTHER", mode: "UNKNOWN", ordinal: 3, nullable: null },
|
||||
],
|
||||
});
|
||||
app.use(i18n);
|
||||
app.mount(host);
|
||||
mountedApps.push({ app, host });
|
||||
|
||||
const nullability = [...host.querySelectorAll("[data-routine-nullable]")].map((cell) => cell.textContent?.trim());
|
||||
expect(nullability).toEqual(["Not null", "Nullable", "-"]);
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,6 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { loadEditableObjectSourceForEditor, loadObjectSourceWithRoutineFallback } from "@/lib/table/objectSourceLoad";
|
||||
import { jdbcRoutineMetadata } from "@/lib/table/routineParameters";
|
||||
import type { ObjectSource } from "@/types/database";
|
||||
|
||||
function source(text: string): ObjectSource {
|
||||
@@ -26,6 +27,38 @@ describe("loadObjectSourceWithRoutineFallback", () => {
|
||||
expect(getObjectSource).toHaveBeenCalledTimes(2);
|
||||
expect(getObjectSource.mock.calls[1][4]).toBe("FUNCTION");
|
||||
});
|
||||
|
||||
it("keeps a source-less routine response when structured metadata is present", async () => {
|
||||
const getObjectSource = vi.fn().mockResolvedValue({ ...source(""), editable: false, routine_parameters: [] });
|
||||
const result = await loadObjectSourceWithRoutineFallback(getObjectSource, "c1", "catalog", "APP", "P1", "PROCEDURE");
|
||||
|
||||
expect(result.objectType).toBe("PROCEDURE");
|
||||
expect(result.source.routine_parameters).toEqual([]);
|
||||
expect(getObjectSource).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("jdbcRoutineMetadata", () => {
|
||||
it("keeps legacy payloads optional and normalizes sorted JDBC display metadata", () => {
|
||||
expect(jdbcRoutineMetadata(undefined)).toBeNull();
|
||||
expect(
|
||||
jdbcRoutineMetadata([
|
||||
{ name: "p_note", mode: "OUT", jdbc_type: 12, type_name: "VARCHAR", length: 64, nullable: true, ordinal: 3 },
|
||||
{ name: null, mode: "RETURN", jdbc_type: 3, type_name: "DECIMAL", precision: 12, scale: 3, ordinal: 0 },
|
||||
{ name: "p_id", mode: "IN", jdbc_type: -5, type_name: "BIGINT", nullable: false, ordinal: 1 },
|
||||
{ name: null, mode: "INOUT", jdbc_type: null, type_name: null, nullable: null, ordinal: 2 },
|
||||
{ name: "p_unknown", mode: "UNKNOWN" },
|
||||
]),
|
||||
).toEqual({
|
||||
returnType: "DECIMAL(12,3)",
|
||||
parameters: [
|
||||
{ name: "p_id", dataType: "BIGINT", mode: "IN", ordinal: 1, hasDefault: false, nullable: false },
|
||||
{ name: "arg2", dataType: "UNKNOWN", mode: "INOUT", ordinal: 2, hasDefault: false, nullable: null },
|
||||
{ name: "p_note", dataType: "VARCHAR(64)", mode: "OUT", ordinal: 3, hasDefault: false, nullable: true },
|
||||
{ name: "p_unknown", dataType: "UNKNOWN", mode: "UNKNOWN", ordinal: 4, hasDefault: false, nullable: undefined },
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("loadEditableObjectSourceForEditor", () => {
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function loadObjectSourceWithRoutineFallback(
|
||||
relationName?: string,
|
||||
): Promise<{ source: ObjectSource; objectType: ObjectSourceKind }> {
|
||||
const primary = await getObjectSource(connectionId, database, schema, name, objectType, signature, relationName);
|
||||
if (primary.source?.trim()) {
|
||||
if (primary.source?.trim() || primary.routine_parameters !== undefined) {
|
||||
return { source: primary, objectType };
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export async function loadObjectSourceWithRoutineFallback(
|
||||
for (const fallbackType of fallbacks) {
|
||||
try {
|
||||
const alternate = await getObjectSource(connectionId, database, schema, name, fallbackType, signature, relationName);
|
||||
if (alternate.source?.trim()) {
|
||||
if (alternate.source?.trim() || alternate.routine_parameters !== undefined) {
|
||||
return { source: alternate, objectType: fallbackType };
|
||||
}
|
||||
} catch {
|
||||
|
||||
@@ -17,6 +17,7 @@ export interface RoutineParameter {
|
||||
ordinal: number;
|
||||
hasDefault?: boolean;
|
||||
defaultValue?: string | null;
|
||||
nullable?: boolean | null;
|
||||
}
|
||||
|
||||
export interface RoutineParameterValue extends RoutineParameter {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as api from "@/lib/backend/api";
|
||||
import type { DatabaseType, QueryResult } from "@/types/database";
|
||||
import type { DatabaseType, QueryResult, RoutineParameterMetadata } from "@/types/database";
|
||||
import type { RoutineParameter, RoutineParameterMode } from "@/lib/table/routineExecutionSql";
|
||||
|
||||
export interface LoadRoutineParametersOptions {
|
||||
@@ -142,12 +142,72 @@ ORDER BY SEQUENCE;`.trim();
|
||||
return null;
|
||||
}
|
||||
|
||||
export interface XuguRoutineMetadata {
|
||||
export interface RoutineMetadata {
|
||||
kind?: "PROCEDURE" | "FUNCTION";
|
||||
parameters: RoutineParameter[];
|
||||
returnType?: string;
|
||||
}
|
||||
|
||||
export type XuguRoutineMetadata = RoutineMetadata;
|
||||
|
||||
/** Convert optional generic-JDBC wire metadata into the existing read-only panel model. */
|
||||
export function jdbcRoutineMetadata(parameters: RoutineParameterMetadata[] | undefined): RoutineMetadata | null {
|
||||
if (parameters === undefined) return null;
|
||||
|
||||
const ordered = parameters
|
||||
.map((parameter, index) => ({ parameter, index }))
|
||||
.sort((left, right) => routineMetadataOrdinal(left.parameter) - routineMetadataOrdinal(right.parameter) || left.index - right.index)
|
||||
.map(({ parameter }) => parameter);
|
||||
const returnParameter = ordered.find((parameter) => parameter.mode === "RETURN");
|
||||
return {
|
||||
parameters: ordered
|
||||
.filter((parameter) => parameter.mode !== "RETURN")
|
||||
.map((parameter, index) => ({
|
||||
name: parameter.name?.trim() || `arg${positiveRoutineOrdinal(parameter.ordinal) ?? index + 1}`,
|
||||
dataType: jdbcRoutineParameterType(parameter),
|
||||
mode: parameter.mode,
|
||||
ordinal: positiveRoutineOrdinal(parameter.ordinal) ?? index + 1,
|
||||
hasDefault: false,
|
||||
nullable: parameter.nullable,
|
||||
})),
|
||||
returnType: returnParameter ? jdbcRoutineParameterType(returnParameter) : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
function routineMetadataOrdinal(parameter: RoutineParameterMetadata): number {
|
||||
return typeof parameter.ordinal === "number" && Number.isFinite(parameter.ordinal) ? parameter.ordinal : Number.MAX_SAFE_INTEGER;
|
||||
}
|
||||
|
||||
function positiveRoutineOrdinal(ordinal: number | null | undefined): number | undefined {
|
||||
return typeof ordinal === "number" && Number.isFinite(ordinal) && ordinal > 0 ? ordinal : undefined;
|
||||
}
|
||||
|
||||
function jdbcRoutineParameterType(parameter: RoutineParameterMetadata): string {
|
||||
const typeName = parameter.type_name?.trim() || (typeof parameter.jdbc_type === "number" ? `JDBC ${parameter.jdbc_type}` : "UNKNOWN");
|
||||
if (/\([^)]*\)\s*$/.test(typeName)) return typeName;
|
||||
|
||||
const jdbcType = parameter.jdbc_type;
|
||||
const precision = positiveMetadataSize(parameter.precision);
|
||||
const length = positiveMetadataSize(parameter.length);
|
||||
const scale = typeof parameter.scale === "number" && Number.isFinite(parameter.scale) && parameter.scale >= 0 ? parameter.scale : undefined;
|
||||
if (jdbcType === 2 || jdbcType === 3) {
|
||||
if (precision === undefined) return typeName;
|
||||
return scale === undefined ? `${typeName}(${precision})` : `${typeName}(${precision},${scale})`;
|
||||
}
|
||||
if (jdbcType === 92 || jdbcType === 93 || jdbcType === 2013 || jdbcType === 2014) {
|
||||
return scale === undefined ? typeName : `${typeName}(${scale})`;
|
||||
}
|
||||
if (jdbcType === 1 || jdbcType === 12 || jdbcType === -1 || jdbcType === -15 || jdbcType === -9 || jdbcType === -16 || jdbcType === -2 || jdbcType === -3 || jdbcType === -4) {
|
||||
const size = length ?? precision;
|
||||
return size === undefined ? typeName : `${typeName}(${size})`;
|
||||
}
|
||||
return typeName;
|
||||
}
|
||||
|
||||
function positiveMetadataSize(value: number | null | undefined): number | undefined {
|
||||
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : undefined;
|
||||
}
|
||||
|
||||
interface XuguRoutineToken {
|
||||
kind: "word" | "quoted-identifier" | "string" | "symbol";
|
||||
text: string;
|
||||
|
||||
@@ -1024,12 +1024,28 @@ export interface ObjectStatistics {
|
||||
|
||||
export type ObjectSourceKind = "VIEW" | "MATERIALIZED_VIEW" | "PROCEDURE" | "FUNCTION" | "TRIGGER" | "EVENT" | "SEQUENCE" | "SYNONYM" | "JOB" | "PACKAGE" | "PACKAGE_BODY" | "TYPE" | "TYPE_BODY";
|
||||
|
||||
export type RoutineParameterMetadataMode = "IN" | "OUT" | "INOUT" | "RETURN" | "UNKNOWN";
|
||||
|
||||
export interface RoutineParameterMetadata {
|
||||
name?: string | null;
|
||||
mode: RoutineParameterMetadataMode;
|
||||
jdbc_type?: number | null;
|
||||
type_name?: string | null;
|
||||
precision?: number | null;
|
||||
length?: number | null;
|
||||
scale?: number | null;
|
||||
nullable?: boolean | null;
|
||||
ordinal?: number | null;
|
||||
}
|
||||
|
||||
export interface ObjectSource {
|
||||
name: string;
|
||||
object_type: ObjectSourceKind;
|
||||
schema?: string | null;
|
||||
source: string;
|
||||
editable?: boolean;
|
||||
/** Optional structured metadata exposed by generic JDBC sidecars. */
|
||||
routine_parameters?: RoutineParameterMetadata[];
|
||||
}
|
||||
|
||||
export interface MysqlEventInfo {
|
||||
|
||||
Reference in new issue
Block a user