diff --git a/packages/nc-gui/components/virtual-cell/components/ListItems.vue b/packages/nc-gui/components/virtual-cell/components/ListItems.vue index 6122bf9357..2df6f5702d 100644 --- a/packages/nc-gui/components/virtual-cell/components/ListItems.vue +++ b/packages/nc-gui/components/virtual-cell/components/ListItems.vue @@ -252,7 +252,6 @@ watch(vModel, (nextVal) => { - diff --git a/packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts b/packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts index 02b5c4e343..3f6a85b9c2 100644 --- a/packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts @@ -345,7 +345,16 @@ export default class SqlMgr { * @returns * @memberof SqlMgr */ - public async projectGetSqlClient(args): Promise { + public async projectGetSqlClient( + args + ): Promise< + | SnowflakeClient + | MysqlClient + | SqliteClient + | MssqlClient + | OracleClient + | PGClient + > { const func = this.projectGetSqlClient.name; log.api(`${func}:args:`, args); diff --git a/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2.ts index cdf4d8f1f1..d32a40d1d0 100644 --- a/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2.ts +++ b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2.ts @@ -1,7 +1,7 @@ import fs from 'fs'; import path from 'path'; import { promisify } from 'util'; -import { Knex } from 'knex'; +import { Knex } from 'knex'; import glob from 'glob'; import SqlClientFactory from '../../sql-client/lib/SqlClientFactory'; @@ -754,7 +754,7 @@ export default class KnexMigratorv2 { const vm = this; const trx = sqlClient.knex.isTransaction - ? sqlClient.knex as Knex.Transaction + ? (sqlClient.knex as Knex.Transaction) : await sqlClient.knex.transaction(); try { for (const query of upStatements) { @@ -921,7 +921,7 @@ export default class KnexMigratorv2 { const vm = this; const trx = sqlClient.knex.isTransaction - ? sqlClient.knex as Knex.Transaction + ? (sqlClient.knex as Knex.Transaction) : await sqlClient.knex.transaction(); try { for (const query of downStatements) { diff --git a/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2Tans.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2Tans.ts index 037cf6d559..87204964a0 100644 --- a/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2Tans.ts +++ b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2Tans.ts @@ -31,7 +31,16 @@ export default class KnexMigratorv2Tans extends KnexMigratorv2 { protected get metaDb(): XKnex { return this.ncMeta.knex || Noco.ncMeta.knex; } - protected async getSqlClient(base: Base): Promise { + protected async getSqlClient( + base: Base + ): Promise< + | SnowflakeClient + | MysqlClient + | SqliteClient + | MssqlClient + | OracleClient + | PGClient + > { return this.sqlClient || NcConnectionMgrv2.getSqlClient(base); } } diff --git a/packages/nocodb/src/lib/meta/api/helpers/populateMeta.ts b/packages/nocodb/src/lib/meta/api/helpers/populateMeta.ts index 4fe72f70ac..ffe246a131 100644 --- a/packages/nocodb/src/lib/meta/api/helpers/populateMeta.ts +++ b/packages/nocodb/src/lib/meta/api/helpers/populateMeta.ts @@ -228,7 +228,7 @@ export async function populateMeta(base: Base, project: Project): Promise { return async () => { const columns = (await sqlClient.columnList({ tn: table.table_name })) ?.data?.list; - + mapDefaultDisplayValue(columns); /* create nc_models and its rows if it doesn't exists */ diff --git a/packages/nocodb/src/lib/meta/helpers/mapDefaultDisplayValue.ts b/packages/nocodb/src/lib/meta/helpers/mapDefaultDisplayValue.ts index 3fe911f447..a661f21818 100644 --- a/packages/nocodb/src/lib/meta/helpers/mapDefaultDisplayValue.ts +++ b/packages/nocodb/src/lib/meta/helpers/mapDefaultDisplayValue.ts @@ -4,7 +4,7 @@ export default function mapDefaultDisplayValue( columnsArr: Array ): void | T { if (!columnsArr.some((column) => column.pv)) { - const pkIndex = columnsArr.findIndex((column) => column.pk) + const pkIndex = columnsArr.findIndex((column) => column.pk); // if PK is at the end of table if (pkIndex === columnsArr.length - 1) { @@ -15,11 +15,11 @@ export default function mapDefaultDisplayValue( columnsArr[0].pv = true; return columnsArr[0]; } - // pk is not at the end of table - } else if (pkIndex > -1) { + // pk is not at the end of table + } else if (pkIndex > -1) { columnsArr[pkIndex + 1].pv = true; return columnsArr[pkIndex + 1]; - // no pk at all + // no pk at all } else { if (columnsArr.length > 0) { columnsArr[0].pv = true; diff --git a/packages/nocodb/src/lib/version-upgrader/ncStickyColumnUpgrader.ts b/packages/nocodb/src/lib/version-upgrader/ncStickyColumnUpgrader.ts index 0a6e16c21e..1fa222cd17 100644 --- a/packages/nocodb/src/lib/version-upgrader/ncStickyColumnUpgrader.ts +++ b/packages/nocodb/src/lib/version-upgrader/ncStickyColumnUpgrader.ts @@ -40,8 +40,8 @@ export default async function ({ ncMeta }: NcUpgraderCtx) { // if no display value column is set if (!view_columns_meta.some((column) => column.pv)) { - const pkIndex = view_columns_meta.findIndex((column) => column.pk) - + const pkIndex = view_columns_meta.findIndex((column) => column.pk); + // if PK is at the end of table if (pkIndex === view_columns_meta.length - 1) { if (pkIndex > 0) { @@ -61,8 +61,8 @@ export default async function ({ ncMeta }: NcUpgraderCtx) { view_columns_meta[0].id ); } - // pk is not at the end of table - } else if (pkIndex > -1) { + // pk is not at the end of table + } else if (pkIndex > -1) { await ncMeta.metaUpdate( null, null, @@ -70,7 +70,7 @@ export default async function ({ ncMeta }: NcUpgraderCtx) { { pv: true }, view_columns_meta[pkIndex + 1].id ); - // no pk at all + // no pk at all } else if (view_columns_meta.length > 0) { await ncMeta.metaUpdate( null,