From 20979f8698740f53ff44fcbba080415b3442c69b Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Mon, 21 Jun 2021 22:34:28 +0000 Subject: [PATCH 01/31] test auto-deploy action Former-commit-id: cd683c41c6dff71e090506488b1cd98df2c767a5 --- .github/workflows/deploy-draft.yml | 83 ++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/deploy-draft.yml diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml new file mode 100644 index 00000000000..91d5a7b4bec --- /dev/null +++ b/.github/workflows/deploy-draft.yml @@ -0,0 +1,83 @@ +name: Deploy branch draft on Netlify +on: + pull_request: + types: [labeled, opened, synchronize] + +jobs: + build-deploy: + if: | + (github.event.action == 'labeled' && github.event.label.name == 'deploy') || + (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'deploy')) + runs-on: ubuntu-latest + steps: + + - name: create a github deployment + uses: bobheadxi/deployments@v0.5.2 + id: deployment + with: + step: start + token: ${{ secrets.GITHUB_TOKEN }} + env: pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }} + ref: ${{ github.head_ref }} + + - uses: actions/checkout@v2 + with: + ref: content/mongo_data_adapter/5.2.9/upcoming_release + fetch-depth: 0 # fetch whole repo so git-restore-mtime can work + - name: Update submodules + run: git submodule update --init --remote + - name: Adjust file watchers limit + run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p + + - uses: actions/setup-node@v1 + with: + node-version: '14.x' + - name: Install yarn + run: sudo npm -g install yarn + - name: Yarn install + run: yarn install --immutable + env: + NODE_ENV: ${{ secrets.NODE_ENV }} + + - name: Checking Gatsby cache + id: gatsby-cache-build + uses: actions/cache@v2 + with: + path: | + public + .cache + key: ${{ runner.os }}-gatsby-build-develop-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-gatsby-build-develop- + + - name: Fix mtimes + run: yarn fix-mtimes --force + - name: Gatsby build + run: yarn build + env: + APP_ENV: staging + NODE_ENV: ${{ secrets.NODE_ENV }} + NODE_OPTIONS: --max-old-space-size=4096 + ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} + ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} + ALGOLIA_INDEX_NAME: edb-docs-staging + INDEX_ON_BUILD: false + + - name: Netlify deploy + run: | + sudo yarn global add netlify-cli + netlify deploy --dir=public --json | tee deploy_results.json + echo "NETLIFY_DRAFT_URL=`jq '.deploy_url' deploy_results.json`" >> $GITHUB_ENV + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_WIP2_SITE_ID }} + + - name: update the github deployment status + uses: bobheadxi/deployments@v0.5.2 + if: always() + with: + step: finish + token: ${{ secrets.GITHUB_TOKEN }} + status: ${{ job.status }} + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + env_url: ${{ env.NETLIFY_DRAFT_URL }} From e43ada7f10efa199c086d5c73752669480f4eda9 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Mon, 21 Jun 2021 22:36:30 +0000 Subject: [PATCH 02/31] use staging site Former-commit-id: 45797de0b665082a5a766286407378752f89aadc --- .github/workflows/deploy-draft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 91d5a7b4bec..1026c35e7a1 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -70,7 +70,7 @@ jobs: echo "NETLIFY_DRAFT_URL=`jq '.deploy_url' deploy_results.json`" >> $GITHUB_ENV env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_WIP2_SITE_ID }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} - name: update the github deployment status uses: bobheadxi/deployments@v0.5.2 From 24cac49ff55363d89fa453cfd89a5bcb758aae5b Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 22 Jun 2021 01:49:14 +0000 Subject: [PATCH 03/31] argh, quotes Former-commit-id: e11c7c6e9d2ef125edfef049ce6a5d5208534e60 --- .github/workflows/deploy-draft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 1026c35e7a1..4e5be273f43 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -67,7 +67,7 @@ jobs: run: | sudo yarn global add netlify-cli netlify deploy --dir=public --json | tee deploy_results.json - echo "NETLIFY_DRAFT_URL=`jq '.deploy_url' deploy_results.json`" >> $GITHUB_ENV + echo "NETLIFY_DRAFT_URL=`jq -r '.deploy_url' deploy_results.json`" >> $GITHUB_ENV env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} From 8f4332e4ce26ad37a10c01d33c80a5ad45ecac0a Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Fri, 2 Jul 2021 16:40:04 +0000 Subject: [PATCH 04/31] better name (ref: https://github.com/jgoux/preview-environments-per-pull-request-using-aws-cdk-and-github-actions) Former-commit-id: 4c514ab223bf333b6c3eb168578857f49c93b58a --- .github/workflows/deploy-draft.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 4e5be273f43..3cc27a91e2b 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -10,6 +10,11 @@ jobs: (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'deploy')) runs-on: ubuntu-latest steps: + - name: inject slug/short variables + uses: rlespinasse/github-slug-action@v3.x + + - name: set STAGE variable in environment for next steps + run: echo "STAGE=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV - name: create a github deployment uses: bobheadxi/deployments@v0.5.2 @@ -17,7 +22,7 @@ jobs: with: step: start token: ${{ secrets.GITHUB_TOKEN }} - env: pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }} + env: ${{ env.STAGE }} ref: ${{ github.head_ref }} - uses: actions/checkout@v2 From ca04204fb9660a60c552a2d4890fce28688f51c2 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Fri, 2 Jul 2021 16:47:56 +0000 Subject: [PATCH 05/31] kill submodules, use current branch Former-commit-id: 85c26298c30e29cc66e4a8fe980cd24e42556e79 --- .github/workflows/deploy-draft.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 3cc27a91e2b..2823de164d3 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -27,10 +27,8 @@ jobs: - uses: actions/checkout@v2 with: - ref: content/mongo_data_adapter/5.2.9/upcoming_release fetch-depth: 0 # fetch whole repo so git-restore-mtime can work - - name: Update submodules - run: git submodule update --init --remote + - name: Adjust file watchers limit run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p From 724a6c54fbaf2069202258278fb147f8af3842f1 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 6 Jul 2021 21:30:38 +0000 Subject: [PATCH 06/31] use current branch for edit links Former-commit-id: 2ad3ba1f938753917ffbff4d0ebc979ee64b1686 --- gatsby-node.js | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index a769df86bb0..a3c15eb30e0 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -28,6 +28,23 @@ const { const isBuild = process.env.NODE_ENV === 'production'; const isProduction = process.env.APP_ENV === 'production'; +const currentBranchName = (() => { + // if this build was triggered by a GH action in response to a PR, + // use the head ref (the branch that someone is requesting be merged) + let branch = process.env.GITHUB_HEAD_REF; + // if this process was otherwise triggered by a GH action, use the current branch name + if (!branch) branch = process.env.GITHUB_REF; + // non-GH Action build? Try actually running Git for the name... + if (!branch) { + try { + branch = execSync('git rev-parse --abbrev-ref HEAD').toString(); + } catch {} + } + if (!branch) branch = isProduction ? 'main' : 'develop'; + + return branch.replace(/^refs\/heads\//, '').replace(/^refs\/tags\//, ''); +})(); + exports.onCreateNode = async ({ node, getNode, actions, loadNodeContent }) => { const { createNodeField } = actions; @@ -238,12 +255,11 @@ const createDoc = (navTree, prevNext, doc, productVersions, actions) => { const isIndexPage = isPathAnIndexPage(doc.fileAbsolutePath); const docsRepoUrl = 'https://github.com/EnterpriseDB/docs'; - const branch = isProduction ? 'main' : 'develop'; const fileUrlSegment = removeTrailingSlash(doc.fields.path) + (isIndexPage ? '/index.mdx' : '.mdx'); - const githubFileLink = `${docsRepoUrl}/commits/${branch}/product_docs/docs${fileUrlSegment}`; - const githubEditLink = `${docsRepoUrl}/edit/${branch}/product_docs/docs${fileUrlSegment}`; + const githubFileLink = `${docsRepoUrl}/commits/${currentBranchName}/product_docs/docs${fileUrlSegment}`; + const githubEditLink = `${docsRepoUrl}/edit/${currentBranchName}/product_docs/docs${fileUrlSegment}`; const githubIssuesLink = `${docsRepoUrl}/issues/new?title=Feedback%20on%20${encodeURIComponent( fileUrlSegment, )}`; @@ -297,13 +313,12 @@ const createAdvocacy = (navTree, prevNext, doc, learn, actions) => { ); const advocacyDocsRepoUrl = 'https://github.com/EnterpriseDB/docs'; - const branch = isProduction ? 'main' : 'develop'; const isIndexPage = isPathAnIndexPage(doc.fileAbsolutePath); const fileUrlSegment = removeTrailingSlash(doc.fields.path) + (isIndexPage ? '/index.mdx' : '.mdx'); - const githubFileLink = `${advocacyDocsRepoUrl}/commits/${branch}/advocacy_docs${fileUrlSegment}`; - const githubEditLink = `${advocacyDocsRepoUrl}/edit/${branch}/advocacy_docs${fileUrlSegment}`; + const githubFileLink = `${advocacyDocsRepoUrl}/commits/${currentBranchName}/advocacy_docs${fileUrlSegment}`; + const githubEditLink = `${advocacyDocsRepoUrl}/edit/${currentBranchName}/advocacy_docs${fileUrlSegment}`; const githubIssuesLink = `${advocacyDocsRepoUrl}/issues/new?title=Regarding%20${encodeURIComponent( fileUrlSegment, )}`; From ebdc792933ef3c29dad81170b17822fcaaf4df70 Mon Sep 17 00:00:00 2001 From: Abhilasha Narendra Date: Mon, 19 Jul 2021 21:16:07 +0530 Subject: [PATCH 07/31] Doc update for upcoming .NET connector release Former-commit-id: 083dea0049b085651c750ea8de7066e9e253d7f4 --- .../net_connector/5.0.7.1/01_whats_new.mdx | 14 + .../5.0.7.1/02_requirements_overview.mdx | 30 ++ ...advanced_server_net_connector_overview.mdx | 39 ++ ...ling_and_configuring_the_net_connector.mdx | 494 ++++++++++++++++++ .../5.0.7.1/05_using_the_net_connector.mdx | 27 + .../06_opening_a_database_connection.mdx | 288 ++++++++++ .../07_retrieving_database_records.mdx | 133 +++++ .../5.0.7.1/08_parameterized_queries.mdx | 66 +++ .../09_inserting_records_in_a_database.mdx | 71 +++ .../10_deleting_records_in_a_database.mdx | 72 +++ ...red_procedures_in_your_net_application.mdx | 420 +++++++++++++++ .../5.0.7.1/12_using_advanced_queueing.mdx | 492 +++++++++++++++++ ...sing_a_ref_cursor_in_a_net_application.mdx | 110 ++++ .../5.0.7.1/14_using_plugins.mdx | 256 +++++++++ .../5.0.7.1/15_using_object_types.mdx | 190 +++++++ .../5.0.7.1/16_scram_compatibility.mdx | 13 + ..._advanced_server_net_connector_logging.mdx | 107 ++++ .../5.0.7.1/18_api_reference.mdx | 16 + .../images/connection_opened_successfully.png | 3 + .../net_connector/5.0.7.1/images/dialog.png | 3 + .../images/dotnet_installation_complete.png | 3 + .../images/dotnet_installation_dialog.png | 3 + .../images/dotnet_installation_wizard.png | 3 + .../5.0.7.1/images/ready_to_install.png | 3 + .../selecting_the_connectors_installer.png | 3 + .../images/starting_stackbuilder_plus.png | 3 + .../docs/net_connector/5.0.7.1/index.mdx | 27 + 27 files changed, 2889 insertions(+) create mode 100644 product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/05_using_the_net_connector.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/06_opening_a_database_connection.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/07_retrieving_database_records.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/08_parameterized_queries.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/09_inserting_records_in_a_database.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/10_deleting_records_in_a_database.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/11_using_spl_stored_procedures_in_your_net_application.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/13_using_a_ref_cursor_in_a_net_application.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/15_using_object_types.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/16_scram_compatibility.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/17_advanced_server_net_connector_logging.mdx create mode 100644 product_docs/docs/net_connector/5.0.7.1/18_api_reference.mdx create mode 100755 product_docs/docs/net_connector/5.0.7.1/images/connection_opened_successfully.png create mode 100755 product_docs/docs/net_connector/5.0.7.1/images/dialog.png create mode 100755 product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_complete.png create mode 100755 product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_dialog.png create mode 100755 product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_wizard.png create mode 100755 product_docs/docs/net_connector/5.0.7.1/images/ready_to_install.png create mode 100755 product_docs/docs/net_connector/5.0.7.1/images/selecting_the_connectors_installer.png create mode 100755 product_docs/docs/net_connector/5.0.7.1/images/starting_stackbuilder_plus.png create mode 100644 product_docs/docs/net_connector/5.0.7.1/index.mdx diff --git a/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx b/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx new file mode 100644 index 00000000000..c91a4991538 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx @@ -0,0 +1,14 @@ +--- +title: "What’s New" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/whats_new.html" +--- + + + +The following features are added to create EDB .NET Connector `4.1.6.1`: + +- Merged with the upstream Npgsql driver version 4.1.6. For more information about the merge updates, visit . +- Support for .NET Framework 4.7.2 and .NET Framework 4.8. diff --git a/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx new file mode 100644 index 00000000000..1fd4a83f3e1 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx @@ -0,0 +1,30 @@ +--- +title: "Requirements Overview" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/requirements_overview.html" +--- + + + +The following section details the supported platforms for the EDB .NET Connector. + +## Supported Server Versions and Platforms + +The EDB .NET Connector is certified with Advanced Server version 9.5 and above. + +The EDB .NET Connector graphical installers are supported on the following Windows platforms: + +64-bit Windows: + +- Windows Server 2019 +- Windows Server 2016 +- Windows Server 2012 R2 +- Windows 10 +- Windows 8.1 + +32-bit Windows: + +- Windows 10 +- Windows 8.1 diff --git a/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx new file mode 100644 index 00000000000..d3e262afdcf --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx @@ -0,0 +1,39 @@ +--- +title: "The EDB .NET Connector - Overview" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/the_advanced_server_net_connector_overview.html" +--- + + + +The EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to Advanced Server features. + +The .NET Connector supports following frameworks: + +- `.NET Framework versions 4.6.1, 4.7.2 and 4.8` +- `.NET Standard 2.0 and 2.1` +- `.NET Core 3.0` +- `Entity Framework 6` +- `EDB VSIX` + +## The .NET Class Hierarchy + +The .NET Class Hierarchy contains a number of classes that you can use to create objects that control a connection to the Advanced Server database and manipulate the data stored on the server. The following are just a few of the most commonly used object classes: + +`EDBConnection` + + The `EDBConnection` class represents a connection to Advanced Server. An `EDBConnection` object contains a `ConnectionString` that instructs the .NET client how to connect to an Advanced Server database. + +`EDBCommand` + + An `EDBCommand` object contains an SQL command that the client will execute against Advanced Server. Before you can execute an `EDBCommand` object, you must link it to an `EDBConnection` object. + +`EDBDataReader` + + An `EDBDataReader` object provides a way to read an Advanced Server result set. You can use an `EDBDataReader` object to step through one row at a time, forward-only. + +`EDBDataAdapter` + + An `EDBDataAdapter` object links a result set to the Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an Advanced Server database. diff --git a/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx new file mode 100644 index 00000000000..d2a120dd81e --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx @@ -0,0 +1,494 @@ +--- +title: "Installing and Configuring the .NET Connector" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/installing_and_configuring_the_net_connector.html" +--- + + + +This chapter describes how to install and configure the EDB .NET Connector. + +## Installing the .NET Connector + +You can use the EDB .NET Connector Installer (available [from the EDB website](https://www.enterprisedb.com/software-downloads-postgres)) to add the .NET Connector to your system. After downloading the installer, right-click on the installer icon, and select `Run As Administrator` from the context menu. When prompted, select an installation language and click `OK` to continue to the `Setup` window. + +![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) + +The .NET Connector Installation wizard + +Click `Next` to continue. + +![The Installation dialog](images/dotnet_installation_dialog.png) + +The Installation dialog + +Use the `Installation Directory` dialog to specify the directory in which the connector will be installed, and click `Next` to continue. + +![The Ready to Install dialog](images/ready_to_install.png) + +The Ready to Install dialog + +Click `Next` on the `Ready to Install` dialog to start the installation; popup dialogs confirm the progress of the installation wizard. + +![The installation is complete](images/dotnet_installation_complete.png) + +The installation is complete + +When the wizard informs you that it has completed the setup, click the `Finish` button to exit the dialog. + +You can also use StackBuilder Plus to add or update the connector on an existing Advanced Server installation; to open StackBuilder Plus, select `StackBuilder Plus` from the Windows `Apps` menu. + +![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) + +Starting StackBuilder Plus + +When StackBuilder Plus opens, follow the onscreen instructions. + +Select the `EnterpriseDB.Net Connector` option from the `Database Drivers` node of the tree control. + +![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) + +Selecting the Connectors installer + +Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. + +## Configuring the .NET Connector + +Please see the following environment-specific sections for information about configuring the .NET Connector: + +- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. +- **.NET Framework 4.6.1** Instructions for configuring for use with [.NET Framework 4.6.1](#framework_setup_4_6_1). +- **.NET Framework 4.7.2** Instructions for configuring for use with [.NET Framework 4.7.2](#framework_setup_4_7_2). +- **.NET Framework 4.8** Instructions for configuring for use with [.NET Framework 4.8](#framework_setup_4_8). +- **.NET Standard 2.0.** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). +- **.NET Standard 2.1.** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). +- **.NET Core 3.0** Instructions for configuring for use with [.NET Core 3.0](#framework_setup_core3_0). +- **Entity Framework 6.** Instructions for configuring for use with [Entity Framework](#entity_setup_5_6). +- **EDB VSIX.** Instructions for configuring for use with [EDB VSIX](#vsix_setup). + +### Referencing the Library Files + + + +To reference library files with Microsoft Visual Studio: + +1. Select the project in the `Solution Explorer`. +2. Select `Add Reference` from the `Project` menu. +3. When the `Add Reference` dialog box opens, browse to select the appropriate library files. + +Optionally, the library files can be copied to the specified location. + +Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available within the namespace. The namespace is: + + `EnterpriseDB.EDBClient` + +If you are using Entity Framework 6, the following additional namespace is required: + + `EntityFramework6.EntepriseDB.EDBClient` + +The method you use to include the namespace varies by the type of application you are writing. For example, the following command imports a namespace into an `ASP.NET` page: + + `<% import namespace="EnterpriseDB.EDBClient" %>` + +To import a namespace into a C# application, write: + + `using EnterpriseDB.EDBClient;` + +### .NET Framework Setup + +The following sections describe the setup for various .NET versions. + + + +#### .NET Framework 4.6.1 + +If you are using .NET Framework version 4.6.1, the data provider installation path is: + + `C:\Program Files\edb\dotnet\net461\` + +You must add the following dependencies to your project: + + `EnterpriseDB.EDBClient.dll` + + `Microsoft.Bcl.AsyncInterfaces.dll` + + `System.Memory.dll` + + `System.Numerics.Vectors.dll` + + `System.Runtime.CompilerServices.Unsafe.dll` + + `System.Runtime.dll` + + `System.Text.Json.dll` + + `System.Threading.Tasks.Extensions.dll` + + `System.ValueTuple.dll` + +Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. + + + +#### .NET Framework 4.7.2 + +If you are using .NET Framework version 4.7.2, the data provider installation path is: + + `C:\Program Files\edb\dotnet\net472\` + + You must add the following dependencies to your project: + + `EnterpriseDB.EDBClient.dll` + + `Microsoft.Bcl.AsyncInterfaces.dll` + + `System.Memory.dll` + + `System.Numerics.Vectors.dll` + + `System.Runtime.CompilerServices.Unsafe.dll` + + `System.Text.Json.dll` + + `System.Threading.Tasks.Extensions.dll` + +Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. + + + +#### .NET Framework 4.8 + +If you are using .NET Framework version 4.8, the data provider installation path is: + + `C:\Program Files\edb\dotnet\net48\` + + You must add the following dependencies to your project: + + `EnterpriseDB.EDBClient.dll` + + `Microsoft.Bcl.AsyncInterfaces.dll` + + `System.Memory.dll` + + `System.Numerics.Vectors.dll` + + `System.Runtime.CompilerServices.Unsafe.dll` + + `System.Text.Json.dll` + + `System.Threading.Tasks.Extensions.dll` + +Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. + + + +#### .NET Standard 2.0 + +For .NET Standard Framework 2.0, the data provider installation path is: + + `C:\Program Files\edb\dotnet\netstandard2.0\` + +You must add the following dependencies to your project: + + `EnterpriseDB.EDBClient.dll` + + `System.Threading.Tasks.Extensions.dll` + + `System.Runtime.CompilerServices.Unsafe.dll` + + `System.ValueTuple.dll` + +!!! Note + If your target framework is .Net Core 2.0, then include the following file in your project: + +`System.Threading.Tasks.Extensions.dll` + +Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. + + + +#### .NET Standard 2.1 + +For .NET Standard Framework 2.1, the data provider installation path is: + + `C:\Program Files\edb\dotnet\netstandard2.1\` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.dll` + + `System.Memory.dll` + + `System.Runtime.CompilerServices.Unsafe.dll` + + `System.Text.Json.dll` + + `System.Threading.Tasks.Extensions.dll` + + `System.ValueTuple.dll` + +Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. + + + +#### .NET Core 3.0 + +If you are using .NET Core 3.0, the data provider installation path is: + + `C:\Program Files\edb\dotnet\netcoreapp3.0\` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.dll` + + `System.Threading.Tasks.Extensions.dll` + + `System.Runtime.CompilerServices.Unsafe.dll` + + `System.ValueTuple.dll` + + `System.Memory.dll` + +Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. + + + +### Entity Framework 6 + +To configure the .NET Connector for use with Entity Framework, the data provider installation path is: + +**For net461** + + `C:\Program Files\edb\dotnet\EF\net461` + +The following shared library file is required: + + `EntityFramework6.EnterpriseDB.EDBClient.dll` + +**For net472** + + `C:\Program Files\edb\dotnet\EF\net472` + +The following shared library file is required: + + `EntityFramework6.EnterpriseDB.EDBClient.dll` + +**For net48** + + `C:\Program Files\edb\dotnet\EF\net48` + +The following shared library file is required: + + `EntityFramework6.EnterpriseDB.EDBClient.dll` + +!!! Note + Entity Framework can be used with the `EnterpriseDB.EDBClient.dll` library available in the `net461`, `net472` and `net48` subdirectories. + +See [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. + +Add the `` entries for the `ADO.NET` driver for Postgres to the `app.config` file. Add the following entries: + +```text + +``` + +In the project’s `app.config` file add the following entry for provider services under the EntityFramework/providers tag: + +```text + + +``` + +The following is an example of the `app.config` file: + +```text + + + +
+ + + + + + + + + + + + + + + + + + + + +``` + +!!! Note + The same entries for `` and `` are valid for the `web.config` file and the `app.config` file. + +Depending upon the type of application you are using, you may be required to import the namespace into the source code (see [Referencing the Library Files](#referencing_the_library_files)). + +For usage information about Entity Framework, refer to the Microsoft documentation. + + + +### EDB VSIX for Visual Studio 2015/2017/2019 + +The EDB Data Designer Extensibility Provider (EDB VSIX) is a component that integrates Advanced Server database access into Visual Studio, thus providing Visual Studio integrated features. + +EDB VSIX allows you to connect to Advanced Server from within Visual Studio's Server Explorer and create a model from an existing database. Therefore, if Visual Studio features are desired, then EDB VSIX must be utilized. + +EDB VSIX files are located in the following directory: + + `C:\Program Files\edb\dotnet\vsix` + +The files available at the above location are: + + `edb_logo.ico` + `EnterpriseDB.vsix` + `SSDLToPgSQL.tt` + `System.ValueTuple.dll` + +#### Installation and Configuration for Visual Studio 2015/2017/2019 + +Use the following steps to install and configure EDB VSIX. + +**Step 1:** Install EDB VSIX to the desired version of Visual Studio with the `EnterpriseDB.vsix` installer. + +If you already have an earlier version of the VSIX installed, we highly recommended that you uninstall it to avoid conflicts. + +It is no longer necessary or recommended to have `EnterpriseDB.EDBClient` in your global assembly cache (GAC). + +**Step 2:** Relaunch Visual Studio and verify from the `Tools > Extensions and Updates…` menu that the EDB extension is installed. + +**Step 3:** Use the `gacutil` utility at the Visual Studio Developers Command Line to add following libraries to the global assembly cache (GAC): + +`System.ValueTuple.dll` +`System.Threading.Tasks.Extensions.dll` +`System.Runtime.CompilerServices.Unsafe.dll` +`System.Memory.dll` +`Microsoft.Bcl.AsyncInterfaces.dll` +`System.Text.Json.dll` + +For example: + + `> gacutil.exe /i System.ValueTuple.dll` + +**Step 4:** From the Server Explorer, right-click on `Data Connections`, click `Add Connection`, and verify that the `Enterprisedb Postgres Database` data source is available. + +#### Model First and Database First Usage + +**Step 1:** Add the `` entries for the ADO.NET driver to the `machine.config` file. Include the following entries: + +```text + +``` + +For the attribute-value pairs, the double-quoted strings should not contain excess white space characters, but be configured on a single line. The examples shown in this section may be split on multiple lines for clarity, but should actually be configured within a single line such as the following: + +`description=".NET Data Provider for EnterpriseDB PostgreSQL"` + +For 64-bit Windows, the `machine.config` file is in the following location: + +`C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config` + +For 32-bit Windows, the `machine.config` file is in the following location: + +`C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config` + +**Step 2:** Place the DDL generation template `SSDLToPgSQL.tt` in the Visual Studio `EntityFramework Tools\DBGen\` folder as shown in the following example: + +```text +C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\EntityFramework Tools\DBGen\ +``` + +!!! Note + Select this template `SSDLToPgSQL.tt` in your EDMX file properties. + +**Step 3:** Add the `EnterpriseDB.EDBClient.dll` and `EntityFramework6.EnterpriseDB.EDBClient.dll` files to project references. see [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. + +**Step 4:** Configure your Entity Framework application in either of following two ways: + +- Code-based +- Config-based. + +**Code-based** + +Define a class that inherits from `DbConfiguration` in the same assembly as your class inheriting `DbContext`. Ensure that you configure `provider services`, a `provider factory`, and a `default connection factory` as shown below: + +```text +using EnterpriseDB.EDBClient; +using System.Data.Entity; + +class EDBConfiguration : DbConfiguration +{ + public EDBConfiguration() + { + + var name = "EnterpriseDB.EDBClient"; + + SetProviderFactory(providerInvariantName: name, + providerFactory: EnterpriseDB.EDBClient.EDBFactory.Instance); + + SetProviderServices(providerInvariantName: name, + provider: EnterpriseDB.EDBClient.EDBServices.Instance); + + SetDefaultConnectionFactory(connectionFactory: new EnterpriseDB.EDBClient.EDBConnectionFactory()); + } +} +``` + +**Config-based** + +In the project’s `app.config` file, add the following entry for provider services under the EntityFramework/providers tag: + +```text + + +``` + +The following is an example of the `app.config` file. + +```text + + + +
+ + + + + + + + + + + + + + + + + + + + +``` diff --git a/product_docs/docs/net_connector/5.0.7.1/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/5.0.7.1/05_using_the_net_connector.mdx new file mode 100644 index 00000000000..d5ffd64eb51 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/05_using_the_net_connector.mdx @@ -0,0 +1,27 @@ +--- +title: "Using the .NET Connector" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_the_net_connector.html" +--- + + + +The sections that follow provide examples that demonstrate using the EDB object classes that are provided by the EDB .NET Connector that allow a .NET application to connect to and interact with an Advanced Server database. + +To use the examples in this guide, place the .NET library files in the same directory as the compiled form of your application. All of the examples are written in C# and each is embedded in an ASP.NET page; the same logic and code would be applicable with other .NET applications (WinForm or console applications, for example). + +Please create and save the following `web.config` file in the same directory as the sample code. The examples make use of the `DB_CONN_STRING` key from this configuration file to return a connection string from the Advanced Server host. + +```text + + + + + + +``` + +An Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you are writing an application that does not use ASP.NET, provide the connection information in an application configuration file (such as `app.config`). diff --git a/product_docs/docs/net_connector/5.0.7.1/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/5.0.7.1/06_opening_a_database_connection.mdx new file mode 100644 index 00000000000..2e5d071911c --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/06_opening_a_database_connection.mdx @@ -0,0 +1,288 @@ +--- +title: "Opening a Database Connection" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/opening_a_database_connection.html" +--- + + + +An `EDBConnection` object is responsible for handling the communication between an instance of Advanced Server and a .NET application. Before you can access data stored in an Advanced Server database, you must create and open an `EDBConnection`. + +The examples that follow demonstrate the basic steps for connecting to an instance of Advanced Server. You must: + +1. Import the namespace `EnterpriseDB.EDBClient`. +2. Create an instance of `EDBConnection`. +3. Initialize the `EDBConnection` object by passing a connection string as a parameter to the constructor for the `EDBConnection` class. +4. Call the `Open` method of the `EDBConnection` object to open the connection. + + + +## Connection String Parameters + +A valid connection string should specify location and authentication information for an Advanced Server instance. You must provide the connection string before opening the connection. A connection string must contain: + +- The name or IP address of the server +- The name of the Advanced Server database +- The name of an Advanced Server user +- The password associated with that user + +The following parameters may be included in the connection string: + +`CommandTimeout` + + `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish execution before throwing an exception. The default value is `20`. + +`ConnectionLifeTime` + + Use `ConnectionLifeTime` to specify the length of time (in seconds) to wait before closing unused connections in the pool. The default value is `15`. + +`Database` + + Use the `Database` parameter to specify the name of the database to which the application should connect. If a database name is not specified, the database name will default to the name of the connecting user. + +`Encoding` + + The `Encoding` parameter is obsolete; the parameter always returns the string unicode, and silently ignores attempts to set it. + +`Integrated Security` + + By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. Specify a value of `true` to use Windows Integrated Security. + +`Load Role Based Tables` + + Use `Load Role Based Tables` to load table OIDs based on role. This change only impacts the loading of table type OID, and not the composite type. The default value is `false`. Setting this parameter to `true` triggers the new functionality. + +`MaxPoolSize` + + `MaxPoolSize` instructs `EDBConnection` to dispose of pooled connections when the pool exceeds the specified number of connections. The default value is `20`. + +`MinPoolSize` + + `MinPoolSize` instructs `EDBConnection` to pre-allocate the specified number of connections with the server. The default value is `1`. + +`Password` + + When using clear text authentication, specify the password that will be used to establish a connection with the server. + +`Pooling` + + By default, `Pooling` is set to `true` to enable connection pooling. Specify a value of `false` to disable connection pooling. + +`Port` + + The `Port` parameter specifies the port to which the application should connect. + +`Protocol` + + The specific protocol version to use (instead of automatic); specify an integer value of 2 or 3. + +`SearchPath` + + Use the `SearchPath` parameter to change the search path to named and public schemas. + +`Server` + + The name or IP address of the Advanced Server host. + +`SSL` + + By default, `SSL` is set to `false`; specify a value of `true` to attempt a secure connection. + +`sslmode` + + Use `sslmode` to specify an SSL connection control preference. `sslmode` can be: + + `prefer` - Use SSL if possible. + + `require` - Throw an exception if an SSL connection cannot be established. + + `allow` - Connect without SSL. This parameter is not supported. + + `disable` - Do not attempt an SSL connection. This is the default behavior. + +`SyncNotification` + + Use the `SyncNotification` parameter to specify that `EDBDataprovider` should use synchronous notifications. The default value is `false`. + +`Timeout` + + `Timeout` specifies the length of time (in seconds) to wait for an open connection. The default value is `15`. + +`User Id` + + The `User Id` parameter specifies the user name that should be used for the connection. + +## Example - Opening a Database Connection using ASP.NET + +The following example demonstrates how to open a connection to an instance of Advanced Server and then close the connection. The connection is established using the credentials specified in the `DB_CONN_STRING` configuration parameter (see [Using the .Net Connector](05_using_the_net_connector/#using_the_net_connector) for an introduction to connection information and also see [Connection String Parameters](#connection-string-parameters) for connection parameters). + +```Text +<% @ Page Language="C#" %> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Configuration" %> + + +``` + +If the connection is successful, a browser will display the following: + +![Connection Opened Successfully](images/connection_opened_successfully.png) + +Connection Opened Successfully + +## Example - Opening a Database Connection from a Console Application + +The following example opens a connection with an Advanced Server database using a console-based application. + +Before writing the code for the console application, create an `app.config` file that stores the connection string to the database. Using a configuration file makes it convenient to update the connection string if the information changes. + +```Text + + + + + + +``` + +Using your text editor of choice, enter the following code sample into a file: + +```Text +using System; +using System.Data; +using EnterpriseDB.EDBClient; +using System.Configuration; + +namespace EnterpriseDB +{ + + class EDB + { + + static void Main(string[] args) + { + string strConnectionString = ConfigurationManager.AppSettings + ["DB_CONN_STRING"]; + + EDBConnection conn = new EDBConnection(strConnectionString); + + try + { + conn.Open(); + Console.WriteLine("Connection Opened Successfully"); + } + + catch(Exception exp) + { + throw new Exception(exp.ToString()); + } + + finally + { + conn.Close(); + } + } + } +} +``` + +Save the file as `EDBConnection-Sample.cs` and compile it with the following command: + +`csc /r:EnterpriseDB.EDBClient.dll /out:Console.exe EDBConnection-Sample.cs` + +Compiling the sample should generate a `Console.exe` file; you can execute the sample code by entering `Console.exe`. When executed, the console should verify that the: + + `Connection Opened Successfully` + +## Example - Opening a Database Connection from a Windows Form Application + +The following example demonstrates opening a database connection using a .NET WinForm application. To use the example, save the following code as `WinForm-Example.cs` in a directory that contains the library files. + +```Text +using System; +using System.Windows.Forms; +using System.Drawing; +using EnterpriseDB.EDBClient; + +namespace EDBTestClient +{ + + class Win_Conn + { + static void Main(string[] args) + { + Form frmMain = new Form(); + Button btnConn = new Button(); + btnConn.Location = new System.Drawing.Point(104, 64); + btnConn.Name = "btnConn"; + btnConn.Text = "Open Connection"; + btnConn.Click += new System.EventHandler(btnConn_Click); + + frmMain.Controls.Add(btnConn); + frmMain.Text = "EnterpriseDB"; + + Application.Run(frmMain); + } + + private static void btnConn_Click(object sender, System.EventArgs e) + { + EDBConnection conn = null; + try + { + string connectionString = "Server=10.90.1.29;port=5444; + username=edb;password=edb;database=edb"; + conn = new EDBConnection(connectionString); + conn.Open(); + MessageBox.Show("Connection Open"); + } + catch(EDBException exp) + { + MessageBox.Show(exp.ToString()); + } + finally + { + conn.Close(); + } + } + } +} +``` + +Note that you must change the database connection string to point to the database that you want to connect to before compiling the file with the following command: + +`csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs` + +This command should generate a `WinForm.exe` file within the same folder that the executable was compiled under. Invoking the executable will display: + +![A successful connection](images/dialog.png) + +A successful connection diff --git a/product_docs/docs/net_connector/5.0.7.1/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/5.0.7.1/07_retrieving_database_records.mdx new file mode 100644 index 00000000000..0992ff98a46 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/07_retrieving_database_records.mdx @@ -0,0 +1,133 @@ +--- +title: "Retrieving Database Records" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/retrieving_database_records.html" +--- + + + +You can use a `SELECT` statement to retrieve records from the database via a `SELECT` command. To execute a `SELECT` statement you must: + +- Create and open a database connection. +- Create an `EDBCommand` object that represents the `SELECT` statement. +- Execute the command with the `ExecuteReader()` method of the `EDBCommand` object returning a `EDBDataReader` +- Loop through the `EDBDataReader` displaying the results or binding the `EDBDataReader` to some control. + +An `EDBDataReader` object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the `Read()` method of the `EDBDataReader` object. + +The example that follows: + +1. Imports the Advanced Server namespace: `EnterpriseDB.EDBClient` +2. Initializes an `EDBCommand` object with a `SELECT` statement. +3. Opens a connection to the database. +4. Executes the `EDBCommand` by calling the `ExecuteReader` method of the `EDBCommand` object. + +The results of the SQL statement are retrieved into an `EDBDataReader` object. + +Loops through the contents of the `EDBDataReader` object to display the records returned by the query within a `WHILE` loop. + +The `Read()` method advances to the next record (if a record exists) and returns `true` if a record exists, or `false` to indicate that the `EDBDataReader` has reached the end of the result set. + +```Text +<% @ Page Language="C#" %> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + + +``` + +To exercise the sample code, save the code in your default web root directory in a file named: + + `selectEmployees.aspx` + +To invoke the program, open a web-browser, and browse to: + + `http://localhost/selectEmployees.aspx` + +## Retrieving a Single Database Record + +To retrieve a single result from a query, use the `ExecuteScalar()` method of the `EDBCommand` object. The `ExecuteScalar()` method returns the first value of the first column of the first row of the `DataSet` generated by the specified query. + +```text +<% @ Page Language="C#" %> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + + +``` + +Save the sample code in a file in a web root directory named: + + `selectscalar.aspx` + +To invoke the sample code, open a web-browser, and browse to: + + `http://localhost/selectScalar.aspx` + +Please note that the sample includes an explicit conversion of the value returned by the `ExecuteScalar()` method. The `ExecuteScalar()` method returns an object; to view the object, you must convert it into an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/5.0.7.1/08_parameterized_queries.mdx b/product_docs/docs/net_connector/5.0.7.1/08_parameterized_queries.mdx new file mode 100644 index 00000000000..2bad28634c2 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/08_parameterized_queries.mdx @@ -0,0 +1,66 @@ +--- +title: "Parameterized Queries" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/parameterized_queries.html" +--- + + + +A `parameterized query` is a query with one or more parameter markers embedded in the SQL statement. Before executing a parameterized query, you must supply a value for each marker found in the text of the SQL statement. + +Parameterized queries are useful when you don't know the complete text of a query at the time you write your code. For example, the value referenced in a `WHERE` clause may be calculated from user input. + +As demonstrated in the following example, you must declare the data type of each parameter specified in the parameterized query by creating an `EDBParameter` object and adding that object to the command's parameter collection. Then, you must specify a `value` for each parameter by calling the parameter's `Value()` function. + +The example demonstrates use of a parameterized query with an `UPDATE` statement that increases an employee salary: + +```text +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + + +``` + +Save the sample code in a file in a web root directory named: + + `updateSalary.aspx` + +To invoke the sample code, open a web-browser, and browse to: + + `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/5.0.7.1/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/5.0.7.1/09_inserting_records_in_a_database.mdx new file mode 100644 index 00000000000..31716cb6888 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/09_inserting_records_in_a_database.mdx @@ -0,0 +1,71 @@ +--- +title: "Inserting Records in a Database" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/inserting_records_in_a_database.html" +--- + + + +You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an Advanced Server host with an `INSERT` command. + +In the example that follows, the `INSERT` command is stored in the variable cmd. The values prefixed with a colon (`:`) are placeholders for `EDBParameters` that are instantiated, assigned values, and then added to the `INSERT` command's parameter collection in the statements that follow. The `INSERT` command is executed by the `ExecuteNonQuery()` method of the `cmdInsert` object. + +The example adds a new employee to the `emp` table: + +```Text +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + + +``` + +Save the sample code in a file in a web root directory named: + + `insertEmployee.aspx` + +To invoke the sample code, open a web-browser, and browse to: + + `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/5.0.7.1/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/5.0.7.1/10_deleting_records_in_a_database.mdx new file mode 100644 index 00000000000..dace9fabe76 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/10_deleting_records_in_a_database.mdx @@ -0,0 +1,72 @@ +--- +title: "Deleting Records in a Database" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/deleting_records_in_a_database.html" +--- + + + +You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an Advanced Server host with a `DELETE` statement. + +In the example that follows, the `DELETE` command is stored in the variable `strDeleteQuery`. The code passes the employee number to the Delete command (specified by: `EmpNo`). The command is then executed using the `ExecuteNonQuery()` method. The following example deletes the employee inserted in the previous example: + +```text +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + + +``` + +Save the sample code in a file in a web root directory named: + + `deleteEmployee.aspx` + +To invoke the sample code, open a web-browser, and browse to: + + `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/5.0.7.1/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/5.0.7.1/11_using_spl_stored_procedures_in_your_net_application.mdx new file mode 100644 index 00000000000..bebc9943860 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/11_using_spl_stored_procedures_in_your_net_application.mdx @@ -0,0 +1,420 @@ +--- +title: "Using SPL Stored Procedures in your .NET Application" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_spl_stored_procedures_in_your_net_application.html" +--- + + + +You can include SQL statements in an application in two ways: + +- By adding the SQL statements directly in the .NET application code. +- By packaging the SQL statements in a stored procedure, and executing the stored procedure from the .NET application. + +In some cases, a stored procedure can provide advantages over embedded SQL statements. Stored procedures support complex conditional and looping constructs that are difficult to duplicate with SQL statements embedded directly in an application. + +You can also see a significant improvement in performance by using stored procedures; a stored procedure only needs to be parsed, compiled and optimized once on the server side, while a SQL statement that is included in an application may be parsed, compiled and optimized each time it is executed from a .NET application. + +To use a stored procedure in your .NET application you must: + +1. Create an SPL stored procedure on the Advanced Server host. +2. Import the `EnterpriseDB.EDBClient` namespace. +3. Pass the name of the stored procedure to the instance of the `EDBCommand`. +4. Change the `EDBCommand.CommandType` to `CommandType.StoredProcedure`. +5. `Prepare()` the command. +6. Execute the command. + +## Example - Executing a Stored Procedure without Parameters + +Our sample procedure prints the name of department 10; the procedure takes no parameters, and returns no parameters. To create the sample procedure, invoke EDB-PSQL and connect to the Advanced Server host database. Enter the following SPL code at the command line: + +```Text +CREATE OR REPLACE PROCEDURE list_dept10 +IS + v_deptname VARCHAR2(30); +BEGIN + DBMS_OUTPUT.PUT_LINE('Dept No: 10'); + SELECT dname INTO v_deptname FROM dept WHERE deptno = 10; + DBMS_OUTPUT.PUT_LINE('Dept Name: ' || v_deptname); +END; +``` + +When Advanced Server has validated the stored procedure it will echo `CREATE PROCEDURE`. + +**Using the EDBCommand Object to Execute a Stored Procedure** + +The `CommandType` property of the `EDBCommand` object is used to indicate the type of command being executed. The `CommandType` property is set to one of three possible `CommandType` enumeration values: + +- Use the default `Text` value when passing a SQL string for execution. +- Use the `StoredProcedure` value, passing the name of a stored procedure for execution. +- Use the `TableDirect` value when passing a table name. This value passes back all records in the specified table. + +The `CommandText` property must contain a SQL string, stored procedure name, or table name depending on the value of the `CommandType` property. + +The following example executes the stored procedure: + +```Text +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + + +``` + +Save the sample code in a file in a web root directory named: + + `storedProc.aspx` + +To invoke the sample code, open a web-browser, and browse to: + + `http://localhost/storedProc.aspx` + +## Example - Executing a Stored Procedure with IN Parameters + +The following example demonstrates calling a stored procedure that includes `IN` parameters. To create the sample procedure, invoke `EDB-PSQL` and connect to the Advanced Server host database. Enter the following SPL code at the command line: + +```Text +CREATE OR REPLACE PROCEDURE + EMP_INSERT + ( + pENAME IN VARCHAR, + pJOB IN VARCHAR, + pSAL IN FLOAT4, + pCOMM IN FLOAT4, + pDEPTNO IN INTEGER, + pMgr IN INTEGER + ) +AS +DECLARE + CURSOR TESTCUR IS SELECT MAX(EMPNO) FROM EMP; + MAX_EMPNO INTEGER := 10; +BEGIN + + OPEN TESTCUR; + FETCH TESTCUR INTO MAX_EMPNO; + INSERT INTO EMP(EMPNO,ENAME,JOB,SAL,COMM,DEPTNO,MGR) + VALUES(MAX_EMPNO+1,pENAME,pJOB,pSAL,pCOMM,pDEPTNO,pMgr); + CLOSE testcur; +END; +``` + +When Advanced Server has validated the stored procedure it wEDBTypes.EDBDbType.Floatill echo `CREATE PROCEDURE`. + +**Passing Input Values to a Stored Procedure** + +Calling a stored procedure that contains parameters is very similar to executing a stored procedure without parameters. The major difference is that when calling a parameterized stored procedure you must use the `EDBParameter` collection of the `EDBCommand` object. When the `EDBParameter` is added to the `EDBCommand` collection, properties such as `ParameterName`, `DbType`, `Direction`, `Size`, and `Value` are set. + +The following example demonstrates the process of executing a parameterized stored procedure from a C#. + +```Text +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + + + + +``` + +Save the sample code in a file in a web root directory named: + + `storedProcInParam.aspx` + +To invoke the sample code, open a web-browser, and browse to: + + `http://localhost/storedProcInParam.aspx` + +In the example, the body of the `Page_Load` method declares and instantiates an `EDBConnection` object. The sample then creates an `EDBCommand` object with the properties needed to execute the stored procedure. + +The example then uses the `Add` method of the `EDBCommand Parameter` collection to add six input parameters. + +```text +EDBCommand cmdStoredProc = new EDBCommand +("emp_insert(:EmpName,:Job,:Salary,:Commission,:DeptNo,:Manager)",conn); +cmdStoredProc.CommandType = CommandType.StoredProcedure; +``` + +It assigns a value to each parameter before passing them to the `EMP_INSERT` stored procedure + +The `Prepare()` method prepares the statement before calling the `ExecuteNonQuery()` method. + +The `ExecuteNonQuery` method of the `EDBCommand` object executes the stored procedure. After the stored procedure has executed, a test record is inserted into the `emp` table and the values inserted are displayed on the webpage. + +## Example - Executing a Stored Procedure with IN, OUT, and INOUT Parameters + +The previous example demonstrated how to pass `IN` parameters to a stored procedure; the following examples demonstrate how to pass `IN` values and return `OUT` values from a stored procedure. + +**Creating the Stored Procedure** + +The following stored procedure passes the department number, and returns the corresponding location and department name. To create the sample procedure, open the EDB-PSQL command line, and connect to the Advanced Server host database. Enter the following SPL code at the command line: + +```Text +CREATE OR REPLACE PROCEDURE + DEPT_SELECT + ( + pDEPTNO IN INTEGER, + pDNAME OUT VARCHAR, + pLOC OUT VARCHAR + ) +AS +DECLARE + CURSOR TESTCUR IS SELECT DNAME,LOC FROM DEPT; + REC RECORD; +BEGIN + + OPEN TESTCUR; + FETCH TESTCUR INTO REC; + + pDNAME := REC.DNAME; + pLOC := REC.LOC; + + CLOSE testcur; +END; +``` + +When Advanced Server has validated the stored procedure it will echo `CREATE PROCEDURE`. + +**Receiving Output Values from a Stored Procedure** + +When retrieving values from `OUT` parameters you must explicitly specify the direction of out parameters as `Output`. You can retrieve the values from `Output` parameters in two ways: + +- Call the `ExecuteReader` method of the `EDBCommand` and explicitly loop through the returned `EDBDataReader`, searching for the values of `OUT` parameters. +- Call the `ExecuteNonQuery` method of `EDBCommand` and explicitly get the value of a declared `Output` parameter by calling that `EDBParameter` value property. + +In each method, you must declare each parameter, indicating the `direction` of the parameter (`ParameterDirection.Input`, `ParameterDirection.Output` or `ParameterDirection.InputOutput`). Before invoking the procedure, you must provide a value for each `IN` and `INOUT` parameter. After the procedure returns, you may retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. + +The following code listing demonstrates using the `ExecuteReader` method to retrieve a result set: + +```Text +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + + +``` + +The following code listing demonstrates using the `ExecuteNonQuery` method to retrieve a result set: + +```Text +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + + +``` diff --git a/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx new file mode 100644 index 00000000000..f6a807ae432 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx @@ -0,0 +1,492 @@ +--- +title: "Using Advanced Queueing" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_advanced_queueing.html" +--- + + + +EDB Postgres Advanced Server Advanced Queueing provides message queueing and message processing for the Advanced Server database. User-defined messages are stored in a queue; a collection of queues is stored in a queue table. You should first create a queue table before creating a queue that is dependent on it. + +On the server side, procedures in the `DBMS_AQADM` package create and manage message queues and queue tables. Use the `DBMS_AQ` package to add or remove messages from a queue, or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, click [here](https://www.enterprisedb.com/docs/en/11.0/EPAS_BIP_Guide_v11/Database_Compatibility_for_Oracle_Developers_Built-in_Package_Guide.1.14.html#pID0E01HG0HA). + +On the client side, application uses EDB.NET driver to enqueue/dequeue message. + +## Enqueueing or Dequeueing a Message + +For more information about using Advanced Servers Advanced Queueing functionality, see the [Database Compatibility for Oracle Developers Built-in Package Guide](/epas/latest/). + +### Server-Side Setup + +To use Advanced Queueing functionality on your .NET application, you must first create a user defined type, queue table, and queue, and then start the queue on the database server. Invoke EDB-PSQL and connect to the Advanced Server host database. Use the following SPL commands at the command line: + +**Creating a User-defined Type** + +To specify a RAW data type, you should create a user-defined type. The following example demonstrates creating a user-defined type named as `myxml`. + +`CREATE TYPE myxml AS (value XML)`; + +**Creating the Queue Table** + +A queue table can hold multiple queues with the same payload type. The following example demonstrates creating a table named `MSG_QUEUE_TABLE`. + +```Text +EXEC DBMS_AQADM.CREATE_QUEUE_TABLE + (queue_table => 'MSG_QUEUE_TABLE', + queue_payload_type => 'myxml', + comment => 'Message queue table'); +END; +``` + +**Creating the Queue** + +The following example demonstrates creating a queue named `MSG_QUEUE` within the table `MSG_QUEUE_TABLE`. + +```Text +BEGIN +DBMS_AQADM.CREATE_QUEUE ( queue_name => 'MSG_QUEUE', queue_table => 'MSG_QUEUE_TABLE', comment => 'This queue contains pending messages.'); +END; +``` + +**Starting the Queue** + +Once the queue is created, invoke the following SPL code at the command line to start a queue in the EDB database. + +```Text +BEGIN +DBMS_AQADM.START_QUEUE +(queue_name => 'MSG_QUEUE'); +END; +``` + +### Client-side Example + +Once you have created a user-defined type, followed by queue table and queue, start the queue. Then, you can enqueue or dequeue a message using EDB .Net drivers. + +**Enqueue a message:** + +To enqueue a message on your .NET application, you must: + +1. Import the `EnterpriseDB.EDBClient` namespace. +2. Pass the name of the queue and create the instance of the `EDBAQQueue`. +3. Create the enqueue message and define a payload. +4. Call the `queue.Enqueue` method. + +The following code listing demonstrates using the `queue.Enqueue` method: + +!!! Note + The following code creates the message and serializes it. This is just an example code and is not going to compile if copied as it is. It is the responsibility of the user to serialize the message as XML. + +```Text +using EnterpriseDB.EDBClient; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AQXml +{ + class MyXML + { + public string value { get; set; } + } + class Program + { + static void Main(string[] args) + { + int messagesToSend = 1; + if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) + { + messagesToSend = int.Parse(args[0]); + } + for (int i = 0; i < 5; i++) + { + EnqueMsg("test message: " + i); + } + } + + private static EDBConnection GetConnection() + { + string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; + EDBConnection connection = new EDBConnection(connectionString); + connection.Open(); + return connection; + } + + + private static string ByteArrayToString(byte[] byteArray) + { + // Sanity check if it's null so we don't incur overhead of an exception + if (byteArray == null) + { + return string.Empty; + } + try + { + StringBuilder hex = new StringBuilder(byteArray.Length * 2); + foreach (byte b in byteArray) + { + hex.AppendFormat("{0:x2}", b); + } + + return hex.ToString().ToUpper(); + } + catch + { + return string.Empty; + } + } + + private static bool EnqueMsg(string msg) + { + EDBConnection con = GetConnection(); + using (EDBAQQueue queue = new EDBAQQueue("MSG_QUEUE", con)) + { + queue.MessageType = EDBAQMessageType.Xml; + EDBTransaction txn = queue.Connection.BeginTransaction(); + QueuedEntities.Message queuedMessage = new QueuedEntities.Message() { MessageText = msg }; + + try + { + string rootElementName = queuedMessage.GetType().Name; + if (rootElementName.IndexOf(".") != -1) + { + rootElementName = rootElementName.Split('.').Last(); + } + + string xml = new Utils.XmlFragmentSerializer().Serialize(queuedMessage); + EDBAQMessage queMsg = new EDBAQMessage(); + queMsg.Payload = new MyXML { value = xml }; + queue.MessageType = EDBAQMessageType.Udt; + queue.UdtTypeName = "myxml"; + queue.Enqueue(queMsg); + var messageId = ByteArrayToString((byte[])queMsg.MessageId); + Console.WriteLine("MessageID: " + messageId); + txn.Commit(); + queMsg = null; + xml = null; + rootElementName = null; + return true; + } + catch (Exception ex) + { + txn?.Rollback(); + Console.WriteLine("Failed to enqueue message."); + Console.WriteLine(ex.ToString()); + return false; + } + finally + { + queue?.Connection?.Dispose(); + } + } + } + + } +} +``` + +**Dequeueing a message** + +To dequeue a message on your .NET application, you must: + +1. Import the `EnterpriseDB.EDBClient` namespace. +2. Pass the name of the queue and create the instance of the `EDBAQQueue`. +3. Call the `queue.Dequeue` method. + +!!! Note + The following code creates the message and serializes it. This is just an example code and is not going to compile if copied as it is. It is the responsibility of the user to serialize the message as XML. + +```Text +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using EnterpriseDB.EDBClient; + +namespace DequeueXML +{ + class MyXML + { + public string value { get; set; } + } + class Program + { + static void Main(string[] args) + { + DequeMsg(); + } + + + private static EDBConnection GetConnection() + { + string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; + EDBConnection connection = new EDBConnection(connectionString); + connection.Open(); + return connection; + } + + + private static string ByteArrayToString(byte[] byteArray) + { + // Sanity check if it's null so we don't incur overhead of an exception + if (byteArray == null) + { + return string.Empty; + } + try + { + StringBuilder hex = new StringBuilder(byteArray.Length * 2); + foreach (byte b in byteArray) + { + hex.AppendFormat("{0:x2}", b); + } + + return hex.ToString().ToUpper(); + } + catch + { + return string.Empty; + } + } + public static void DequeMsg(int waitTime = 10) + { + EDBConnection con = GetConnection(); + using (EDBAQQueue queueListen = new EDBAQQueue("MSG_QUEUE", con)) + { + queueListen.UdtTypeName = "myxml"; + queueListen.DequeueOptions.Navigation = EDBAQNavigationMode.FIRST_MESSAGE; + queueListen.DequeueOptions.Visibility = EDBAQVisibility.ON_COMMIT; + queueListen.DequeueOptions.Wait = 1; + EDBTransaction txn = null; + + while (1 == 1) + { + + if (queueListen.Connection.State == System.Data.ConnectionState.Closed) + { + queueListen.Connection.Open(); + } + + string messageId = "Unknown"; + try + { + // the listen function is a blocking function. It will Wait the specified waitTime or until a + // message is received. + Console.WriteLine("Listening..."); + string v = queueListen.Listen(null, waitTime); + // If we are waiting for a message and we specify a Wait time, + // then if there are no more messages, we want to just bounce out. + if (waitTime > -1 && v == null) + { + Console.WriteLine("No message received during Wait period."); + Console.WriteLine(); + continue; + } + + // once we're here that means a message has been detected in the queue. Let's deal with it. + txn = queueListen.Connection.BeginTransaction(); + + Console.WriteLine("Attempting to dequeue message..."); + // dequeue the message + EDBAQMessage deqMsg; + try + { + deqMsg = queueListen.Dequeue(); + } + catch (Exception ex) + { + if (ex.Message.Contains("ORA-25228")) + { + Console.WriteLine("Message was not there. Another process must have picked it up."); + Console.WriteLine(); + txn.Rollback(); + continue; + } + else + { + throw; + } + } + + messageId = ByteArrayToString((byte[])deqMsg.MessageId); + if (deqMsg != null) + { + Console.WriteLine("Processing received message..."); + // process the message payload + MyXML obj = new MyXML(); + queueListen.Map(deqMsg.Payload, obj); + + QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); + + Console.WriteLine("Received Message:"); + Console.WriteLine("MessageID: " + messageId); + Console.WriteLine("Message: " + msg.MessageText); + Console.WriteLine("Enqueue Time" + queueListen.MessageProperties.EnqueueTime); + + txn.Commit(); + + Console.WriteLine("Finished processing message"); + Console.WriteLine(); + + } + else + { + Console.WriteLine("Message was not dequeued."); + } + } + catch (Exception ex) + { + Console.WriteLine("Failed To dequeue or process the dequeued message."); + Console.WriteLine(ex.ToString()); + Console.WriteLine(); + if (txn != null) + { + txn.Rollback(); + if (txn != null) + { + txn.Dispose(); + } + } + } + } + } + + } + } +} +``` + +## EDBAQ Classes + +The following EDBAQ classes are used in this application: + +**EDBAQDequeueMode** + +The `EDBAQDequeueMode` class lists all the dequeuer modes available. + +| **Value** | **Description** | +| ------------- | ------------------------------------------------------------- | +| Browse | Read the message without locking. | +| Locked | Reads and gets a write lock on the message. | +| Remove | Deletes the message after reading. This is the default value. | +| Remove_NoData | Confirms receipt of the message. | + +**EDBAQDequeueOptions** + +The `EDBAQDequeueOptions` class lists the options available when dequeuing a message. + +| **Property** | **Description** | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| ConsumerName | The name of the consumer for which to dequeue the message. | +| DequeueMode | This is set from EDBAQDequeueMode. It represents the locking behavior linked with the dequeue option. | +| Navigation | This is set from EDBAQNavigationMode. It represents the position of the message that will be fetched. | +| Visibility | This is set from EDBAQVisibility. It represents whether the new message is dequeued or not as part of the current transaction. | +| Wait | The wait time for a message as per the search criteria. | +| Msgid | The message identifier. | +| Correlation | The correlation identifier. | +| DeqCondition | The dequeuer condition. It is a Boolean expression. | +| Transformation | The transformation that will be applied before dequeuing the message. | +| DeliveryMode | The delivery mode of the dequeued message. | + +**EDBAQEnqueueOptions** + +The `EDBAQEnqueueOptions` class lists the options available when enqueuing a message. + +| **Property** | **Description** | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| Visibility | This is set from EDBAQVisibility. It represents whether the new message is enqueued or not as part of the current transaction. | +| RelativeMsgid | The relative message identifier. | +| SequenceDeviation | The sequence when the message should be dequeued. | +| Transformation | The transformation that will be applied before enqueuing the message. | +| DeliveryMode | The delivery mode of the enqueued message. | + +**EDBAQMessage** + +The `EDBAQMessage` class lists a message to be enqueued/dequeued. + +| **Property** | **Description** | +| ------------ | -------------------------------- | +| Payload | The actual message to be queued. | +| MessageId | The ID of the queued message. | + +**EDBAQMessageProperties** + +The `EDBAQMessageProperties` lists the message properties available. + +| **Property** | **Description** | +| ---------------- | --------------------------------------------------------------------------------------------- | +| Priority | The priority of the message. | +| Delay | The duration post which the message is available for dequeuing. This is specified in seconds. | +| Expiration | The duration for which the message is available for dequeuing. This is specified in seconds. | +| Correlation | The correlation identifier. | +| Attempts | The number of attempts taken to dequeue the message. | +| RecipientList | The receipients list that overthrows the default queue subscribers. | +| ExceptionQueue | The name of the queue where the unprocessed messages should be moved. | +| EnqueueTime | The time when the message was enqueued. | +| State | The state of the message while dequeue. | +| OriginalMsgid | The message identifier in the last queue. | +| TransactionGroup | The transaction group for the dequeued messages. | +| DeliveryMode | The delivery mode of the dequeued message. | + +**EDBAQMessageState** + +The `EDBAQMessageState` class represents the state of the message during dequeue. + +| **Value** | **Description** | +| --------- | ---------------------------------------------------------- | +| Expired | The message is moved to the exception queue. | +| Processed | The message is processed and kept. | +| Ready | The message is ready to be processed. | +| Waiting | The message is in waiting state. The delay is not reached. | + +**EDBAQMessageType** + +The `EDBAQMessageType` class represents the types for payload. + +| **Value** | **Description** | +| --------- | ------------------------------------------------------------------------------------- | +| Raw | The raw message type.

