mirror of
https://github.com/nocodb/nocodb.git
synced 2026-02-01 23:48:33 +00:00
prefixing column refs
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { ViewTypes } from 'nocodb-sdk';
|
||||
import { swaggerSanitizeSchemaName } from 'src/helpers/stringHelpers';
|
||||
import type { SourcesMap } from '~/services/api-docs/types';
|
||||
import type {
|
||||
Base,
|
||||
@@ -100,6 +99,7 @@ export async function generateSwagger<TSwaggerColumn, TSwaggerView>(
|
||||
context: NcContext,
|
||||
param: {
|
||||
columns: any[];
|
||||
model: Model;
|
||||
base: Base;
|
||||
sourcesMap: SourcesMap;
|
||||
},
|
||||
@@ -162,6 +162,7 @@ export async function generateSwagger<TSwaggerColumn, TSwaggerView>(
|
||||
context,
|
||||
{
|
||||
columns: await model.getColumns(context, ncMeta),
|
||||
model,
|
||||
sourcesMap,
|
||||
base,
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { RelationTypes, UITypes } from 'nocodb-sdk';
|
||||
import { FormulaDataTypes } from 'nocodb-sdk';
|
||||
import type { Column, LinkToAnotherRecordColumn } from '~/models';
|
||||
import type { Column, LinkToAnotherRecordColumn, Model } from '~/models';
|
||||
import type { NcContext } from '~/interface/config';
|
||||
import type LookupColumn from '~/models/LookupColumn';
|
||||
import type { DriverClient } from '~/utils/nc-config';
|
||||
@@ -8,6 +8,7 @@ import type { SourcesMap } from '~/services/api-docs/types';
|
||||
import { Base } from '~/models';
|
||||
import SwaggerTypes from '~/db/sql-mgr/code/routers/xc-ts/SwaggerTypes';
|
||||
import Noco from '~/Noco';
|
||||
import { swaggerGetSourcePrefix } from '~/helpers/dbHelpers';
|
||||
|
||||
// Helper function to process a single column and return its swagger field definition
|
||||
async function processColumnToSwaggerField(
|
||||
@@ -15,12 +16,14 @@ async function processColumnToSwaggerField(
|
||||
{
|
||||
column,
|
||||
base,
|
||||
model,
|
||||
sourcesMap,
|
||||
isLookupHelper = false,
|
||||
dbType,
|
||||
}: {
|
||||
column: Column;
|
||||
base: Base;
|
||||
model: Model;
|
||||
sourcesMap: SourcesMap;
|
||||
isLookupHelper?: boolean;
|
||||
dbType: DriverClient;
|
||||
@@ -33,6 +36,7 @@ async function processColumnToSwaggerField(
|
||||
virtual: true,
|
||||
column,
|
||||
};
|
||||
const source = sourcesMap.get(model.source_id);
|
||||
|
||||
switch (column.uidt) {
|
||||
case UITypes.LinkToAnotherRecord:
|
||||
@@ -111,6 +115,7 @@ async function processColumnToSwaggerField(
|
||||
{
|
||||
column: lookupCol,
|
||||
base,
|
||||
model,
|
||||
sourcesMap,
|
||||
isLookupHelper: true,
|
||||
dbType,
|
||||
@@ -149,6 +154,7 @@ async function processColumnToSwaggerField(
|
||||
column: lookupCol,
|
||||
base: refBase,
|
||||
sourcesMap,
|
||||
model,
|
||||
isLookupHelper: true,
|
||||
dbType,
|
||||
},
|
||||
@@ -229,10 +235,12 @@ export default async (
|
||||
{
|
||||
columns,
|
||||
base,
|
||||
model,
|
||||
sourcesMap,
|
||||
}: {
|
||||
columns: Column[];
|
||||
base: Base;
|
||||
model: Model;
|
||||
sourcesMap: SourcesMap;
|
||||
},
|
||||
ncMeta = Noco.ncMeta,
|
||||
@@ -250,6 +258,7 @@ export default async (
|
||||
column: c,
|
||||
sourcesMap,
|
||||
base,
|
||||
model,
|
||||
dbType,
|
||||
isLookupHelper: false,
|
||||
},
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { RelationTypes, UITypes } from 'nocodb-sdk';
|
||||
import { FormulaDataTypes } from 'nocodb-sdk';
|
||||
import type { SourcesMap } from '~/services/api-docs/types';
|
||||
import type { Column, LinkToAnotherRecordColumn } from '~/models';
|
||||
import type { Column, LinkToAnotherRecordColumn, Model } from '~/models';
|
||||
import type { NcContext } from '~/interface/config';
|
||||
import type LookupColumn from '~/models/LookupColumn';
|
||||
import type { DriverClient } from '~/utils/nc-config';
|
||||
import { Base } from '~/models';
|
||||
import SwaggerTypes from '~/db/sql-mgr/code/routers/xc-ts/SwaggerTypes';
|
||||
import Noco from '~/Noco';
|
||||
import { swaggerGetSourcePrefix } from '~/helpers/dbHelpers';
|
||||
|
||||
// Helper function to process a single column and return its swagger field definition
|
||||
async function processColumnToSwaggerField(
|
||||
@@ -15,12 +16,15 @@ async function processColumnToSwaggerField(
|
||||
{
|
||||
column,
|
||||
base,
|
||||
model,
|
||||
|
||||
sourcesMap,
|
||||
isLookupHelper = false,
|
||||
dbType,
|
||||
}: {
|
||||
column: Column;
|
||||
base: Base;
|
||||
model: Model;
|
||||
sourcesMap: SourcesMap;
|
||||
isLookupHelper?: boolean;
|
||||
dbType: DriverClient;
|
||||
@@ -33,6 +37,7 @@ async function processColumnToSwaggerField(
|
||||
virtual: true,
|
||||
column,
|
||||
};
|
||||
const source = sourcesMap.get(model.source_id);
|
||||
|
||||
switch (column.uidt) {
|
||||
case UITypes.LinkToAnotherRecord:
|
||||
@@ -98,6 +103,7 @@ async function processColumnToSwaggerField(
|
||||
{
|
||||
column: lookupCol,
|
||||
base,
|
||||
model,
|
||||
sourcesMap,
|
||||
isLookupHelper: true,
|
||||
dbType,
|
||||
@@ -135,6 +141,7 @@ async function processColumnToSwaggerField(
|
||||
{
|
||||
column: lookupCol,
|
||||
base: refBase,
|
||||
model,
|
||||
sourcesMap,
|
||||
isLookupHelper: true,
|
||||
dbType,
|
||||
@@ -217,10 +224,12 @@ export default async (
|
||||
{
|
||||
columns,
|
||||
base,
|
||||
model,
|
||||
sourcesMap,
|
||||
}: {
|
||||
columns: Column[];
|
||||
base: Base;
|
||||
model: Model;
|
||||
sourcesMap: SourcesMap;
|
||||
},
|
||||
ncMeta = Noco.ncMeta,
|
||||
@@ -239,6 +248,7 @@ export default async (
|
||||
column: c,
|
||||
sourcesMap,
|
||||
base,
|
||||
model,
|
||||
dbType,
|
||||
isLookupHelper: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user