DatabaseAnalyser.createQuery core moved to base class

This commit is contained in:
Jan Prochazka
2021-05-15 18:41:30 +02:00
parent 4a4c4b41c0
commit 2eb1c04fcf
18 changed files with 71 additions and 105 deletions

View File

@@ -15,6 +15,6 @@ INNER JOIN sys.schemas u ON u.schema_id=o.schema_id
INNER JOIN INFORMATION_SCHEMA.COLUMNS col ON col.TABLE_NAME = o.name AND col.TABLE_SCHEMA = u.name and col.COLUMN_NAME = c.name
left join sys.default_constraints d on c.default_object_id = d.object_id
left join sys.computed_columns m on m.object_id = c.object_id and m.column_id = c.column_id
where o.type = 'U' and o.object_id =[OBJECT_ID_CONDITION]
where o.type = 'U' and o.object_id =OBJECT_ID_CONDITION
order by c.column_id
`;

View File

@@ -36,5 +36,5 @@ LEFT JOIN sys.schemas IXS ON IXT.schema_id = IXS.schema_id
inner join sys.objects o on FK.TABLE_NAME = o.name
inner join sys.schemas s on o.schema_id = s.schema_id and FK.TABLE_SCHEMA = s.name
where o.object_id =[OBJECT_ID_CONDITION]
where o.object_id =OBJECT_ID_CONDITION
`;

View File

@@ -3,6 +3,6 @@ select s.name as pureName, u.name as schemaName, c.text AS codeText
from sys.objects s
inner join sys.syscomments c on s.object_id = c.id
inner join sys.schemas u on u.schema_id = s.schema_id
where (s.object_id =[OBJECT_ID_CONDITION])
where (s.object_id =OBJECT_ID_CONDITION)
order by u.name, s.name, c.colid
`;

View File

@@ -10,5 +10,5 @@ where
and o.schema_id = s.schema_id and t.Table_Schema = s.name
and c.Table_Name = t.Table_Name
and Constraint_Type = 'PRIMARY KEY'
and o.object_id =[OBJECT_ID_CONDITION]
and o.object_id =OBJECT_ID_CONDITION
`;

View File

@@ -2,5 +2,5 @@ module.exports = `
select o.name as pureName, s.name as schemaName, o.object_id as objectId, o.create_date as createDate, o.modify_date as modifyDate, o.type as sqlObjectType
from sys.objects o
inner join sys.schemas s on o.schema_id = s.schema_id
where o.type in ('P', 'IF', 'FN', 'TF') and o.object_id =[OBJECT_ID_CONDITION]
where o.type in ('P', 'IF', 'FN', 'TF') and o.object_id =OBJECT_ID_CONDITION
`;

View File

@@ -4,5 +4,5 @@ select
o.create_date as createDate, o.modify_date as modifyDate
from sys.tables o
inner join sys.schemas s on o.schema_id = s.schema_id
where o.object_id =[OBJECT_ID_CONDITION]
where o.object_id =OBJECT_ID_CONDITION
`;

View File

@@ -13,6 +13,6 @@ select
FROM sys.objects o
INNER JOIN sys.schemas u ON u.schema_id=o.schema_id
INNER JOIN INFORMATION_SCHEMA.COLUMNS col ON col.TABLE_NAME = o.name AND col.TABLE_SCHEMA = u.name
WHERE o.type in ('V') and o.object_id =[OBJECT_ID_CONDITION]
WHERE o.type in ('V') and o.object_id =OBJECT_ID_CONDITION
order by col.ORDINAL_POSITION
`;

View File

@@ -6,5 +6,5 @@ SELECT
o.create_date as createDate,
o.modify_date as modifyDate
FROM sys.objects o INNER JOIN sys.schemas u ON u.schema_id=o.schema_id
WHERE type in ('V') and o.object_id =[OBJECT_ID_CONDITION]
WHERE type in ('V') and o.object_id =OBJECT_ID_CONDITION
`;