mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 02:06:01 +00:00
feat: add test for table creation with comments
This commit is contained in:
@@ -64,6 +64,40 @@ describe('Table create', () => {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
test.each(
|
||||||
|
engines.filter(i => i.supportTableComments || i.supportColumnComments).map(engine => [engine.label, engine])
|
||||||
|
)(
|
||||||
|
'Simple table with comment - %s',
|
||||||
|
testWrapper(async (conn, driver, engine) => {
|
||||||
|
await testTableCreate(engine, conn, driver, {
|
||||||
|
...(engine.supportTableComments && {
|
||||||
|
schemaName: 'dbo',
|
||||||
|
objectComment: 'table comment',
|
||||||
|
}),
|
||||||
|
...(engine.defaultSchemaName && {
|
||||||
|
schemaName: engine.defaultSchemaName,
|
||||||
|
}),
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
columnName: 'col1',
|
||||||
|
dataType: 'int',
|
||||||
|
pureName: 'tested',
|
||||||
|
...(engine.skipNullability ? {} : { notNull: true }),
|
||||||
|
...(engine.supportColumnComments && {
|
||||||
|
columnComment: 'column comment',
|
||||||
|
}),
|
||||||
|
...(engine.defaultSchemaName && {
|
||||||
|
schemaName: engine.defaultSchemaName,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
primaryKey: {
|
||||||
|
columns: [{ columnName: 'col1' }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
test.each(engines.filter(x => !x.skipIndexes).map(engine => [engine.label, engine]))(
|
test.each(engines.filter(x => !x.skipIndexes).map(engine => [engine.label, engine]))(
|
||||||
'Table with index - %s',
|
'Table with index - %s',
|
||||||
testWrapper(async (conn, driver, engine) => {
|
testWrapper(async (conn, driver, engine) => {
|
||||||
|
|||||||
@@ -443,6 +443,8 @@ const sqlServerEngine = {
|
|||||||
supportSchemas: true,
|
supportSchemas: true,
|
||||||
supportRenameSqlObject: true,
|
supportRenameSqlObject: true,
|
||||||
defaultSchemaName: 'dbo',
|
defaultSchemaName: 'dbo',
|
||||||
|
supportTableComments: true,
|
||||||
|
supportColumnComments: true,
|
||||||
// skipSeparateSchemas: true,
|
// skipSeparateSchemas: true,
|
||||||
triggers: [
|
triggers: [
|
||||||
{
|
{
|
||||||
|
|||||||
3
packages/types/test-engines.d.ts
vendored
3
packages/types/test-engines.d.ts
vendored
@@ -56,6 +56,9 @@ export type TestEngineInfo = {
|
|||||||
|
|
||||||
useTextTypeForStrings?: boolean;
|
useTextTypeForStrings?: boolean;
|
||||||
|
|
||||||
|
supportTableComments?: boolean;
|
||||||
|
supportColumnComments?: boolean;
|
||||||
|
|
||||||
supportRenameSqlObject?: boolean;
|
supportRenameSqlObject?: boolean;
|
||||||
supportSchemas?: boolean;
|
supportSchemas?: boolean;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user