Note: Currently, this payload type is not supported. | +| UDT | The user defined type message. | +| XML | The XML type message.

Note: Currently, this payload type is not supported. | + +**EDBAQNavigationMode** + +The `EDBAQNavigationMode` class represents the different types of navigation modes available. + +| **Value** | **Description** | +| ---------------- | ------------------------------------------------------------------ | +| First_Message | Returns the first available message that matches the search terms. | +| Next_Message | Returns the next available message that matches the search items. | +| Next_Transaction | Returns the first message of next transaction group. | + +**EDBAQQueue** + +The `EDBAQQueue` class represents a SQL statement to execute `DMBS_AQ` functionality on a PostgreSQL database. + +| **Property** | **Description** | +| ----------------- | --------------------------------------------------------------------------------------------- | +| Connection | The connection to be used. | +| Name | The name of the queue. | +| MessageType | The message type that is enqueued/dequeued from this queue. For example EDBAQMessageType.Udt. | +| UdtTypeName | The user defined type name of the message type. | +| EnqueueOptions | The enqueue options to be used. | +| DequeuOptions | The dequeue options to be used. | +| MessageProperties | The message properties to be used. | + +**EDBAQVisibility** + +The `EDBAQVisibility` class represents the visibility options available. + +| **Value** | **Description** | +| --------- | ----------------------------------------------------------- | +| Immediate | The enqueue/dequeue is not part of the ongoing transaction. | +| On_Commit | The enqueue/dequeue is part of the current transaction. | + +!!! Note + - To review the default options for the above parameters, click [here](https://www.enterprisedb.com/docs/en/11.0/EPAS_BIP_Guide_v11/Database_Compatibility_for_Oracle_Developers_Built-in_Package_Guide.1.14.html#pID0E01HG0HA/). + - EDB Advanced Queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` cannot be used with Advanced Queueing because `NoTypeLoading` will not load any user-defined types. diff --git a/product_docs/docs/net_connector/5.0.7.1/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/5.0.7.1/13_using_a_ref_cursor_in_a_net_application.mdx new file mode 100644 index 00000000000..2ae728c0061 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/13_using_a_ref_cursor_in_a_net_application.mdx @@ -0,0 +1,110 @@ +--- +title: "Using a Ref Cursor in a .NET Application" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_a_ref_cursor_in_a_net_application.html" +--- + + + +A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by the execution of the `OPEN FOR` statement using the cursor variable. A cursor variable is not tied to a particular query like a static cursor. The same cursor variable may be opened a number of times with the `OPEN FOR` statement containing different queries and each time, a new result set will be created for that query and made available via the cursor variable. There are two ways to declare a cursor variable: + +- Use the `SYS_REFCURSOR` built-in data type to declare a weakly-typed ref cursor. +- Define a strongly-typed ref cursor that declares a variable of that type. + +`SYS_REFCURSOR` is a ref cursor type that allows any result set to be associated with it. This is known as a weakly-typed ref cursor. The following example is a declaration of a weakly-typed ref cursor: + + `name SYS_REFCURSOR`; + +Following is an example of a strongly-typed ref cursor: + + `TYPE IS REF CURSOR RETURN emp%ROWTYPE`; + +**Creating the Stored Procedure** + +The following sample code creates a stored procedure called `refcur_inout_callee`. To create the sample procedure, invoke EDB-PSQL and connect to the Advanced Server host database. Enter the following SPL code at the command line: + +```Text +CREATE OR REPLACE PROCEDURE + refcur_inout_callee(v_refcur IN OUT SYS_REFCURSOR) +IS +BEGIN + OPEN v_refcur FOR SELECT ename FROM emp; +END; +``` + +To use the above defined procedure from .NET code, you must specify the data type of the ref cursor being passed as an `IN` parameter, as shown in the above script. + +The following C# code uses the stored procedure to retrieve employee names from the `emp` table: + +```Text +using System; +using System.Data; +using EnterpriseDB.EDBClient; +using System.Configuration; + +namespace EDBRefCursor +{ + class EmpRefcursor + { + [STAThread] + static void Main(string[] args) + { + string strConnectionString = + ConfigurationManager.AppSettings["DB_CONN_STRING"]; + EDBConnection conn = new EDBConnection(strConnectionString); + conn.Open(); + try + { + EDBTransaction tran = conn.BeginTransaction(); + EDBCommand command = new EDBCommand("refcur_inout_callee", + conn); + command.CommandType = CommandType.StoredProcedure; + command.Transaction = tran; + command.Parameters.Add(new EDBParameter("refCursor", + EDBTypes.EDBDbType.Refcursor, 10, "refCursor", + + ParameterDirection.InputOutput, false, 2, 2, + System.Data.DataRowVersion.Current, null)); + + command.Prepare(); + command.Parameters[0].Value = null; + + command.ExecuteNonQuery(); + String cursorName = command.Parameters[0].Value.ToString(); + command.CommandText = "fetch all in \"" + cursorName + "\""; + command.CommandType = CommandType.Text; + + EDBDataReader reader = + command.ExecuteReader(CommandBehavior.SequentialAccess); + int fc = reader.FieldCount; + while (reader.Read()) + { + for (int i = 0; i < fc; i++) + { + Console.WriteLine(reader.GetString(i)); + } + } + reader.Close(); + tran.Commit(); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message.ToString()); + } + } + } +} +``` + +The following .NET code snippet displays the result on the console: + +```Text +for(int i = 0;i < fc; i++) +{ + Console.WriteLine(reader.GetString(i)); +} +``` + +Please note that you must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you are using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx b/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx new file mode 100644 index 00000000000..ce51e374e1e --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx @@ -0,0 +1,256 @@ +--- +title: "Using Plugins" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_plugins.html" +--- + + + +EDB .Net driver plugins are introduced to support the enhanced capabilities for different data types, which are otherwise not available in .Net. The different plugins available support: + +- GeoJSON +- Json.NET +- Legacy PostGIS +- NetTopologySuite +- NodaTime +- Rawpostgis + +The plugins support the use of spatial, data/time and Json types. The following sections detail the supported frameworks and data provider installation path for these plugins. + +## GeoJSON + +If you are using the GeoJSON plugin on .NET Framework 4.6.1, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\GeoJSON\net461` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.GeoJSON.dll` + `GeoJSON.Net.dll` + `Newtonsoft.Json.dll` + +If you are using the GeoJSON plugin on .NET Framework 4.7.2, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\GeoJSON\net472` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.GeoJSON.dll` + `GeoJSON.Net.dll` + `Newtonsoft.Json.dll` + +If you are using the GeoJSON plugin on .NET Framework 4.8, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\GeoJSON\net48` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.GeoJSON.dll` + `GeoJSON.Net.dll` + `Newtonsoft.Json.dll` + +If you are using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` + +The following shared library files are required: + +`EnterpriseDB.EDBClient.GeoJSON.dll` + +For detailed information about using the GeoJSON plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/geojson.html). + +## Json.NET + +If you are using the Json.NET plugin on .NET Framework 4.6.1, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\Json.NET\net461` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.Json.NET.dll` + `Newtonsoft.Json.dll` + +If you are using the Json.NET plugin on .NET Framework 4.7.2, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\Json.NET\net472` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.Json.NET.dll` + `Newtonsoft.Json.dll` + +If you are using the Json.NET plugin on .NET Framework 4.8, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\Json.NET\net48` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.Json.NET.dll` + `Newtonsoft.Json.dll` + +If you are using the Json.NET plugin on .NET Standard 2.0, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` + +The following shared library files are required: + +`EnterpriseDB.EDBClient.Json.NET.dll` + +For detailed information about using the Json.NET plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/jsonnet.html). + +## LegacyPostGIS + +If you are using the LegacyPostGIS plugin on .Net Framework 4.6.1, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net461` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.LegacyPostgis.dll` + +If you are using the LegacyPostGIS plugin on .Net Framework 4.7.2, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net472` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.LegacyPostgis.dll` + +If you are using the LegacyPostGIS plugin on .Net Framework 4.8, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net48` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.LegacyPostgis.dll` + +If you are using the LegacyPostGIS plugin on .Net Standard 2.0, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\netstandard2.0` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.LegacyPostgis.dll` + +For detailed information about using the LegacyPostGIS plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/legacy-postgis.html). + +## NetTopologySuite + +If you are using the NetTopologySuite plugin on .Net Framework 4.6.1, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net461` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.NetTopologySuite.dll` + `NetTopologySuite.dll` + `NetTopologySuite.IO.PostGis.dll` + +If you are using the NetTopologySuite plugin on .Net Framework 4.7.2, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net472` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.NetTopologySuite.dll` + `GeoAPI.dll` + `NetTopologySuite.dll` + `NetTopologySuite.IO.PostGis.dll` + +If you are using the NetTopologySuite plugin on .Net Framework 4.8, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net48` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.NetTopologySuite.dll` + `GeoAPI.dll` + `NetTopologySuite.dll` + `NetTopologySuite.IO.PostGis.dll` + +If you are using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.NetTopologySuite.dll` + +For detailed information about using the NetTopologySuite type plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nts.html). + +## NodaTime + +If you are using the NodaTime plugin on .Net Framework 4.6.1, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\NodaTime\net461` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.NodaTime.dll` + `NodaTime.dll` + +If you are using the NodaTime plugin on .Net Framework 4.7.2, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\NodaTime\net472` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.NodaTime.dll` + `NodaTime.dll` + +If you are using the NodaTime plugin on .Net Framework 4.8, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\NodaTime\net48` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.NodaTime.dll` + `NodaTime.dll` + +If you are using the NodaTime plugin on .Net Standard 2.0, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.NodaTime.dll` + +For detailed information about using the NodaTime plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nodatime.html). + +## RawPostGIS + +If you are using the RawPostGIS plugin on .Net Framework 4.6.1, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\RawPostgis\net461` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.RawPostgis.dll` + +If you are using the RawPostGIS plugin on .Net Framework 4.7.2, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\RawPostgis\net472` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.RawPostgis.dll` + +If you are using the RawPostGIS plugin on .Net Framework 4.8, the data provider installation path is: + + `C:\Program Files\edb\dotnet\plugins\RawPostgis\net48` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.RawPostgis.dll` + +If you are using the RawPostGIS type plugin on .Net Standard 2.0, the data provider installation path is: + + `C:\Program\Files\edb\dotnet\plugins\RawPostGis\netstandard2.0` + +The following shared library files are required: + + `EnterpriseDB.EDBClient.RawPostgis.dll` + +For detailed information about using the RawPostGIS plugin, see the [documentation](https://www.nuget.org/packages/Npgsql.RawPostgis). diff --git a/product_docs/docs/net_connector/5.0.7.1/15_using_object_types.mdx b/product_docs/docs/net_connector/5.0.7.1/15_using_object_types.mdx new file mode 100644 index 00000000000..124df13ec48 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/15_using_object_types.mdx @@ -0,0 +1,190 @@ +--- +title: "Using Object Types in .NET" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_object_types.html" +--- + + + +The SQL `CREATE TYPE` command is used to create a user-defined `object type`, which is stored in the Advanced Server database. + +These user-defined types can then be referenced within SPL procedures, SPL functions, and .NET programs. + +The basic object type is created with the `CREATE TYPE AS OBJECT` command along with optional usage of the `CREATE TYPE BODY` command. + +An example that demonstrates using an object type is shown in the following section. + +## Using an Object Type + +To use an object type, you must first create the object type in the Advanced Server database. Object type `addr_object_type` defines the attributes of an address: + +```text +CREATE OR REPLACE TYPE addr_object_type AS OBJECT +( + street VARCHAR2(30), + city VARCHAR2(20), + state CHAR(2), + zip NUMBER(5) +); +``` + +Object type `emp_obj_typ` defines the attributes of an employee. Note that one of these attributes is object type `ADDR_OBJECT_TYPE` as previously described. The object type body contains a method that displays the employee information: + +```text +CREATE OR REPLACE TYPE emp_obj_typ AS OBJECT +( + empno NUMBER(4), + ename VARCHAR2(20), + addr ADDR_OBJECT_TYPE, + MEMBER PROCEDURE display_emp(SELF IN OUT emp_obj_typ) +); + +CREATE OR REPLACE TYPE BODY emp_obj_typ AS + MEMBER PROCEDURE display_emp (SELF IN OUT emp_obj_typ) + IS + BEGIN + DBMS_OUTPUT.PUT_LINE('Employee No : ' || SELF.empno); + DBMS_OUTPUT.PUT_LINE('Name : ' || SELF.ename); + DBMS_OUTPUT.PUT_LINE('Street : ' || SELF.addr.street); + DBMS_OUTPUT.PUT_LINE('City/State/Zip: ' || SELF.addr.city || ', ' || + SELF.addr.state || ' ' || LPAD(SELF.addr.zip,5,'0')); + END; +END; +``` + +The following listing is a complete .NET program that uses these user-defined object types: + +```text +namespace ObjectTypesSample +{ + class Program + { + static void Main(string[] args) + { + EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); + EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); + EDBConnection conn = new EDBConnection("Server=localhost;Port=5444;database=test;User ID=enterprisedb;password=;"); + + try + { + conn.Open(); + + EDBCommand cmd = new EDBCommand("emp_obj_typ.display_emp", conn); + + cmd.CommandType = System.Data.CommandType.StoredProcedure; + EDBCommandBuilder.DeriveParameters(cmd); + + addr_object_type address = new addr_object_type() + { + street = "123 MAIN STREET", + city = "EDISON", + state = "NJ", + zip = 8817 + }; + + emp_obj_typ emp = new emp_obj_typ() + { + empno = 9001, + ename = "JONES", + addr = address + }; + cmd.Parameters[0].Value = emp; + cmd.Prepare(); + cmd.ExecuteNonQuery(); + + emp_obj_typ empOut = (emp_obj_typ)cmd.Parameters[0].Value; + Console.WriteLine("Emp No: " + empOut.empno); + Console.WriteLine("Emp Name: " + empOut.ename); + Console.WriteLine("Emp Address Street: " + empOut.addr.street); + Console.WriteLine("Emp Address City: " + empOut.addr.city); + Console.WriteLine("Emp Address State: " + empOut.addr.state); + Console.WriteLine("Emp Address Zip: " + empOut.addr.zip); + Console.WriteLine("Emp No: " + empOut.empno); + } + catch (EDBException exp) + { + Console.WriteLine(exp.Message.ToString()); + } + finally + { + conn.Close(); + } + } + } + + public class addr_object_type + { + public string street; + public string city; + public string state; + public decimal zip; + } + + public class emp_obj_typ + { + public decimal empno; + public string ename; + public addr_object_type addr; + } +} +``` + +The following .NET types are defined to map to the types in Advanced Server: + +```text +public class addr_object_type +{ + public string street; + public string city; + public string state; + public decimal zip; +} + +public class emp_obj_typ +{ + public decimal empno; + public string ename; + public addr_object_type addr; +} +``` + +A call to `EDBConnection.GlobalTypeMapper.MapComposite` maps the .NET type to the Advanced Server types: + +```text +EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); + EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); +``` + +A call to `EDBCommandBuilder.DeriveParameters()` gets parameter information for a stored procedure. This allows you to just set the parameter values and call the stored procedure: + +```text +EDBCommandBuilder.DeriveParameters(cmd); +``` + +The value of the parameter is set by creating an object of the .NET type and assigning it to the `Value` property of the parameter: + +```text +addr_object_type address = new addr_object_type() +{ + street = "123 MAIN STREET", + city = "EDISON", + state = "NJ", + zip = 8817 +}; + +emp_obj_typ emp = new emp_obj_typ() +{ + empno = 9001, + ename = "JONES", + addr = address +}; +cmd.Parameters[0].Value = emp; +``` + +A call to `cmd.ExecuteNonQuery()` executes the call to the `display_emp()` method: + +```text +cmd.ExecuteNonQuery(); +``` diff --git a/product_docs/docs/net_connector/5.0.7.1/16_scram_compatibility.mdx b/product_docs/docs/net_connector/5.0.7.1/16_scram_compatibility.mdx new file mode 100644 index 00000000000..2d14e010cbb --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/16_scram_compatibility.mdx @@ -0,0 +1,13 @@ +--- +title: "Scram Compatibility" +legacyRedirects: + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/scram_compatibility.html" +--- + + + +The EDB .NET driver provides SCRAM-SHA-256 support for Advanced Server version 10 and above. This support is available from EDB .NET 4.0.2.1 release onwards. diff --git a/product_docs/docs/net_connector/5.0.7.1/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/5.0.7.1/17_advanced_server_net_connector_logging.mdx new file mode 100644 index 00000000000..ea7fe3ffb6f --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/17_advanced_server_net_connector_logging.mdx @@ -0,0 +1,107 @@ +--- +title: "EDB .NET Connector Logging" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/advanced_server_net_connector_logging.html" +--- + + + +EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. The connector uses classes in the `EnterpriseDB.EDBClient.Logging` namespace for logging. + +**Console Logging to Standard Error** + +`EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider` is a class that outputs error messages to `STDERR`. To use this class, include the following line in your application before using any of the Advanced Server .NET Connector APIs. + +`EnterpriseDB.EDBClient.Logging.EDBLogManager.Provider = new EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider(EDBLogLevel.Debug, true, true);` + +The following log levels are available: + +- Trace +- Debug +- Info +- Warn +- Error +- Fatal + +**Writing a Custom Logger** + +If the console logging provider does not fulfill your requirements, you can write a custom logger by implementing the `EnterpriseDB.EDBClient.Logging.IEDBLoggingProvider` interface, and extending the `EnterpriseDB.EDBClient.Logging.EDBLogger` class, for instance, writing your logs to a file. The following is a simple example of how to write a custom logger: + +```text +public class MyLoggingProvider : IEDBLoggingProvider + { + string _logFile; + readonly EDBLogLevel _minLevel; + readonly bool _printLevel; + readonly bool _printConnectorId; + + public MyLoggingProvider(string logFile, EDBLogLevel minLevel = EDBLogLevel.Info, bool printLevel = false, bool printConnectorId = false) + { + _logFile = logFile; + _minLevel = minLevel; + _printLevel = printLevel; + _printConnectorId = printConnectorId; + } + + public EDBLogger CreateLogger(string name) + { + return new MyLogger(_logFile, _minLevel, _printLevel, _printConnectorId); + } + } + + class MyLogger : EDBLogger + { + string _logFile; + readonly EDBLogLevel _minLevel; + readonly bool _printLevel; + readonly bool _printConnectorId; + + internal MyLogger(string logFile, EDBLogLevel minLevel, bool printLevel, bool printConnectorId) + { + _logFile = logFile; + _minLevel = minLevel; + _printLevel = printLevel; + _printConnectorId = printConnectorId; + } + + public override bool IsEnabled(EDBLogLevel level) => level >= _minLevel; + + public override void Log(EDBLogLevel level, int connectorId, string msg, Exception exception = null) + { + if (!IsEnabled(level)) + return; + + + using (StreamWriter writer = new StreamWriter(_logFile, true)) + { + var sb = new StringBuilder(); + if (_printLevel) + { + sb.Append(level.ToString().ToUpper()); + sb.Append(' '); + } + + if (_printConnectorId && connectorId != 0) + { + sb.Append("["); + sb.Append(connectorId); + sb.Append("] "); + } + + sb.AppendLine(msg); + + if (exception != null) + sb.AppendLine(exception.ToString()); + + writer.Write(sb.ToString()); + } + + } + } +``` + +To use this custom logger, put the following line in your application before using any of the EDB .NET Connector APIs: + +`EDBLogManager.Provider = new MyLoggingProvider(filepath, EDBLogLevel.Debug, true, true);` diff --git a/product_docs/docs/net_connector/5.0.7.1/18_api_reference.mdx b/product_docs/docs/net_connector/5.0.7.1/18_api_reference.mdx new file mode 100644 index 00000000000..2eb61b0f57b --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/18_api_reference.mdx @@ -0,0 +1,16 @@ +--- +title: "API Reference" + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/api_reference.html" +--- + + + +For information about using the API, see the [Npgsql documentation](http://www.npgsql.org/doc/api/Npgsql.html). + +Usage notes: + +- When using the API, replace references to `Npgsql` with `EnterpriseDB.EDBClient`. +- When referring to classes, replace `Npgsql` with `EDB`. For example, use the `EDBBinaryExporter` class instead of the `NpgsqlBinaryExporter` class. diff --git a/product_docs/docs/net_connector/5.0.7.1/images/connection_opened_successfully.png b/product_docs/docs/net_connector/5.0.7.1/images/connection_opened_successfully.png new file mode 100755 index 00000000000..bab12126d20 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/images/connection_opened_successfully.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:537e7edecce3882b794110e0ffc644a51cab69ba2c7e7f82a3e99d32c4b4ba65 +size 22683 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/dialog.png b/product_docs/docs/net_connector/5.0.7.1/images/dialog.png new file mode 100755 index 00000000000..19cba54d1f9 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/images/dialog.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f922e6cd4e43927708b5f460f5389a5b3a41dd70f3a5394723e6aee7d710f1ae +size 9048 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_complete.png new file mode 100755 index 00000000000..332ae795899 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_complete.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0983f216ce071f57f7e758980c3f966caded4312412905a6aba66efa362fdb13 +size 272137 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_dialog.png new file mode 100755 index 00000000000..b465d536032 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_dialog.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:994a725f061f1b51fd92ccc2df5abd9066a1cf4ea7600611ae57ebc6cc59af20 +size 51144 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_wizard.png new file mode 100755 index 00000000000..29c9a7f99f9 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_wizard.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efe8029105db01662005a349a7b59c87b6f7dce3017990a197e3b9b681392860 +size 227235 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/ready_to_install.png b/product_docs/docs/net_connector/5.0.7.1/images/ready_to_install.png new file mode 100755 index 00000000000..59e44d96bc5 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/images/ready_to_install.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91b18bef7b78a6dae7d6b664e2bccfbfdb4248dbd034cb59e2c6a35ada7da49c +size 44080 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/5.0.7.1/images/selecting_the_connectors_installer.png new file mode 100755 index 00000000000..432e4473c09 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/images/selecting_the_connectors_installer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d939c7e6604025f82be47969d69e6acc63ab5a48a0af4341e42efe0156b42778 +size 97808 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/5.0.7.1/images/starting_stackbuilder_plus.png new file mode 100755 index 00000000000..11665300652 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/images/starting_stackbuilder_plus.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce6bcefb865ca14239fb7e0e2ac5149ed56251cfbc5153869070d039f70857c6 +size 91989 diff --git a/product_docs/docs/net_connector/5.0.7.1/index.mdx b/product_docs/docs/net_connector/5.0.7.1/index.mdx new file mode 100644 index 00000000000..ca3ce75ab37 --- /dev/null +++ b/product_docs/docs/net_connector/5.0.7.1/index.mdx @@ -0,0 +1,27 @@ +--- +title: "EDB .NET Connector" +directoryDefaults: + description: "EDB .NET Connector Version 4.1.6.1 Documentation and release notes." + +legacyRedirectsGenerated: + # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/index.html" + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/conclusion.html" + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/genindex.html" + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/whats_new.html" + - "/edb-docs/p/edb-postgres-net-connector/4.1.6.1" +--- + +The EDB .NET Connector distributed with EDB Postgres Advanced Server (Advanced Server) provides connectivity between a .NET client application and an Advanced Server database server. This guide provides installation instructions, usage instructions, and examples that demonstrate the functionality of the EDB .NET Connector: + +- How to connect to an instance of Advanced Server. +- How to retrieve information from an Advanced Server database. +- How to update information stored on an Advanced Server database. + +This document assumes that you have a solid working knowledge of both C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. The *Npgsql User's Manual* is available [online](http://www.npgsql.org/doc/index.html). + +
+ +whats_new requirements_overview the_advanced_server_net_connector_overview installing_and_configuring_the_net_connector using_the_net_connector opening_a_database_connection retrieving_database_records parameterized_queries inserting_records_in_a_database deleting_records_in_a_database using_spl_stored_procedures_in_your_net_application using_advanced_queueing using_a_ref_cursor_in_a_net_application using_plugins using_object_types scram_compatibility advanced_server_net_connector_logging api_reference conclusion + +
From ed09a15f79f3b4e502de3bc1bdad154042e3dc94 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 20 Jul 2021 04:24:03 +0000 Subject: [PATCH 08/31] poke to trigger build Former-commit-id: e14e51b9c7cf3d9c245db1260e0c6ef44e01b563 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7fd12e848e4..b4bb0eb470b 100644 --- a/README.md +++ b/README.md @@ -236,3 +236,4 @@ Option 2: on GitHub 1. Edit a file on GitHub. 2. Submit changes as a PR on a new branch. + From 03cc6ebacf0b7254b83006d76cfcebd8cce64cd2 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 20 Jul 2021 05:22:28 +0000 Subject: [PATCH 09/31] suggestions from @frago12 Former-commit-id: ba9d7e0688c529dc04f8c4131c1f8b30a1256afc --- .github/workflows/deploy-draft.yml | 28 +++++++++++++++------------- package.json | 3 ++- yarn.lock | 5 +++++ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 2823de164d3..68346892522 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -13,8 +13,8 @@ jobs: - name: inject slug/short variables uses: rlespinasse/github-slug-action@v3.x - - name: set STAGE variable in environment for next steps - run: echo "STAGE=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV + - name: compose a name for the build environment + run: echo "BUILD_ENV_NAME=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV - name: create a github deployment uses: bobheadxi/deployments@v0.5.2 @@ -22,7 +22,7 @@ jobs: with: step: start token: ${{ secrets.GITHUB_TOKEN }} - env: ${{ env.STAGE }} + env: ${{ env.BUILD_ENV_NAME }} ref: ${{ github.head_ref }} - uses: actions/checkout@v2 @@ -35,10 +35,8 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '14.x' - - name: Install yarn - run: sudo npm -g install yarn - name: Yarn install - run: yarn install --immutable + run: npx yarn install --immutable env: NODE_ENV: ${{ secrets.NODE_ENV }} @@ -66,14 +64,18 @@ jobs: ALGOLIA_INDEX_NAME: edb-docs-staging INDEX_ON_BUILD: false - - name: Netlify deploy - run: | - sudo yarn global add netlify-cli - netlify deploy --dir=public --json | tee deploy_results.json - echo "NETLIFY_DRAFT_URL=`jq -r '.deploy_url' deploy_results.json`" >> $GITHUB_ENV + - name: Deploy to Netlify + id: netlify-deploy + uses: nwtgck/actions-netlify@v1.2.2 + with: + publish-dir: './public' + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: "Deploy from GitHub Actions" + alias: ${{ github.head_ref }} + github-deployment-environment: ${{ env.BUILD_ENV_NAME }} env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} - name: update the github deployment status uses: bobheadxi/deployments@v0.5.2 @@ -83,4 +85,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} status: ${{ job.status }} deployment_id: ${{ steps.deployment.outputs.deployment_id }} - env_url: ${{ env.NETLIFY_DRAFT_URL }} + env_url: ${{ steps.netlify-deploy.outputs.deploy-url }} diff --git a/package.json b/package.json index 8e8472a2d54..396e7cf98a0 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,8 @@ "remark-stringify": "^8.1.1", "semver-compare": "^1.0.0", "to-vfile": "^6.1.0", - "typescript": "^4.1.3" + "typescript": "^4.1.3", + "yarn": "^1.22.10" }, "repository": { "type": "git", diff --git a/yarn.lock b/yarn.lock index 940459fbad0..c396bcb28f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15290,6 +15290,11 @@ yargs@^16.1.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yarn@^1.22.10: + version "1.22.10" + resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.10.tgz#c99daa06257c80f8fa2c3f1490724e394c26b18c" + integrity sha512-IanQGI9RRPAN87VGTF7zs2uxkSyQSrSPsju0COgbsKQOOXr5LtcVPeyXWgwVa0ywG3d8dg6kSYKGBuYK021qeA== + yauzl@^2.4.2: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" From cdbbe92b80960ba4c71b460d94da8251fea3c516 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 20 Jul 2021 05:50:37 +0000 Subject: [PATCH 10/31] clean up refs Former-commit-id: 47c9fba65fd4c4fa484772d21e31d368f239c974 --- .github/workflows/deploy-draft.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 68346892522..90cbdbc51b6 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -23,10 +23,11 @@ jobs: step: start token: ${{ secrets.GITHUB_TOKEN }} env: ${{ env.BUILD_ENV_NAME }} - ref: ${{ github.head_ref }} + ref: ${{ github.event.pull_request.head.ref }} - uses: actions/checkout@v2 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 # fetch whole repo so git-restore-mtime can work - name: Adjust file watchers limit @@ -35,6 +36,7 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '14.x' + - name: Yarn install run: npx yarn install --immutable env: From 40b6afe94527f198bafc5b3bcda6ecce60c7fd61 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 20 Jul 2021 19:43:32 +0000 Subject: [PATCH 11/31] slimmer Former-commit-id: 4927ed5661c716e1dc86f479ccc13d694d5d229a --- .github/workflows/deploy-draft.yml | 39 +++++++++++++----------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 90cbdbc51b6..69200aa8bd3 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -16,15 +16,6 @@ jobs: - name: compose a name for the build environment run: echo "BUILD_ENV_NAME=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV - - name: create a github deployment - uses: bobheadxi/deployments@v0.5.2 - id: deployment - with: - step: start - token: ${{ secrets.GITHUB_TOKEN }} - env: ${{ env.BUILD_ENV_NAME }} - ref: ${{ github.event.pull_request.head.ref }} - - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} @@ -36,6 +27,19 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '14.x' + + # ref: https://github.com/actions/cache/blob/main/examples.md#node---yarn + - name: Get yarn cache directory + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Checking Yarn cache + uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Yarn install run: npx yarn install --immutable @@ -49,12 +53,11 @@ jobs: path: | public .cache - key: ${{ runner.os }}-gatsby-build-develop-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-gatsby-build-develop- + key: ${{ runner.os }}-gatsby-build-draft-${{ github.head_ref }} - name: Fix mtimes run: yarn fix-mtimes --force + - name: Gatsby build run: yarn build env: @@ -72,19 +75,11 @@ jobs: with: publish-dir: './public' github-token: ${{ secrets.GITHUB_TOKEN }} - deploy-message: "Deploy from GitHub Actions" + deploy-message: ${{ github.event.pull_request.title }} + enable-commit-comment: false alias: ${{ github.head_ref }} github-deployment-environment: ${{ env.BUILD_ENV_NAME }} env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} - - name: update the github deployment status - uses: bobheadxi/deployments@v0.5.2 - if: always() - with: - step: finish - token: ${{ secrets.GITHUB_TOKEN }} - status: ${{ job.status }} - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - env_url: ${{ steps.netlify-deploy.outputs.deploy-url }} From 1cc567e1d2546f42e8803e29da8a7696fbb7a565 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 20 Jul 2021 21:06:07 +0000 Subject: [PATCH 12/31] indicate that deployment is starting sooner. Ditch alias Former-commit-id: 3718aee3bfe170cec80ec2abf0059dab4c2ab1ba --- .github/workflows/deploy-draft.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 69200aa8bd3..659f5d04095 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -2,7 +2,11 @@ name: Deploy branch draft on Netlify on: pull_request: types: [labeled, opened, synchronize] - + +concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + jobs: build-deploy: if: | @@ -16,6 +20,18 @@ jobs: - name: compose a name for the build environment run: echo "BUILD_ENV_NAME=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV + # creates a deployment so that a status is immediately visible on the PR + # this deployment will be completed by the netlify deploy step below + - name: create a github deployment + uses: bobheadxi/deployments@v0.6.0 + id: deployment + with: + step: start + token: ${{ secrets.GITHUB_TOKEN }} + env: ${{ env.BUILD_ENV_NAME }} + ref: ${{ github.head_ref }} + logs: https://github.com/${{ github.repository }}/pull/${{ github.event.number }} + - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} @@ -77,7 +93,6 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} deploy-message: ${{ github.event.pull_request.title }} enable-commit-comment: false - alias: ${{ github.head_ref }} github-deployment-environment: ${{ env.BUILD_ENV_NAME }} env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} From 017243dec7cdc69215a928e24e79edd015804c06 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 20 Jul 2021 21:09:28 +0000 Subject: [PATCH 13/31] link to run for logs Former-commit-id: daf054de75d65d78ec513a4cd2fb2da53585add2 --- .github/workflows/deploy-draft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 659f5d04095..346bc7d8464 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -30,7 +30,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} env: ${{ env.BUILD_ENV_NAME }} ref: ${{ github.head_ref }} - logs: https://github.com/${{ github.repository }}/pull/${{ github.event.number }} + logs: https://github.com/${{ github.repository }}/pull/${{ github.event.number }}/checks?check_run_id=${{ github.run_id }} - uses: actions/checkout@v2 with: From 5b35958e01a90d2eb493d0b01aa46c5e7378c3cf Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 20 Jul 2021 22:01:50 +0000 Subject: [PATCH 14/31] iterate on getting deployment status right Former-commit-id: c2fb6451a9aa3d5b2469419f22e1ca7b2f4e2a4f --- .github/workflows/deploy-draft.yml | 45 +++++++++++++++++++----------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 346bc7d8464..633a5f36a87 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -23,15 +23,23 @@ jobs: # creates a deployment so that a status is immediately visible on the PR # this deployment will be completed by the netlify deploy step below - name: create a github deployment - uses: bobheadxi/deployments@v0.6.0 id: deployment + uses: avakar/create-deployment@v1 with: - step: start - token: ${{ secrets.GITHUB_TOKEN }} - env: ${{ env.BUILD_ENV_NAME }} ref: ${{ github.head_ref }} - logs: https://github.com/${{ github.repository }}/pull/${{ github.event.number }}/checks?check_run_id=${{ github.run_id }} - + environment: ${{ env.BUILD_ENV_NAME }} + transient_environment: true + auto_merge: false + env: + GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }} + + - uses: avakar/set-deployment-status@v1 + with: + state: in_progress + deployment_id: ${{ steps.deployment.output.deployment_id }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} @@ -85,16 +93,21 @@ jobs: ALGOLIA_INDEX_NAME: edb-docs-staging INDEX_ON_BUILD: false - - name: Deploy to Netlify - id: netlify-deploy - uses: nwtgck/actions-netlify@v1.2.2 - with: - publish-dir: './public' - github-token: ${{ secrets.GITHUB_TOKEN }} - deploy-message: ${{ github.event.pull_request.title }} - enable-commit-comment: false - github-deployment-environment: ${{ env.BUILD_ENV_NAME }} + - name: Netlify deploy + run: | + sudo yarn global add netlify-cli + netlify deploy --dir=public --json | tee deploy_results.json + echo "NETLIFY_DRAFT_URL=`jq -r '.deploy_url' deploy_results.json`" >> $GITHUB_ENV env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} + - name: update the github deployment status + uses: bobheadxi/deployments@v0.5.2 + if: always() + with: + step: finish + token: ${{ secrets.GITHUB_TOKEN }} + status: ${{ job.status }} + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + env_url: ${{ steps.netlify-deploy.outputs.deploy-url }} \ No newline at end of file From 62791d204fddd1eec6fcf848c1f571d37b3497ee Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Tue, 20 Jul 2021 22:06:10 +0000 Subject: [PATCH 15/31] give up on full deployment coverage for now Former-commit-id: bb60bacb12e628ef3059e898ffa43613302ac69d --- .github/workflows/deploy-draft.yml | 47 +++++++----------------------- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml index 633a5f36a87..48f8e1880f7 100644 --- a/.github/workflows/deploy-draft.yml +++ b/.github/workflows/deploy-draft.yml @@ -19,27 +19,7 @@ jobs: - name: compose a name for the build environment run: echo "BUILD_ENV_NAME=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV - - # creates a deployment so that a status is immediately visible on the PR - # this deployment will be completed by the netlify deploy step below - - name: create a github deployment - id: deployment - uses: avakar/create-deployment@v1 - with: - ref: ${{ github.head_ref }} - environment: ${{ env.BUILD_ENV_NAME }} - transient_environment: true - auto_merge: false - env: - GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }} - - - uses: avakar/set-deployment-status@v1 - with: - state: in_progress - deployment_id: ${{ steps.deployment.output.deployment_id }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} @@ -93,21 +73,16 @@ jobs: ALGOLIA_INDEX_NAME: edb-docs-staging INDEX_ON_BUILD: false - - name: Netlify deploy - run: | - sudo yarn global add netlify-cli - netlify deploy --dir=public --json | tee deploy_results.json - echo "NETLIFY_DRAFT_URL=`jq -r '.deploy_url' deploy_results.json`" >> $GITHUB_ENV + - name: Deploy to Netlify + id: netlify-deploy + uses: nwtgck/actions-netlify@v1.2.2 + with: + publish-dir: './public' + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: ${{ github.event.pull_request.title }} + enable-commit-comment: false + github-deployment-environment: ${{ env.BUILD_ENV_NAME }} env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} - - name: update the github deployment status - uses: bobheadxi/deployments@v0.5.2 - if: always() - with: - step: finish - token: ${{ secrets.GITHUB_TOKEN }} - status: ${{ job.status }} - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - env_url: ${{ steps.netlify-deploy.outputs.deploy-url }} \ No newline at end of file From 9e796ed89e8fc88b07d30462e4e0a5acb4de6357 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Wed, 21 Jul 2021 02:38:18 +0000 Subject: [PATCH 16/31] add draft build script Former-commit-id: ddf2cee95909b2576cece5a370f47440cb6dd92a --- .github/workflows/deploy-draft.yml | 91 ++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/deploy-draft.yml diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml new file mode 100644 index 00000000000..d1e79af9c76 --- /dev/null +++ b/.github/workflows/deploy-draft.yml @@ -0,0 +1,91 @@ +name: Deploy branch draft on Netlify +on: + pull_request: + types: [labeled, opened, synchronize] + +concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + +jobs: + build-deploy: + if: | + (github.event.action == 'labeled' && github.event.label.name == 'deploy') || + (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'deploy')) + runs-on: ubuntu-latest + steps: + - name: inject slug/short variables + uses: rlespinasse/github-slug-action@v3.x + + - name: compose a name for the build environment + run: echo "BUILD_ENV_NAME=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV + + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 # fetch whole repo so git-restore-mtime can work + + - name: Adjust file watchers limit + run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p + + - uses: actions/setup-node@v1 + with: + node-version: '14.x' + + # ref: https://github.com/actions/cache/blob/main/examples.md#node---yarn + - name: Get yarn cache directory + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Install yarn + run: sudo npm -g install yarn + + - name: Checking Yarn cache + uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Yarn install + run: yarn install --immutable + env: + NODE_ENV: ${{ secrets.NODE_ENV }} + + - name: Checking Gatsby cache + id: gatsby-cache-build + uses: actions/cache@v2 + with: + path: | + public + .cache + key: ${{ runner.os }}-gatsby-build-draft-${{ github.head_ref }} + + - name: Fix mtimes + run: yarn fix-mtimes --force + + - name: Gatsby build + run: yarn build + env: + APP_ENV: staging + NODE_ENV: ${{ secrets.NODE_ENV }} + NODE_OPTIONS: --max-old-space-size=4096 + ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} + ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} + ALGOLIA_INDEX_NAME: edb-docs-staging + INDEX_ON_BUILD: false + + - name: Deploy to Netlify + id: netlify-deploy + uses: nwtgck/actions-netlify@v1.2.2 + with: + publish-dir: './public' + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: ${{ github.event.pull_request.title }} + enable-commit-comment: false + github-deployment-environment: ${{ env.BUILD_ENV_NAME }} + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} + From 979d2d8f7bca71731f7a0ef263b1e59de4507d00 Mon Sep 17 00:00:00 2001 From: Abhilasha Narendra Date: Wed, 21 Jul 2021 16:11:59 +0530 Subject: [PATCH 17/31] Updated content for the release Former-commit-id: a5a68222e8f1793cf67f005605b0247978212736 --- .../net_connector/5.0.7.1/01_whats_new.mdx | 6 +- .../5.0.7.1/02_requirements_overview.mdx | 6 +- ...advanced_server_net_connector_overview.mdx | 12 +- ...ling_and_configuring_the_net_connector.mdx | 358 ++---------------- .../5.0.7.1/14_using_plugins.mdx | 164 -------- .../docs/net_connector/5.0.7.1/index.mdx | 10 +- 6 files changed, 33 insertions(+), 523 deletions(-) diff --git a/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx b/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx index c91a4991538..6bc8263a5c6 100644 --- a/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx @@ -8,7 +8,7 @@ legacyRedirectsGenerated: -The following features are added to create EDB .NET Connector `4.1.6.1`: +The following features are added to create EDB .NET Connector 5.0.7.1: -- Merged with the upstream Npgsql driver version 4.1.6. For more information about the merge updates, visit . -- Support for .NET Framework 4.7.2 and .NET Framework 4.8. +- Merged with the upstream Npgsql driver version 5.0. For more information about the merge updates, visit . +- Support for .NET 5.0 and .NET Core 3.1 (earlier available as .NET Core 3.0). diff --git a/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx index 1fd4a83f3e1..fd7d7eac9b1 100644 --- a/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx @@ -1,9 +1,5 @@ --- title: "Requirements Overview" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/requirements_overview.html" --- @@ -12,7 +8,7 @@ The following section details the supported platforms for the EDB .NET Connector ## Supported Server Versions and Platforms -The EDB .NET Connector is certified with Advanced Server version 9.5 and above. +The EDB .NET Connector is certified with Advanced Server version 9.6 and above. The EDB .NET Connector graphical installers are supported on the following Windows platforms: diff --git a/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx index d3e262afdcf..a067a4cca8b 100644 --- a/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx @@ -1,9 +1,6 @@ --- title: "The EDB .NET Connector - Overview" -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/the_advanced_server_net_connector_overview.html" --- @@ -12,11 +9,10 @@ The EDB .NET Connector is a .NET data provider that allows a client application The .NET Connector supports following frameworks: -- `.NET Framework versions 4.6.1, 4.7.2 and 4.8` -- `.NET Standard 2.0 and 2.1` -- `.NET Core 3.0` -- `Entity Framework 6` -- `EDB VSIX` +- .NET 5.0 +- .NET Core 3.1 +- .NET Standard 2.0 and 2.1 + ## The .NET Class Hierarchy diff --git a/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx index d2a120dd81e..09b1f178a51 100644 --- a/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx @@ -16,25 +16,25 @@ You can use the EDB .NET Connector Installer (available [from the EDB website](h ![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) -The .NET Connector Installation wizard +
The .NET Connector Installation wizard
Click `Next` to continue. ![The Installation dialog](images/dotnet_installation_dialog.png) -The Installation dialog +
The Installation dialog
Use the `Installation Directory` dialog to specify the directory in which the connector will be installed, and click `Next` to continue. ![The Ready to Install dialog](images/ready_to_install.png) -The Ready to Install dialog +
The Ready to Install dialog
Click `Next` on the `Ready to Install` dialog to start the installation; popup dialogs confirm the progress of the installation wizard. ![The installation is complete](images/dotnet_installation_complete.png) -The installation is complete +
The installation is complete
When the wizard informs you that it has completed the setup, click the `Finish` button to exit the dialog. @@ -42,7 +42,7 @@ You can also use StackBuilder Plus to add or update the connector on an existing ![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) -Starting StackBuilder Plus +
Starting StackBuilder Plus
When StackBuilder Plus opens, follow the onscreen instructions. @@ -50,7 +50,7 @@ Select the `EnterpriseDB.Net Connector` option from the `Database Drivers` node ![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) -Selecting the Connectors installer +
Selecting the Connectors installer
Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. @@ -59,14 +59,12 @@ Follow the directions of the onscreen wizard to add or update an installation of Please see the following environment-specific sections for information about configuring the .NET Connector: - **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. -- **.NET Framework 4.6.1** Instructions for configuring for use with [.NET Framework 4.6.1](#framework_setup_4_6_1). -- **.NET Framework 4.7.2** Instructions for configuring for use with [.NET Framework 4.7.2](#framework_setup_4_7_2). -- **.NET Framework 4.8** Instructions for configuring for use with [.NET Framework 4.8](#framework_setup_4_8). -- **.NET Standard 2.0.** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). -- **.NET Standard 2.1.** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). -- **.NET Core 3.0** Instructions for configuring for use with [.NET Core 3.0](#framework_setup_core3_0). -- **Entity Framework 6.** Instructions for configuring for use with [Entity Framework](#entity_setup_5_6). -- **EDB VSIX.** Instructions for configuring for use with [EDB VSIX](#vsix_setup). +- **.NET 5.0** Instructions for configuring for use with [.NET 5.0](#setup_5_0). +- **.NET Core 3.1** Instructions for configuring for use with [.NET Core 3.1](#framework_setup_core3_1). +- **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). +- **.NET Standard 2.1** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). + + ### Referencing the Library Files @@ -84,10 +82,6 @@ Before you can use an EDB .NET class, you must import the namespace into your pr `EnterpriseDB.EDBClient` -If you are using Entity Framework 6, the following additional namespace is required: - - `EntityFramework6.EntepriseDB.EDBClient` - The method you use to include the namespace varies by the type of application you are writing. For example, the following command imports a namespace into an `ASP.NET` page: `<% import namespace="EnterpriseDB.EDBClient" %>` @@ -100,88 +94,43 @@ To import a namespace into a C# application, write: The following sections describe the setup for various .NET versions. - + -#### .NET Framework 4.6.1 +#### .NET 5.0 -If you are using .NET Framework version 4.6.1, the data provider installation path is: +For .NET 5.0, the data provider installation path is: - `C:\Program Files\edb\dotnet\net461\` + `C:\Program Files\edb\dotnet\net5.0\` You must add the following dependencies to your project: `EnterpriseDB.EDBClient.dll` - `Microsoft.Bcl.AsyncInterfaces.dll` - - `System.Memory.dll` - - `System.Numerics.Vectors.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.Runtime.dll` - - `System.Text.Json.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.ValueTuple.dll` - Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - + -#### .NET Framework 4.7.2 +#### .NET Core 3.1 -If you are using .NET Framework version 4.7.2, the data provider installation path is: +If you are using .NET Core 3.1, the data provider installation path is: - `C:\Program Files\edb\dotnet\net472\` + `C:\Program Files\edb\dotnet\netcoreapp3.1\` - You must add the following dependencies to your project: +The following shared library files are required: `EnterpriseDB.EDBClient.dll` - `Microsoft.Bcl.AsyncInterfaces.dll` - - `System.Memory.dll` - - `System.Numerics.Vectors.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.Text.Json.dll` - `System.Threading.Tasks.Extensions.dll` -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Framework 4.8 - -If you are using .NET Framework version 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net48\` - - You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - - `Microsoft.Bcl.AsyncInterfaces.dll` - - `System.Memory.dll` - - `System.Numerics.Vectors.dll` - `System.Runtime.CompilerServices.Unsafe.dll` - `System.Text.Json.dll` + `System.ValueTuple.dll` - `System.Threading.Tasks.Extensions.dll` + `System.Memory.dll` Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. + #### .NET Standard 2.0 @@ -231,264 +180,5 @@ The following shared library files are required: Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - -#### .NET Core 3.0 - -If you are using .NET Core 3.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netcoreapp3.0\` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - - `System.Memory.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -### Entity Framework 6 - -To configure the .NET Connector for use with Entity Framework, the data provider installation path is: - -**For net461** - - `C:\Program Files\edb\dotnet\EF\net461` - -The following shared library file is required: - - `EntityFramework6.EnterpriseDB.EDBClient.dll` - -**For net472** - - `C:\Program Files\edb\dotnet\EF\net472` - -The following shared library file is required: - - `EntityFramework6.EnterpriseDB.EDBClient.dll` - -**For net48** - - `C:\Program Files\edb\dotnet\EF\net48` - -The following shared library file is required: - - `EntityFramework6.EnterpriseDB.EDBClient.dll` - -!!! Note - Entity Framework can be used with the `EnterpriseDB.EDBClient.dll` library available in the `net461`, `net472` and `net48` subdirectories. - -See [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. - -Add the `` entries for the `ADO.NET` driver for Postgres to the `app.config` file. Add the following entries: - -```text - -``` - -In the project’s `app.config` file add the following entry for provider services under the EntityFramework/providers tag: - -```text - - -``` - -The following is an example of the `app.config` file: - -```text - - - -
- - - - - - - - - - - - - - - - - - - - -``` - -!!! Note - The same entries for `` and `` are valid for the `web.config` file and the `app.config` file. - -Depending upon the type of application you are using, you may be required to import the namespace into the source code (see [Referencing the Library Files](#referencing_the_library_files)). - -For usage information about Entity Framework, refer to the Microsoft documentation. - - - -### EDB VSIX for Visual Studio 2015/2017/2019 - -The EDB Data Designer Extensibility Provider (EDB VSIX) is a component that integrates Advanced Server database access into Visual Studio, thus providing Visual Studio integrated features. - -EDB VSIX allows you to connect to Advanced Server from within Visual Studio's Server Explorer and create a model from an existing database. Therefore, if Visual Studio features are desired, then EDB VSIX must be utilized. - -EDB VSIX files are located in the following directory: - - `C:\Program Files\edb\dotnet\vsix` - -The files available at the above location are: - - `edb_logo.ico` - `EnterpriseDB.vsix` - `SSDLToPgSQL.tt` - `System.ValueTuple.dll` - -#### Installation and Configuration for Visual Studio 2015/2017/2019 - -Use the following steps to install and configure EDB VSIX. - -**Step 1:** Install EDB VSIX to the desired version of Visual Studio with the `EnterpriseDB.vsix` installer. - -If you already have an earlier version of the VSIX installed, we highly recommended that you uninstall it to avoid conflicts. - -It is no longer necessary or recommended to have `EnterpriseDB.EDBClient` in your global assembly cache (GAC). - -**Step 2:** Relaunch Visual Studio and verify from the `Tools > Extensions and Updates…` menu that the EDB extension is installed. - -**Step 3:** Use the `gacutil` utility at the Visual Studio Developers Command Line to add following libraries to the global assembly cache (GAC): - -`System.ValueTuple.dll` -`System.Threading.Tasks.Extensions.dll` -`System.Runtime.CompilerServices.Unsafe.dll` -`System.Memory.dll` -`Microsoft.Bcl.AsyncInterfaces.dll` -`System.Text.Json.dll` - -For example: - - `> gacutil.exe /i System.ValueTuple.dll` - -**Step 4:** From the Server Explorer, right-click on `Data Connections`, click `Add Connection`, and verify that the `Enterprisedb Postgres Database` data source is available. - -#### Model First and Database First Usage - -**Step 1:** Add the `` entries for the ADO.NET driver to the `machine.config` file. Include the following entries: - -```text - -``` - -For the attribute-value pairs, the double-quoted strings should not contain excess white space characters, but be configured on a single line. The examples shown in this section may be split on multiple lines for clarity, but should actually be configured within a single line such as the following: - -`description=".NET Data Provider for EnterpriseDB PostgreSQL"` - -For 64-bit Windows, the `machine.config` file is in the following location: - -`C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config` - -For 32-bit Windows, the `machine.config` file is in the following location: - -`C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config` - -**Step 2:** Place the DDL generation template `SSDLToPgSQL.tt` in the Visual Studio `EntityFramework Tools\DBGen\` folder as shown in the following example: - -```text -C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\EntityFramework Tools\DBGen\ -``` - -!!! Note - Select this template `SSDLToPgSQL.tt` in your EDMX file properties. - -**Step 3:** Add the `EnterpriseDB.EDBClient.dll` and `EntityFramework6.EnterpriseDB.EDBClient.dll` files to project references. see [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. - -**Step 4:** Configure your Entity Framework application in either of following two ways: - -- Code-based -- Config-based. - -**Code-based** - -Define a class that inherits from `DbConfiguration` in the same assembly as your class inheriting `DbContext`. Ensure that you configure `provider services`, a `provider factory`, and a `default connection factory` as shown below: - -```text -using EnterpriseDB.EDBClient; -using System.Data.Entity; - -class EDBConfiguration : DbConfiguration -{ - public EDBConfiguration() - { - - var name = "EnterpriseDB.EDBClient"; - - SetProviderFactory(providerInvariantName: name, - providerFactory: EnterpriseDB.EDBClient.EDBFactory.Instance); - - SetProviderServices(providerInvariantName: name, - provider: EnterpriseDB.EDBClient.EDBServices.Instance); - - SetDefaultConnectionFactory(connectionFactory: new EnterpriseDB.EDBClient.EDBConnectionFactory()); - } -} -``` - -**Config-based** - -In the project’s `app.config` file, add the following entry for provider services under the EntityFramework/providers tag: - -```text - - -``` - -The following is an example of the `app.config` file. - -```text - - - -
- - - - - - - - - - - - - - - - - - -``` diff --git a/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx b/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx index ce51e374e1e..b74162cb945 100644 --- a/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx @@ -21,36 +21,6 @@ The plugins support the use of spatial, data/time and Json types. The following ## GeoJSON -If you are using the GeoJSON plugin on .NET Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.GeoJSON.dll` - `GeoJSON.Net.dll` - `Newtonsoft.Json.dll` - -If you are using the GeoJSON plugin on .NET Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.GeoJSON.dll` - `GeoJSON.Net.dll` - `Newtonsoft.Json.dll` - -If you are using the GeoJSON plugin on .NET Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.GeoJSON.dll` - `GeoJSON.Net.dll` - `Newtonsoft.Json.dll` - If you are using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path is: `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` @@ -63,33 +33,6 @@ For detailed information about using the GeoJSON plugin, see the [Npgsql documen ## Json.NET -If you are using the Json.NET plugin on .NET Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.Json.NET.dll` - `Newtonsoft.Json.dll` - -If you are using the Json.NET plugin on .NET Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.Json.NET.dll` - `Newtonsoft.Json.dll` - -If you are using the Json.NET plugin on .NET Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.Json.NET.dll` - `Newtonsoft.Json.dll` - If you are using the Json.NET plugin on .NET Standard 2.0, the data provider installation path is: `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` @@ -102,30 +45,6 @@ For detailed information about using the Json.NET plugin, see the [Npgsql docume ## LegacyPostGIS -If you are using the LegacyPostGIS plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -If you are using the LegacyPostGIS plugin on .Net Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -If you are using the LegacyPostGIS plugin on .Net Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - If you are using the LegacyPostGIS plugin on .Net Standard 2.0, the data provider installation path is: `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\netstandard2.0` @@ -138,38 +57,6 @@ For detailed information about using the LegacyPostGIS plugin, see the [Npgsql d ## NetTopologySuite -If you are using the NetTopologySuite plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - `NetTopologySuite.dll` - `NetTopologySuite.IO.PostGis.dll` - -If you are using the NetTopologySuite plugin on .Net Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - `GeoAPI.dll` - `NetTopologySuite.dll` - `NetTopologySuite.IO.PostGis.dll` - -If you are using the NetTopologySuite plugin on .Net Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - `GeoAPI.dll` - `NetTopologySuite.dll` - `NetTopologySuite.IO.PostGis.dll` - If you are using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path is: `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` @@ -182,33 +69,6 @@ For detailed information about using the NetTopologySuite type plugin, see the [ ## NodaTime -If you are using the NodaTime plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - `NodaTime.dll` - -If you are using the NodaTime plugin on .Net Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - `NodaTime.dll` - -If you are using the NodaTime plugin on .Net Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - `NodaTime.dll` - If you are using the NodaTime plugin on .Net Standard 2.0, the data provider installation path is: `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` @@ -221,30 +81,6 @@ For detailed information about using the NodaTime plugin, see the [Npgsql docume ## RawPostGIS -If you are using the RawPostGIS plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\RawPostgis\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - -If you are using the RawPostGIS plugin on .Net Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\RawPostgis\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - -If you are using the RawPostGIS plugin on .Net Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\RawPostgis\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - If you are using the RawPostGIS type plugin on .Net Standard 2.0, the data provider installation path is: `C:\Program\Files\edb\dotnet\plugins\RawPostGis\netstandard2.0` diff --git a/product_docs/docs/net_connector/5.0.7.1/index.mdx b/product_docs/docs/net_connector/5.0.7.1/index.mdx index ca3ce75ab37..a8becc044c7 100644 --- a/product_docs/docs/net_connector/5.0.7.1/index.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/index.mdx @@ -1,15 +1,7 @@ --- title: "EDB .NET Connector" directoryDefaults: - description: "EDB .NET Connector Version 4.1.6.1 Documentation and release notes." - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/index.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/conclusion.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/genindex.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/whats_new.html" - - "/edb-docs/p/edb-postgres-net-connector/4.1.6.1" + description: "EDB .NET Connector Version 5.0.7.1 Documentation and release notes." --- The EDB .NET Connector distributed with EDB Postgres Advanced Server (Advanced Server) provides connectivity between a .NET client application and an Advanced Server database server. This guide provides installation instructions, usage instructions, and examples that demonstrate the functionality of the EDB .NET Connector: From b1a6d6244246c22a0849135e99d806242fb492a8 Mon Sep 17 00:00:00 2001 From: nidhibhammar <59045594+nidhibhammar@users.noreply.github.com> Date: Thu, 29 Jul 2021 17:20:40 +0530 Subject: [PATCH 18/31] Added the EntityFramework Core to the doc Added the EntityFramework Core to the doc Former-commit-id: 0f5264c224a5836fd5b09007b92dadfd7d5952a6 --- .../net_connector/5.0.7.1/01_whats_new.mdx | 2 +- ...ling_and_configuring_the_net_connector.mdx | 81 +++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx b/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx index 6bc8263a5c6..2f1925f4b29 100644 --- a/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/01_whats_new.mdx @@ -10,5 +10,5 @@ legacyRedirectsGenerated: The following features are added to create EDB .NET Connector 5.0.7.1: -- Merged with the upstream Npgsql driver version 5.0. For more information about the merge updates, visit . +- Merged with the upstream Npgsql driver version 5.0.7. For more information about the merge updates, visit . - Support for .NET 5.0 and .NET Core 3.1 (earlier available as .NET Core 3.0). diff --git a/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx index 09b1f178a51..3283aac5973 100644 --- a/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx @@ -63,6 +63,7 @@ Please see the following environment-specific sections for information about con - **.NET Core 3.1** Instructions for configuring for use with [.NET Core 3.1](#framework_setup_core3_1). - **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). - **.NET Standard 2.1** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). +- **.NET EntityFramework Core** Instructions for configuring for use with [.NET EntityFramework Core](#entity_setup). @@ -180,5 +181,85 @@ The following shared library files are required: Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. + +#### .NET EntityFramework Core + +To configure the .NET Connector for use with Entity Framework Core, the data provider installation path is: + + `C:\Program Files\edb\dotnet\EFCore` + +The following shared library file is required: + + `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` + +!!! Note + + Entity Framework Core can be used with the EnterpriseDB.EDBClient.dll library available in the net5.0 and netcoreapp3.1 subdirectories. + +See [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. + +The following NuGet packages are required: + + `Microsoft.EntityFrameworkCore.Design` + + `Microsoft.EntityFrameworkCore.Relational` + + `Microsoft.EntityFrameworkCore.Abstractions` + +In case of NetCoreApp3.1 you have to add the following NuGet package in addition to the above packages: + + `System.Text.Json` + +For usage information about Entity Framework Core, refer to the Microsoft documentation. + +**Prerequisite**: + +Install dotnet-ef (using Command Prompt) + + `dotnet tool install --global dotnet-ef` + +**Sample Project** + +Create a new Console Application based on .NET 5.0 or NetCoreApp3.1 + +Add Reference to the following EDB assemblies: + + `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` + + `EnterpriseDB.EDBClient.dll` + +Add the following NuGet packages: + + `Microsoft.EntityFrameworkCore.Design` + + `Microsoft.EntityFrameworkCore.Relational` + + `Microsoft.EntityFrameworkCore.Abstractions` + +In case of NetCoreApp3.1 add the following NuGet package in addition to the above packages: + + `System.Text.Json` + +Command Prompt + + `Open Tools` → `Command Line` → `Developer Command Prompt` + +**Database First Scenario** + +Issue the following command to create Model Classes corresponding to all objects in the specified database: + +`dotnet ef dbcontext scaffold Host=;Database=;Username=;Password=;Port= EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL -o Models` + +**Code First Scenario** + +Add code for defining a DbContext and create, read, update & delete operations. + +Please refer to the Microsoft documentation for further details. + +Issue the following commands to create the initial database and tables: + + `dotnet ef migrations add InitialCreate --context BloggingContext` + + `dotnet ef database update --context BloggingContext` From af137d9c16241e2b48ea5637dcc9dcc12c830bf1 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Fri, 30 Jul 2021 11:49:31 -0700 Subject: [PATCH 19/31] Test deploying PDFs directly to Netlify Former-commit-id: f63ba75a385424540e7dfa04b071b6251d6244cb --- .github/workflows/deploy-test.yml | 75 +++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/deploy-test.yml diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml new file mode 100644 index 00000000000..1439cb9897a --- /dev/null +++ b/.github/workflows/deploy-test.yml @@ -0,0 +1,75 @@ +name: Deploy Develop to Netlify +on: + push: + branches: + - bugfix/jon/1632-stop-checking-in-pdfs +jobs: + build-deploy: + runs-on: ubuntu-latest + steps: + - name: Cleanup disk + uses: curoky/cleanup-disk-action@v2.0 + with: + retain: "python,node" + - uses: actions/checkout@v2 + with: + ref: bugfix/jon/1632-stop-checking-in-pdfs + fetch-depth: 0 # fetch whole repo so git-restore-mtime can work + - name: Adjust file watchers limit + run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p + + - uses: actions/setup-node@v1 + with: + node-version: "14.x" + - name: Install yarn + run: sudo npm -g install yarn + - name: Yarn install + run: yarn install --immutable + env: + NODE_ENV: ${{ secrets.NODE_ENV }} + + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + - uses: r-lib/actions/setup-pandoc@v1 + with: + pandoc-version: "2.10.1" + - name: Install wkhtmltopdf + run: | + curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb + sudo apt-get install ./wkhtmltopdf.deb + + - name: Build all pdfs + run: npm run build-all-pdfs-ci + + - name: Checking Gatsby cache + id: gatsby-cache-build + uses: actions/cache@v2 + with: + path: | + public + .cache + key: ${{ runner.os }}-gatsby-build-develop-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-gatsby-build-develop- + + - name: Fix mtimes + run: yarn fix-mtimes --force + - name: Gatsby build + run: yarn build + env: + APP_ENV: staging + NODE_ENV: ${{ secrets.NODE_ENV }} + NODE_OPTIONS: --max-old-space-size=4096 + ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} + ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} + ALGOLIA_INDEX_NAME: edb-docs-staging + INDEX_ON_BUILD: false + + - name: Netlify deploy + run: | + sudo yarn global add netlify-cli + netlify deploy --dir=public --prod + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} From d0469b0a872748a0b9db62c53f5687263c3e60e9 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Fri, 30 Jul 2021 13:48:29 -0700 Subject: [PATCH 20/31] Remove the PDFs to make sure the Netlify deploy is actually working. Former-commit-id: 6e737f3f21917604a1ad783fe56b502bca1c2fe4 From 3b15050881938e6a2f46d2434cf6895eb965f6e7 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Mon, 2 Aug 2021 08:28:26 -0700 Subject: [PATCH 21/31] Test the develop workflow directly on this branch. Former-commit-id: b75bc508bea78c550a092eee0a183757c50e4341 --- .github/workflows/deploy-develop.yml | 18 ++++++- .github/workflows/deploy-test.yml | 75 ---------------------------- 2 files changed, 16 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/deploy-test.yml diff --git a/.github/workflows/deploy-develop.yml b/.github/workflows/deploy-develop.yml index b0aaa6e40b1..81bc7aea489 100644 --- a/.github/workflows/deploy-develop.yml +++ b/.github/workflows/deploy-develop.yml @@ -3,14 +3,14 @@ on: push: branches: - develop + - bugfix/jon/1632-stop-checking-in-pdfs jobs: build-deploy: runs-on: ubuntu-latest steps: - name: Cleanup disk uses: curoky/cleanup-disk-action@v2.0 - with: - retain: "python,node" + - uses: actions/checkout@v2 with: ref: develop @@ -28,6 +28,20 @@ jobs: env: NODE_ENV: ${{ secrets.NODE_ENV }} + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + - uses: r-lib/actions/setup-pandoc@v1 + with: + pandoc-version: "2.10.1" + - name: Install wkhtmltopdf + run: | + curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb + sudo apt-get install ./wkhtmltopdf.deb + + - name: Build all pdfs + run: npm run build-all-pdfs-ci + - name: Checking Gatsby cache id: gatsby-cache-build uses: actions/cache@v2 diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml deleted file mode 100644 index 1439cb9897a..00000000000 --- a/.github/workflows/deploy-test.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Deploy Develop to Netlify -on: - push: - branches: - - bugfix/jon/1632-stop-checking-in-pdfs -jobs: - build-deploy: - runs-on: ubuntu-latest - steps: - - name: Cleanup disk - uses: curoky/cleanup-disk-action@v2.0 - with: - retain: "python,node" - - uses: actions/checkout@v2 - with: - ref: bugfix/jon/1632-stop-checking-in-pdfs - fetch-depth: 0 # fetch whole repo so git-restore-mtime can work - - name: Adjust file watchers limit - run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - - - uses: actions/setup-node@v1 - with: - node-version: "14.x" - - name: Install yarn - run: sudo npm -g install yarn - - name: Yarn install - run: yarn install --immutable - env: - NODE_ENV: ${{ secrets.NODE_ENV }} - - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - uses: r-lib/actions/setup-pandoc@v1 - with: - pandoc-version: "2.10.1" - - name: Install wkhtmltopdf - run: | - curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb - sudo apt-get install ./wkhtmltopdf.deb - - - name: Build all pdfs - run: npm run build-all-pdfs-ci - - - name: Checking Gatsby cache - id: gatsby-cache-build - uses: actions/cache@v2 - with: - path: | - public - .cache - key: ${{ runner.os }}-gatsby-build-develop-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-gatsby-build-develop- - - - name: Fix mtimes - run: yarn fix-mtimes --force - - name: Gatsby build - run: yarn build - env: - APP_ENV: staging - NODE_ENV: ${{ secrets.NODE_ENV }} - NODE_OPTIONS: --max-old-space-size=4096 - ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_INDEX_NAME: edb-docs-staging - INDEX_ON_BUILD: false - - - name: Netlify deploy - run: | - sudo yarn global add netlify-cli - netlify deploy --dir=public --prod - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} From 2b50abacdb7980bb538b8e46ab6dab80a6802275 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Mon, 2 Aug 2021 10:31:15 -0700 Subject: [PATCH 22/31] Generate PDFs on push to main and remove extra workflow. Former-commit-id: fc3e10c226303616b33642d19e2550443973946a --- .github/workflows/deploy-main.yml | 18 ++++++- .github/workflows/update-pdfs-on-develop.yml | 55 -------------------- README.md | 6 +++ 3 files changed, 22 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/update-pdfs-on-develop.yml diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index 89254b43f19..ea2de840948 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -9,8 +9,7 @@ jobs: steps: - name: Cleanup disk uses: curoky/cleanup-disk-action@v2.0 - with: - retain: "python,node" + - uses: actions/checkout@v2 with: ref: main @@ -28,6 +27,21 @@ jobs: env: NODE_ENV: ${{ secrets.NODE_ENV }} + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + - uses: r-lib/actions/setup-pandoc@v1 + with: + pandoc-version: "2.10.1" + - name: Install wkhtmltopdf + run: | + curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb + sudo apt-get install ./wkhtmltopdf.deb + + - name: Build all pdfs + run: npm run build-all-pdfs-ci + + - name: Checking Gatsby cache id: gatsby-cache-build uses: actions/cache@v2 diff --git a/.github/workflows/update-pdfs-on-develop.yml b/.github/workflows/update-pdfs-on-develop.yml deleted file mode 100644 index 15d9b540c9c..00000000000 --- a/.github/workflows/update-pdfs-on-develop.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Update PDFs on Develop -on: - push: - branches: - - develop - paths: - - product_docs/docs/**.mdx - - scripts/pdf/generate_pdf.py - - .github/workflows/update-pdfs-on-develop.yml -jobs: - build-pdfs: - runs-on: ubuntu-20.04 - steps: - - name: Cleanup disk - uses: curoky/cleanup-disk-action@v2.0 - with: - retain: "python,node" - - uses: actions/checkout@v2 - with: - ref: develop - ssh-key: ${{ secrets.ADMIN_SECRET_SSH_KEY }} - - - uses: actions/setup-node@v1 - with: - node-version: "14.x" - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - uses: r-lib/actions/setup-pandoc@v1 - with: - pandoc-version: "2.10.1" - - name: Install wkhtmltopdf - run: | - curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb - sudo apt-get install ./wkhtmltopdf.deb - - - name: Build all pdfs - run: npm run build-all-pdfs-ci - - - run: git status - - run: git pull - - name: Commit pdfs to develop - run: | - git config user.name josh-heyer - git config user.email josh.heyer@enterprisedb.com - git add *.pdf - git commit -m "New PDFs generated by Github Actions" - git push - - - uses: act10ns/slack@v1 - with: - status: ${{ job.status }} - if: failure() - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/README.md b/README.md index 84afa43b231..3dbce797cb7 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,12 @@ This repo contains the React/Gatsby application that powers [the EDB Docs website](https://www.enterprisedb.com/docs/). The site pulls [Markdown](https://www.markdownguide.org/) content from several repos in a process called "sourcing", and then renders it all into high-performance markup. You can install the application on your local computer for easy editing, viewing, and eventually publishing to the GitHub repo. +## Please remove and re-clone your local repositories after August 6, 2021 + +We've been checking PDF files into Git. That's not a good plan, so [we've stopped doing that](https://github.com/EnterpriseDB/docs/issues/1632). The next step is to remove these files from Git history and [move other large files to LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/moving-a-file-in-your-repository-to-git-large-file-storage). Among many other good things, that ought to reduce the time to clone this repository substantially. + +But it comes at a cost. If there are any local repositories that were cloned before the change, we risk introducing dirty history back into the repository. So we're asking that everyone who has a local repository they **cloned before (or on) August 6, 2021** to delete those repositories. Unfortunately, we'll need to reject any pull requests that introduce PDF files back into Git history. (If you need any help with this, please contact jon.ericson@enterprisedb.com .) + ## MacOS Installation We recommend using MacOS to work with the EDB Docs application. From 935cd48b86297acfe279da258491133d318e62e4 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Tue, 3 Aug 2021 09:34:11 -0700 Subject: [PATCH 23/31] Small fixes recommended by George. Former-commit-id: f8aa114b3b171eb56a3bf4bcd055fb2f4d9916eb --- .github/workflows/deploy-develop.yml | 2 +- .github/workflows/deploy-main.yml | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-develop.yml b/.github/workflows/deploy-develop.yml index 81bc7aea489..51f4bffd10c 100644 --- a/.github/workflows/deploy-develop.yml +++ b/.github/workflows/deploy-develop.yml @@ -33,7 +33,7 @@ jobs: python-version: "3.x" - uses: r-lib/actions/setup-pandoc@v1 with: - pandoc-version: "2.10.1" + pandoc-version: "2.12" - name: Install wkhtmltopdf run: | curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index ea2de840948..a2a9501db5a 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -32,7 +32,7 @@ jobs: python-version: "3.x" - uses: r-lib/actions/setup-pandoc@v1 with: - pandoc-version: "2.10.1" + pandoc-version: "2.12" - name: Install wkhtmltopdf run: | curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb diff --git a/README.md b/README.md index 3dbce797cb7..5109bd01457 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This repo contains the React/Gatsby application that powers [the EDB Docs websit We've been checking PDF files into Git. That's not a good plan, so [we've stopped doing that](https://github.com/EnterpriseDB/docs/issues/1632). The next step is to remove these files from Git history and [move other large files to LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/moving-a-file-in-your-repository-to-git-large-file-storage). Among many other good things, that ought to reduce the time to clone this repository substantially. -But it comes at a cost. If there are any local repositories that were cloned before the change, we risk introducing dirty history back into the repository. So we're asking that everyone who has a local repository they **cloned before (or on) August 6, 2021** to delete those repositories. Unfortunately, we'll need to reject any pull requests that introduce PDF files back into Git history. (If you need any help with this, please contact jon.ericson@enterprisedb.com .) +But it comes at a cost. If there are any local repositories that were cloned before the change, we risk introducing dirty history back into the repository. So we're asking that everyone who has a local repository they **cloned before (or on) August 6, 2021** to delete those repositories. Unfortunately, we'll need to reject any pull requests that introduce PDF files back into Git history. (If you need any help with this, please contact jon.ericson@enterprisedb.com.) ## MacOS Installation From 85662cb8c582cad122c102bbd11c36b747de1125 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Tue, 3 Aug 2021 09:43:03 -0700 Subject: [PATCH 24/31] Upgrade to setup-node@v2 Former-commit-id: 8ad0604412fbcaa81552733abdcf3a854ad5094b --- .github/workflows/deploy-develop.yml | 2 +- .github/workflows/deploy-main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-develop.yml b/.github/workflows/deploy-develop.yml index 51f4bffd10c..76796ec20bf 100644 --- a/.github/workflows/deploy-develop.yml +++ b/.github/workflows/deploy-develop.yml @@ -18,7 +18,7 @@ jobs: - name: Adjust file watchers limit run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: "14.x" - name: Install yarn diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index a2a9501db5a..827bd475d9b 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -17,7 +17,7 @@ jobs: - name: Adjust file watchers limit run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: "14.x" - name: Install yarn From 6b2c4051b1cab17d1893da283e0eff02945e5f28 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Tue, 3 Aug 2021 10:19:22 -0700 Subject: [PATCH 25/31] Stop running actions on this branch and update pandoc to 2.14.1 Former-commit-id: 27f6e644f20b8853f4d4f64247c4b04f149eb9ce --- .github/workflows/deploy-develop.yml | 3 +-- .github/workflows/deploy-main.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-develop.yml b/.github/workflows/deploy-develop.yml index 76796ec20bf..fff12a223ea 100644 --- a/.github/workflows/deploy-develop.yml +++ b/.github/workflows/deploy-develop.yml @@ -3,7 +3,6 @@ on: push: branches: - develop - - bugfix/jon/1632-stop-checking-in-pdfs jobs: build-deploy: runs-on: ubuntu-latest @@ -33,7 +32,7 @@ jobs: python-version: "3.x" - uses: r-lib/actions/setup-pandoc@v1 with: - pandoc-version: "2.12" + pandoc-version: "2.14.1" - name: Install wkhtmltopdf run: | curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index 827bd475d9b..f3670d96204 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -32,7 +32,7 @@ jobs: python-version: "3.x" - uses: r-lib/actions/setup-pandoc@v1 with: - pandoc-version: "2.12" + pandoc-version: "2.14.1" - name: Install wkhtmltopdf run: | curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb From c002e727a62e1976de4559d7605d7053d1ad72c9 Mon Sep 17 00:00:00 2001 From: nidhibhammar <59045594+nidhibhammar@users.noreply.github.com> Date: Fri, 6 Aug 2021 16:08:18 +0530 Subject: [PATCH 26/31] Applied the changes to Advance Queueing section as per EC-1878 Applied the changes to Advance Queueing section as per EC-1878 Former-commit-id: 9de0df2ebc082c190ea8314023d6819fb97de415 --- .../net_connector/5.0.7.1/12_using_advanced_queueing.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx index f6a807ae432..85dee0d431f 100644 --- a/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx @@ -162,6 +162,8 @@ namespace AQXml queMsg.Payload = new MyXML { value = xml }; queue.MessageType = EDBAQMessageType.Udt; queue.UdtTypeName = "myxml"; + EDBConnection.GlobalTypeMapper.MapComposite("myxml"); + con.ReloadTypes(); queue.Enqueue(queMsg); var messageId = ByteArrayToString((byte[])queMsg.MessageId); Console.WriteLine("MessageID: " + messageId); @@ -318,8 +320,8 @@ namespace DequeueXML { Console.WriteLine("Processing received message..."); // process the message payload - MyXML obj = new MyXML(); - queueListen.Map(deqMsg.Payload, obj); + MyXML obj = (MyXML) deqMsg.Payload; + bj = (MyXML) deqMsg.Payload; QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); From 3128116681bab2c37e40696b23a8087b297d14b7 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Fri, 6 Aug 2021 11:02:03 -0700 Subject: [PATCH 27/31] Delayed the operation Former-commit-id: c16c104c913ee7c264d40d7d066847ac7d914400 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5109bd01457..0f37ab60848 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ This repo contains the React/Gatsby application that powers [the EDB Docs website](https://www.enterprisedb.com/docs/). The site pulls [Markdown](https://www.markdownguide.org/) content from several repos in a process called "sourcing", and then renders it all into high-performance markup. You can install the application on your local computer for easy editing, viewing, and eventually publishing to the GitHub repo. -## Please remove and re-clone your local repositories after August 6, 2021 +## Please remove and re-clone your local repositories after August 13, 2021 We've been checking PDF files into Git. That's not a good plan, so [we've stopped doing that](https://github.com/EnterpriseDB/docs/issues/1632). The next step is to remove these files from Git history and [move other large files to LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/moving-a-file-in-your-repository-to-git-large-file-storage). Among many other good things, that ought to reduce the time to clone this repository substantially. -But it comes at a cost. If there are any local repositories that were cloned before the change, we risk introducing dirty history back into the repository. So we're asking that everyone who has a local repository they **cloned before (or on) August 6, 2021** to delete those repositories. Unfortunately, we'll need to reject any pull requests that introduce PDF files back into Git history. (If you need any help with this, please contact jon.ericson@enterprisedb.com.) +But it comes at a cost. If there are any local repositories that were cloned before the change, we risk introducing dirty history back into the repository. So we're asking that everyone who has a local repository they **cloned before (or on) August 13, 2021** to delete those repositories. Unfortunately, we'll need to reject any pull requests that introduce PDF files back into Git history. (If you need any help with this, please contact jon.ericson@enterprisedb.com.) ## MacOS Installation From 66491efbf0ef22ac85c43b395bfbe4490052104d Mon Sep 17 00:00:00 2001 From: nidhibhammar <59045594+nidhibhammar@users.noreply.github.com> Date: Mon, 9 Aug 2021 12:39:25 +0530 Subject: [PATCH 28/31] Removed one row as requested according to EC-1878 Removed one row as requested according to EC-1878 Former-commit-id: 0371b644746047993635449a3ab9208737d5a02d --- .../docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx index 85dee0d431f..10cd0128e06 100644 --- a/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx +++ b/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx @@ -321,7 +321,6 @@ namespace DequeueXML Console.WriteLine("Processing received message..."); // process the message payload MyXML obj = (MyXML) deqMsg.Payload; - bj = (MyXML) deqMsg.Payload; QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); From 1689c4ab769b237a12bc35fa89f04c9688343dfc Mon Sep 17 00:00:00 2001 From: nidhibhammar <59045594+nidhibhammar@users.noreply.github.com> Date: Mon, 9 Aug 2021 15:53:01 +0530 Subject: [PATCH 29/31] Delete deploy-draft.yml Former-commit-id: a1d618bbf1a50399908193eb68269835a5ca7438 --- .github/workflows/deploy-draft.yml | 91 ------------------------------ 1 file changed, 91 deletions(-) delete mode 100644 .github/workflows/deploy-draft.yml diff --git a/.github/workflows/deploy-draft.yml b/.github/workflows/deploy-draft.yml deleted file mode 100644 index d1e79af9c76..00000000000 --- a/.github/workflows/deploy-draft.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Deploy branch draft on Netlify -on: - pull_request: - types: [labeled, opened, synchronize] - -concurrency: - group: ${{ github.head_ref }} - cancel-in-progress: true - -jobs: - build-deploy: - if: | - (github.event.action == 'labeled' && github.event.label.name == 'deploy') || - (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'deploy')) - runs-on: ubuntu-latest - steps: - - name: inject slug/short variables - uses: rlespinasse/github-slug-action@v3.x - - - name: compose a name for the build environment - run: echo "BUILD_ENV_NAME=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV - - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 # fetch whole repo so git-restore-mtime can work - - - name: Adjust file watchers limit - run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - - - uses: actions/setup-node@v1 - with: - node-version: '14.x' - - # ref: https://github.com/actions/cache/blob/main/examples.md#node---yarn - - name: Get yarn cache directory - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - name: Install yarn - run: sudo npm -g install yarn - - - name: Checking Yarn cache - uses: actions/cache@v2 - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Yarn install - run: yarn install --immutable - env: - NODE_ENV: ${{ secrets.NODE_ENV }} - - - name: Checking Gatsby cache - id: gatsby-cache-build - uses: actions/cache@v2 - with: - path: | - public - .cache - key: ${{ runner.os }}-gatsby-build-draft-${{ github.head_ref }} - - - name: Fix mtimes - run: yarn fix-mtimes --force - - - name: Gatsby build - run: yarn build - env: - APP_ENV: staging - NODE_ENV: ${{ secrets.NODE_ENV }} - NODE_OPTIONS: --max-old-space-size=4096 - ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_INDEX_NAME: edb-docs-staging - INDEX_ON_BUILD: false - - - name: Deploy to Netlify - id: netlify-deploy - uses: nwtgck/actions-netlify@v1.2.2 - with: - publish-dir: './public' - github-token: ${{ secrets.GITHUB_TOKEN }} - deploy-message: ${{ github.event.pull_request.title }} - enable-commit-comment: false - github-deployment-environment: ${{ env.BUILD_ENV_NAME }} - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} - From 3accf4b8a9aa4dc587d29160457be618bcef70fa Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Mon, 9 Aug 2021 14:05:27 -0700 Subject: [PATCH 30/31] Automerge let me down (removed broken and superfluous code block) Former-commit-id: ecb82fbe9e0b6f2268a97d392bfb026efe83ac9e --- gatsby-node.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 70995caaed6..ec6000a6ded 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -54,23 +54,6 @@ const gitData = (() => { return { branch, sha }; })(); -const currentBranchName = (() => { - // if this build was triggered by a GH action in response to a PR, - // use the head ref (the branch that someone is requesting be merged) - let branch = process.env.GITHUB_HEAD_REF; - // if this process was otherwise triggered by a GH action, use the current branch name - if (!branch) branch = process.env.GITHUB_REF; - // non-GH Action build? Try actually running Git for the name... - if (!branch) { - try { - branch = execSync("git rev-parse --abbrev-ref HEAD").toString(); - } catch {} - } - if (!branch) branch = isProduction ? "main" : "develop"; - - return branch.replace(/^refs\/heads\//, "").replace(/^refs\/tags\//, ""); -})(); - exports.onCreateNode = async ({ node, getNode, actions, loadNodeContent }) => { const { createNodeField } = actions; From a506c637710ddcd0e130f975ec9111d855f9a8c5 Mon Sep 17 00:00:00 2001 From: Rasika03 Date: Tue, 10 Aug 2021 12:50:22 +0530 Subject: [PATCH 31/31] Remove the Database supported versions from Whatsnew section Former-commit-id: cff5eed4da8b7786105ba386b3f8902ff65d46ce --- product_docs/docs/eprs/6.2/01_introduction/01_whats_new.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/product_docs/docs/eprs/6.2/01_introduction/01_whats_new.mdx b/product_docs/docs/eprs/6.2/01_introduction/01_whats_new.mdx index c3e6bcf0b0f..1de1a6c4abe 100644 --- a/product_docs/docs/eprs/6.2/01_introduction/01_whats_new.mdx +++ b/product_docs/docs/eprs/6.2/01_introduction/01_whats_new.mdx @@ -12,4 +12,3 @@ The following features have been added to xDB Replication Server version 6.1 to - The xDB Replication Server CLI `registerkey` command. > - Partitioned tables created using the declarative partitioning feature of PostgreSQL and Advanced Server version 10 and later can now be replicated in a log-based single-master or multi-master replication system. For more information, see [Replicating Postgres Partitioned Tables](../07_common_operations/10_replicating_postgres_partitioned_tables/#replicating_postgres_partitioned_tables). > - In a single-master replication system, removal of a table from a publication that has one or more existing subscriptions is now permitted as long as the table to be removed is not the parent referenced in a foreign key constraint from a child table that is not being removed as well. Previously, no tables from a publication in a single-master replication system could be removed if there are existing subscriptions. For more information, see [Removing Tables from a Publication](../07_common_operations/06_managing_publication/03_updating_pub/#remove_tables_from_pub). -> - Versions 11 and 12 of PostgreSQL and Advanced Server are now supported.