feat: Enforce data-stores limits (no-changelog) (#19116)

Co-authored-by: Charlie Kolb <charlie@n8n.io>
This commit is contained in:
Ricardo Espinoza
2025-09-10 09:39:41 -04:00
committed by GitHub
parent 815ecfe680
commit eb389a787b
17 changed files with 559 additions and 27 deletions

View File

@@ -1,5 +1,7 @@
import { DATA_STORE_COLUMN_REGEX, type DataStoreCreateColumnSchema } from '@n8n/api-types';
import { GlobalConfig } from '@n8n/config';
import { DslColumn } from '@n8n/db';
import { Container } from '@n8n/di';
import type { DataSourceOptions } from '@n8n/typeorm';
import type { DataStoreColumnJsType, DataStoreRowReturn, DataStoreRowsReturn } from 'n8n-workflow';
import { UnexpectedError } from 'n8n-workflow';
@@ -286,3 +288,8 @@ export function escapeLikeSpecials(input: string): string {
.replace(/\\/g, '\\\\') // escape the escape char itself
.replace(/_/g, '\\_'); // make '_' literal ('%' stays a wildcard)
}
export function toTableName(dataStoreId: string): DataStoreUserTableName {
const { tablePrefix } = Container.get(GlobalConfig).database;
return `${tablePrefix}data_table_user_${dataStoreId}`;
}