-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fake synonyms #73
Open
dkultasev
wants to merge
33
commits into
tSQLt-org:main
Choose a base branch
from
dkultasev:fake_synonyms
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,146
−41
Open
Fake synonyms #73
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
486d190
Add remote FakeTable for remote synonyms functionality
dkultasev 7001123
Add creation of tSQLt_RemoteSynonymsTestDatabase database and needed …
dkultasev 8bcb40e
Add bunch of remote FakeTable tests
dkultasev 7c4b997
Add UDDT support + finish all FakeTable tests for Remote synonyms
dkultasev 6b32fda
Add possibility to fake function with temp or derived tables
dkultasev bc92081
Add new files to the SSMS project
dkultasev 7c2f65f
Re-factor FakeTable SP
554a7d5
Addmissing configuration for remote database setup
48fc0b3
Merge remote-tracking branch 'upstream/master'
dkultasev 612eee4
Merge remote-tracking branch 'upstream/master' into extend_fakefuncti…
dkultasev 36d60a7
Remove wrongly removed new lines
dkultasev 78650b0
PR#53 Add new lines at the end of the files
dkultasev b2af972
PR#53 Add missing schema for the table
dkultasev 3c6628d
Remove test
dkultasev 83bb699
PR#53 Fix tests
dkultasev d0ebdd3
Change naming convention for the FakeFunction data output table name
dkultasev 03e79a1
Fix issue with the long function names
dkultasev 6d70b47
Add FakeFunction test for long name and output table schema
dkultasev 0f23275
Add test for data source table starting with SELECT
dkultasev b402d20
Using tSQLt.Private::CreateUniqueObjectName() to generate random obje…
dkultasev 1da509e
Remove `FunctionName` parameter
dkultasev 12ab3e7
Change build order as CLR is used
dkultasev 182126d
Fix fake functions test
dkultasev cbc4d7e
Add CLR function exception message test
dkultasev 2f2876b
Merge branch 'master' into fake_synonyms
dkultasev 815a42f
Merge remote-tracking branch 'upstream/master' into fake_synonyms
dkultasev 32be461
Merge branch 'master' into fake_synonyms
dkultasev 0a64130
Remove incorrectly added test
dkultasev ada3745
Add new lines at the end of the files
dkultasev 002548a
Merge remote-tracking branch 'origin/master' into fake_synonyms
dkultasev 9c2494c
Post merge fixes
dkultasev 000a3e4
Using common approach to create "remote" database with `temp_prepare_…
dkultasev b26c871
Revert incorrectly modified file
dkultasev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
---Build+ | ||
CREATE TABLE dbo.TestTable | ||
( | ||
c1 INT NULL , | ||
c2 BIGINT NULL , | ||
c3 VARCHAR(MAX) NULL | ||
); | ||
GO | ||
CREATE VIEW dbo.TestView | ||
AS | ||
SELECT * | ||
FROM dbo.TestTable;; | ||
GO | ||
CREATE PROCEDURE dbo.NotATable | ||
AS | ||
RETURN; | ||
GO | ||
CREATE SCHEMA TestSchema; | ||
GO | ||
CREATE TYPE TestSchema.UDT FROM NVARCHAR(20); | ||
GO | ||
CREATE TABLE TestSchema.tbl(i TestSchema.UDT) | ||
GO | ||
CREATE TYPE TestSchema.UDTi FROM INT; | ||
GO | ||
CREATE TABLE TestSchema.tbli(i TestSchema.UDTi) | ||
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
IF OBJECT_ID('tSQLt.Private_AlterSysObjectForRemote') IS NOT NULL | ||
DROP PROCEDURE tSQLt.Private_AlterSysObjectForRemote; | ||
GO | ||
---Build+ | ||
CREATE PROCEDURE tSQLt.Private_AlterSysObjectForRemote | ||
@Instance NVARCHAR(MAX) , | ||
@Database NVARCHAR(MAX) , | ||
@SysObject NVARCHAR(MAX) , | ||
@PrivateViewName NVARCHAR(MAX) | ||
AS | ||
BEGIN | ||
DECLARE @sql NVARCHAR(MAX); | ||
SET @sql = 'ALTER VIEW tSQLt.' + @PrivateViewName + ' AS | ||
SELECT ' + | ||
CASE WHEN @SysObject = 'types' THEN ' | ||
name , | ||
system_type_id , | ||
user_type_id , | ||
CASE WHEN is_user_defined = 1 THEN 1 | ||
ELSE schema_id | ||
END AS schema_id , | ||
principal_id , | ||
max_length , | ||
precision , | ||
scale , | ||
collation_name , | ||
is_nullable , | ||
is_user_defined , | ||
is_assembly_type , | ||
default_object_id , | ||
rule_object_id , | ||
is_table_type | ||
' ELSE '* ' END | ||
+ CASE WHEN CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(MAX)) LIKE '9.%' | ||
AND @SysObject = 'types' THEN ',0 is_table_type' | ||
ELSE '' | ||
END + ' FROM ' + COALESCE(QUOTENAME(@Instance) + '.', '') | ||
+ COALESCE(QUOTENAME(@Database) + '.', '') + 'sys.' + @SysObject | ||
+ ';'; | ||
|
||
|
||
|
||
|
||
EXEC (@sql); | ||
|
||
RETURN 0; | ||
END; | ||
---Build- | ||
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be NOT NULL?