This PR adds index CREATE and trigger CREATE scripts to the table CREATE script. In the process the following was also changed/updated:
- Trigger templates updated
- Tests for scripting on tables updated to include checks for index and trigger scripts
- Test for trigger updated to use `FUNCTION` instead of `PROCEDURE` because mock server is version 13. The version 13 template uses `FUNCTION` instead
- Index create scripts include `IF NOT EXISTS`
- The metadata.schema value for Indexes and Triggers stores `f'{schema}.{table_or_view_name}'`
- Triggers are now scriptable
- The way Indexes are fetched during scripting is slightly different than before, but more similar to how Triggers are fetched. This is because they are both table_objects
- Indexes are now scriptable even under materialized views
* Fix converters and add tests
* Remove unnecessary var
* Change every converters into string converter
* Fix tests
* fi oid issue
* fix tests
* fix tests
* reconnect if broken
* update naming
* retry for broken connection during request
* change name of SCRIPTAS_REQUEST
* expand node broken connection
* reconnect during refresh if needed
* lint fix
* test fix init
* none checks for tests
* fix connection during errors
* return after script request exception
* use mock connection for server in test
* put back try catch block for node expansion
* validate error
* mock server
* mock server
* Revert "mock server"
This reverts commit 2cdeeea68f.
* Revert "put back try catch block for node expansion"
This reverts commit a87a34b52e.
* retry state
* add back exception in expand node base
* lint error
- Updated template files ensuring
- add PgAdmin License header
- change data.func_without_args to data.func_args
- macros are being pathed to properly
- Using `.server` instead of `._server` outside of NodeObject class
- Added conn to FunctionBase query_data methods
Addresses issues described in microsoft/azuredatastudio-postgresql#452 and microsoft/azuredatastudio-postgresql#453.
- Indexes should now show scripting options regardless of if they are unique or not
- Indexes will not show primary key, but this will show up in constraints. This is following the pattern of PgAdmin
- Constraints should properly show the associated constraints
1. Check constraints
2. Exclusion constraints
3. Index constraints (primary key and unique key)
4. Foreign key constraints
- Template files were updated for all constraint types
* Add severity to notice and join by new line
* add severity to mock notice
* remove extra notice
* add new line separator in test
* print statements
* Revert "print statements"
This reverts commit b3a4aa6c68.
* init
* notification handler
* include save point
* build and test issues
* fix status
* fix for setting back autocommit
* fix trans error check
* add transaction messaging
* fix open block
* fix text format
* test fix
* test
* update messages
* test message
* starts with begin
Fixes create script for functions such that:
- Syntax is correct for immediate execution
- Function body is included for all versions (< 14 and >= 14)
- Should work for procedures and functions
Some template files needed to be changed slightly to prevent using the full properties that are generated for functions in pgAdmin.
* Update build_pullrequest.yml
* Rename config.json.txt to config.json
* Update build_pullrequest.yml
to run ps1 script tests only for Windows.
* Update build_pullrequest.yml
* Update build_pullrequest.yml
* Resolve security alerts - update sqlparser version (#373)
* Update initialize_request.py
* bump up sqlparser
* Delete nose2-junit.xml
* Bump up sqlparse version (#375)
* Update initialize_request.py
* bump up sqlparser
* resolve dependencies - bumping up version
* Give specific sqlparse requirement to requirements.txt file (#377)
* Update initialize_request.py
* bump up sqlparser
* resolve dependencies - bumping up version
* give specific result to requirement sqlparse
* Testing test failures in pipelines (#378)
* Update initialize_request.py
* bump up sqlparser
* resolve dependencies - bumping up version
* give specific result to requirement sqlparse
* testing test failure in the pipeline
* test failure injection
* Inject failing test (#379)
* Update initialize_request.py
* bump up sqlparser
* resolve dependencies - bumping up version
* give specific result to requirement sqlparse
* testing test failure in the pipeline
* test failure injection
* inject failing test
* Revert back tests used for test failure injection (#380)
* Update initialize_request.py
* bump up sqlparser
* resolve dependencies - bumping up version
* give specific result to requirement sqlparse
* testing test failure in the pipeline
* test failure injection
* inject failing test
* Fix failing test_format_mysql_doc_range test
* Update scripts
* Remove unused test scripts
* Add mac test script
* Bump Up Python Version to 3.10 (#358)
* fix create as script bug
* Bump up python version and correct syntaxes
* nose to nose2
* Fix styles and unused imports
* Fix build config and libraries (#359)
* fix create as script bug
* Bump up python version and correct syntaxes
* nose to nose2
* Fix styles and unused imports
* fix build and library
* Fixing integration tests (#360)
* fix create as script bug
* Bump up python version and correct syntaxes
* nose to nose2
* Fix styles and unused imports
* fix build and library
* test fix
* Fixing integration test issue in pipeline (#362)
* fix create as script bug
* Bump up python version and correct syntaxes
* nose to nose2
* Fix styles and unused imports
* fix build and library
* test fix
* adding test lines
* Fixing integration test issue in pipeline (#363)
* fix create as script bug
* Bump up python version and correct syntaxes
* nose to nose2
* Fix styles and unused imports
* fix build and library
* test fix
* adding test lines
* one more line print
* resolving integration test issue (#364)
* fix create as script bug
* Bump up python version and correct syntaxes
* nose to nose2
* Fix styles and unused imports
* fix build and library
* test fix
* adding test lines
* one more line print
* add encoding
* resolving integration test issue (#365)
* fix create as script bug
* Bump up python version and correct syntaxes
* nose to nose2
* Fix styles and unused imports
* fix build and library
* test fix
* adding test lines
* one more line print
* add encoding
* add encoding
* change config setting and remove printing lines in integration tests (#366)
* Fix style issue (#367)
* change config setting and remove printing lines in integration tests
* fix style issue
* Make flake file to return error when fail (#368)
* change config setting and remove printing lines in integration tests
* fix style issue
* add flake8 to return error when failing
* Add support for different versions for backup/restore
- Now dump and restore is supported for PG 9.5, 9.6, 10, 11, 12
- Added pg_dump executables and associated dlls for all versions of PG
- Based on the version of the server, it finds the folder where to look for pg_dump/pg_restore exe and uses that to execute backup and restore
* Code changes for AAD
* Fix check for key present in dict
* Add unit test to make sure account token is passed as PostgreSQL password.
* Remove extra import added by mistake.
* Fix static analysis errors
* Changes for dpeloy
Adding deploy apis
* Remove tlc changes
* Fixing some build issues
* Rename execute_deploy_string_request to execute_deploy_request
* Fix for skipping intellisense for non pgsql language flavor
We are directly using the text document uri which is encoded, hence now using the decoded url which is by using file_url from script file.
Similar fix to mssql extension: https://github.com/microsoft/sqltoolsservice/pull/910
* Add tests for deploy request
* Revert "Fix for skipping intellisense for non pgsql language flavor"
This reverts commit 2aea459edd.