From 179e715f42109f63502feba9d8ff6059729cf18f Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Wed, 18 Oct 2023 16:38:57 +0100 Subject: [PATCH 01/12] Removed 1000 node limit Signed-off-by: Dj Walker-Morgan --- product_docs/docs/pgd/3.7/bdr/overview.mdx | 3 --- product_docs/docs/pgd/4/limitations.mdx | 2 -- product_docs/docs/pgd/5/limitations.mdx | 3 --- 3 files changed, 8 deletions(-) diff --git a/product_docs/docs/pgd/3.7/bdr/overview.mdx b/product_docs/docs/pgd/3.7/bdr/overview.mdx index c9bc7b72d70..3f38c70c0c1 100644 --- a/product_docs/docs/pgd/3.7/bdr/overview.mdx +++ b/product_docs/docs/pgd/3.7/bdr/overview.mdx @@ -106,9 +106,6 @@ but typical usage would be to have 2-3 standbys per master. Standby nodes don't add additional connections to the mesh network so they are not included in the 32 node recommendation. -BDR currently has hard limit of no more than 1000 active nodes as this is the -current maximum Raft connections allowed. - BDR places a limit that at most 10 databases in any one PostgreSQL instance can be BDR nodes across different BDR node groups. However BDR works best if only one BDR database per PostgreSQL instance is used. diff --git a/product_docs/docs/pgd/4/limitations.mdx b/product_docs/docs/pgd/4/limitations.mdx index a4325a1bfe9..2d4c3891313 100644 --- a/product_docs/docs/pgd/4/limitations.mdx +++ b/product_docs/docs/pgd/4/limitations.mdx @@ -9,8 +9,6 @@ This section covers design limitations of BDR, that should be taken into account - BDR can run hundreds of nodes assuming adequate hardware and network. However, for mesh-based deployments, we generally don’t recommend running more than 48 nodes in one cluster. If extra read scalability is needed beyond the 48 node limit, subscriber only nodes can be added without adding connections to the mesh network. -- BDR currently has a hard limit of no more than 1000 active nodes, as this is the current maximum Raft connections allowed. - - BDR places a limit that at most 10 databases in any one PostgreSQL instance can be BDR nodes across different BDR node groups. However, BDR works best if you use only one BDR database per PostgreSQL instance. - The minimum recommended number of nodes in a group is three to provide fault tolerance for BDR's consensus mechanism. With just two nodes, consensus would fail if one of the nodes was unresponsive. Consensus is required for some BDR operations such as distributed sequence generation. For more information about the consensus mechanism used by EDB Postgres Distributed, see [Architectural details](/pgd/4/architectures/#architecture-details). diff --git a/product_docs/docs/pgd/5/limitations.mdx b/product_docs/docs/pgd/5/limitations.mdx index 866f3c6f1f7..2c16b979914 100644 --- a/product_docs/docs/pgd/5/limitations.mdx +++ b/product_docs/docs/pgd/5/limitations.mdx @@ -13,9 +13,6 @@ into account when planning your deployment. limit, you can add subscriber-only nodes without adding connections to the mesh network. -- PGD currently has a hard limit of no more than 1000 active nodes, as this is - the current maximum Raft connections allowed. - - The minimum recommended number of nodes in a group is three to provide fault tolerance for PGD's consensus mechanism. With just two nodes, consensus would fail if one of the nodes were unresponsive. Consensus is required for some PGD From b4b7f96916d967069e0e53dbec5e5b259aee698f Mon Sep 17 00:00:00 2001 From: Josh Heyer Date: Thu, 19 Oct 2023 15:35:46 +0000 Subject: [PATCH 02/12] Fix build warnings - lower-case --- .../1/cloudnative-pg.v1.mdx | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/product_docs/docs/postgres_for_kubernetes/1/cloudnative-pg.v1.mdx b/product_docs/docs/postgres_for_kubernetes/1/cloudnative-pg.v1.mdx index 5adfd4f53a5..6b0c0049c0c 100644 --- a/product_docs/docs/postgres_for_kubernetes/1/cloudnative-pg.v1.mdx +++ b/product_docs/docs/postgres_for_kubernetes/1/cloudnative-pg.v1.mdx @@ -23,15 +23,15 @@ redirects: - - - + + -
FieldDescription
apiVersion [Required]
string
postgresql.k8s.enterprisedb.io/v1
kind [Required]
string
Backup
metadata [Required]
+
apiVersion [Required]
string
postgresql.k8s.enterprisedb.io/v1
kind [Required]
string
Backup
metadata [Required]
meta/v1.ObjectMeta
No description provided.Refer to the Kubernetes API documentation for the fields of the metadata field.
spec [Required]
+
spec [Required]
BackupSpec
@@ -60,15 +60,15 @@ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api- - - - + + -
FieldDescription
apiVersion [Required]
string
postgresql.k8s.enterprisedb.io/v1
kind [Required]
string
Cluster
metadata [Required]
+
apiVersion [Required]
string
postgresql.k8s.enterprisedb.io/v1
kind [Required]
string
Cluster
metadata [Required]
meta/v1.ObjectMeta
No description provided.Refer to the Kubernetes API documentation for the fields of the metadata field.
spec [Required]
+
spec [Required]
ClusterSpec
@@ -97,15 +97,15 @@ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api- - - - + + -
FieldDescription
apiVersion [Required]
string
postgresql.k8s.enterprisedb.io/v1
kind [Required]
string
Pooler
metadata [Required]
+
apiVersion [Required]
string
postgresql.k8s.enterprisedb.io/v1
kind [Required]
string
Pooler
metadata [Required]
meta/v1.ObjectMeta
No description provided.Refer to the Kubernetes API documentation for the fields of the metadata field.
spec [Required]
+
spec [Required]
PoolerSpec
@@ -134,15 +134,15 @@ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api- - - - + + -
FieldDescription
apiVersion [Required]
string
postgresql.k8s.enterprisedb.io/v1
kind [Required]
string
ScheduledBackup
metadata [Required]
+
apiVersion [Required]
string
postgresql.k8s.enterprisedb.io/v1
kind [Required]
string
ScheduledBackup
metadata [Required]
meta/v1.ObjectMeta
No description provided.Refer to the Kubernetes API documentation for the fields of the metadata field.
spec [Required]
+
spec [Required]
ScheduledBackupSpec
@@ -411,14 +411,14 @@ the selected PostgreSQL instance

- -
FieldDescription
name [Required]
+
name [Required]
string

Name is the snapshot resource name

type [Required]
+
type [Required]
string
@@ -496,7 +496,7 @@ errors with certificate issuer and barman-cloud-wal-archive.

- -
FieldDescription
cluster [Required]
+
cluster [Required]
LocalObjectReference
@@ -790,7 +790,7 @@ Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive

destinationPath [Required]
+
destinationPath [Required]
string
@@ -1044,7 +1044,7 @@ a physical backup of an existing PostgreSQL cluster

- - - -
FieldDescription
source [Required]
+
source [Required]
string
@@ -1353,7 +1353,7 @@ https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/

The GID of the postgres user inside the image, defaults to 26

instances [Required]
+
instances [Required]
int
@@ -1532,7 +1532,7 @@ https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information.

ephemeralVolumesSizeLimit [Required]
+
ephemeralVolumesSizeLimit [Required]
EphemeralVolumesSizeLimitConfiguration
@@ -1990,7 +1990,7 @@ the key of a ConfigMap

The name of the secret in the pod's namespace to select from.

key [Required]
+
key [Required]
string
@@ -2094,7 +2094,7 @@ PostgreSQL cluster from an existing storage

-
FieldDescription
storage [Required]
+
storage [Required]
core/v1.TypedLocalObjectReference
@@ -2210,14 +2210,14 @@ storage

- -
FieldDescription
shm [Required]
+
shm [Required]
k8s.io/apimachinery/pkg/api/resource.Quantity

Shm is the size limit of the shared memory volume

temporaryData [Required]
+
temporaryData [Required]
k8s.io/apimachinery/pkg/api/resource.Quantity
@@ -2241,7 +2241,7 @@ external cluster which is used in the other sections of the configuration

-
FieldDescription
name [Required]
+
name [Required]
string
@@ -2341,21 +2341,21 @@ default to false.

- - -
FieldDescription
source [Required]
+
source [Required]
ImportSource

The source of the import

type [Required]
+
type [Required]
SnapshotType

The import type. Can be microservice or monolith.

databases [Required]
+
databases [Required]
[]string
@@ -2402,7 +2402,7 @@ database right after is imported - to be used with extreme care -
FieldDescription
externalCluster [Required]
+
externalCluster [Required]
string
@@ -2455,7 +2455,7 @@ database right after is imported - to be used with extreme care -
FieldDescription
isPrimary [Required]
+
isPrimary [Required]
bool
@@ -2661,7 +2661,7 @@ local object with a known type inside the same namespace

-
FieldDescription
name [Required]
+
name [Required]
string
@@ -3169,7 +3169,7 @@ part for now.

- -
FieldDescription
cluster [Required]
+
cluster [Required]
LocalObjectReference
@@ -3198,7 +3198,7 @@ Pooler name should never match with any cluster name within the same namespace.<

The template of the Pod to be created

pgbouncer [Required]
+
pgbouncer [Required]
PgBouncerSpec
@@ -3485,14 +3485,14 @@ cluster

- -
FieldDescription
source [Required]
+
source [Required]
string

The name of the external cluster which is the replication origin

enabled [Required]
+
enabled [Required]
bool
@@ -3599,7 +3599,7 @@ Reference: https://www.postgresql.org/docs/current/sql-createrole.html

- - - -
FieldDescription
name [Required]
+
name [Required]
string
@@ -3816,7 +3816,7 @@ files to S3. It can be provided in two alternative ways:

If the first backup has to be immediately start after creation or not

schedule [Required]
+
schedule [Required]
string
@@ -3825,7 +3825,7 @@ as it includes an additional seconds specifier, see https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format

cluster [Required]
+
cluster [Required]
LocalObjectReference
@@ -3939,7 +3939,7 @@ the key of a Secret

The name of the secret in the pod's namespace to select from.

key [Required]
+
key [Required]
string
@@ -4082,7 +4082,7 @@ Map keys are the secret names, map values are the versions

- -
FieldDescription
metadata [Required]
+
metadata [Required]
Metadata
@@ -4190,7 +4190,7 @@ if all the labels values match.

A list of node labels values to extract and compare to evaluate if the pods reside in the same topology or not

enabled [Required]
+
enabled [Required]
bool
From d4781fb4a4675cac8479377f186eeae9a6fff740 Mon Sep 17 00:00:00 2001 From: Betsy Gitelman <93718720+ebgitelman@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:27:32 -0400 Subject: [PATCH 03/12] small edits to terminology mostly contractions --- product_docs/docs/pgd/5/terminology.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/product_docs/docs/pgd/5/terminology.mdx b/product_docs/docs/pgd/5/terminology.mdx index 2f62c12b15b..5f0fde74b0d 100644 --- a/product_docs/docs/pgd/5/terminology.mdx +++ b/product_docs/docs/pgd/5/terminology.mdx @@ -116,11 +116,11 @@ A multi-step process for achieving consistency across multiple database nodes. The first phase sees a transaction prepared on an originating node and sent to all participating nodes. Each participating node validates that it can apply the transaction and signals its readiness to the originating node. This is the -prepare phase. In the second phase, if all the participating nodes signal they -are ready, the originating node proceeds to commit the transaction and signals +prepare phase. In the second phase, if all the participating nodes signal they're +ready, the originating node proceeds to commit the transaction and signals the participating nodes to commit, too. This is the commit phase. If, in the -prepare phase, any node signals it is not ready, the entire transaction is -aborted. It's this process that ensures all nodes get the same changes. +prepare phase, any node signals it isn't ready, the entire transaction is +aborted. This process ensures all nodes get the same changes. #### Vertical scaling or scale up From 6540380ef4e5d9ef43ecb6d17b796804f968c123 Mon Sep 17 00:00:00 2001 From: smaher-edb Date: Wed, 25 Oct 2023 11:51:09 +0530 Subject: [PATCH 04/12] BDR-4220 - fix the verbose flag defaults --- product_docs/docs/pgd/4/cli/command_ref/pgd_show-replslots.mdx | 2 +- product_docs/docs/pgd/5/cli/command_ref/pgd_show-replslots.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/product_docs/docs/pgd/4/cli/command_ref/pgd_show-replslots.mdx b/product_docs/docs/pgd/4/cli/command_ref/pgd_show-replslots.mdx index e347ba62c50..6f25ca7d5c7 100644 --- a/product_docs/docs/pgd/4/cli/command_ref/pgd_show-replslots.mdx +++ b/product_docs/docs/pgd/4/cli/command_ref/pgd_show-replslots.mdx @@ -121,7 +121,7 @@ pgd show-replslots [flags] ```text -h, --help help for show-replslots - -v, --verbose verbose output (default true) + -v, --verbose verbose output ``` ### Options inherited from parent commands diff --git a/product_docs/docs/pgd/5/cli/command_ref/pgd_show-replslots.mdx b/product_docs/docs/pgd/5/cli/command_ref/pgd_show-replslots.mdx index e36225ac569..4801ffe3ccb 100644 --- a/product_docs/docs/pgd/5/cli/command_ref/pgd_show-replslots.mdx +++ b/product_docs/docs/pgd/5/cli/command_ref/pgd_show-replslots.mdx @@ -121,7 +121,7 @@ pgd show-replslots [flags] ```text -h, --help help for show-replslots - -v, --verbose verbose output (default true) + -v, --verbose verbose output ``` ### Options inherited from parent commands From 55ebf9b146d24ee95afaca4b09cec48fcc33a368 Mon Sep 17 00:00:00 2001 From: mlewandowski-edb <63003848+mlewandowski-edb@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:38:46 -0400 Subject: [PATCH 05/12] Corrected spelling typo Changed "eitther" to "either" --- .../13_table_filters.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/eprs/7/02_overview/02_replication_concepts_and_definitions/13_table_filters.mdx b/product_docs/docs/eprs/7/02_overview/02_replication_concepts_and_definitions/13_table_filters.mdx index b9608a872f1..68ec672846d 100644 --- a/product_docs/docs/eprs/7/02_overview/02_replication_concepts_and_definitions/13_table_filters.mdx +++ b/product_docs/docs/eprs/7/02_overview/02_replication_concepts_and_definitions/13_table_filters.mdx @@ -65,7 +65,7 @@ $ java -jar edb-repcli.jar -createpub pub -repsvrfile ~/pubsvrfile -pubdbid 1 - -tablesfilterclause "public.dept:lookup_filter:deptno NOT IN (SELECT id FROM public.dept_filter_lookup)" ``` -After you define a set of available table filters, you must enable them only on those subscription tables of eitther: +After you define a set of available table filters, you must enable them only on those subscription tables of either: - A single-master replication system - Primary node tables of a multi-master replication system where filtering is to occur during replication to those particular target tables. From 61ba65dac976e932e9ecd6363bbe4bea8147a8f6 Mon Sep 17 00:00:00 2001 From: mlewandowski-edb <63003848+mlewandowski-edb@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:30:16 -0400 Subject: [PATCH 06/12] Correction of spelling typo Changed "edentifiers" to "identifiers" in link label (quoted_identifiers) page --- .../20_adding_tablefilters_to_publication.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/eprs/7/08_xdb_cli/03_xdb_cli_commands/20_adding_tablefilters_to_publication.mdx b/product_docs/docs/eprs/7/08_xdb_cli/03_xdb_cli_commands/20_adding_tablefilters_to_publication.mdx index 742027dd218..4f1e9d4adf1 100644 --- a/product_docs/docs/eprs/7/08_xdb_cli/03_xdb_cli_commands/20_adding_tablefilters_to_publication.mdx +++ b/product_docs/docs/eprs/7/08_xdb_cli/03_xdb_cli_commands/20_adding_tablefilters_to_publication.mdx @@ -28,7 +28,7 @@ If the filter rule isn't enabled on a target subscription or non-MDN node, then See [Table filters](../../02_overview/02_replication_concepts_and_definitions/13_table_filters/#table_filters) for more information. !!! Note - The schema names and table or view names that you supply as values for the tables or views parameters are case sensitive. Unless quoted identifiers were used to build the database objects, you must enter Oracle names using uppercase letters (for example, `EDB.DEPT`) and EDB Postgres Advanced Server names in lowercase letters (for example `edb.dept`). See [Quoted edentifiers and default case translation](../../10_appendix/03_miscellaneous_xdb_processing_topics/05_quoted_identifiers/#quoted_identifiers) for more information. + The schema names and table or view names that you supply as values for the tables or views parameters are case sensitive. Unless quoted identifiers were used to build the database objects, you must enter Oracle names using uppercase letters (for example, `EDB.DEPT`) and EDB Postgres Advanced Server names in lowercase letters (for example `edb.dept`). See [Quoted identifiers and default case translation](../../10_appendix/03_miscellaneous_xdb_processing_topics/05_quoted_identifiers/#quoted_identifiers) for more information. ## Parameters From 8275d3dd30c674e6805a9d48e036abbae1537daf Mon Sep 17 00:00:00 2001 From: nidhibhammar <59045594+nidhibhammar@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:25:52 +0530 Subject: [PATCH 07/12] Net Connector - 7.0.6.1 Release branch Copied the 7.0.4.1 directory and renamed it to 7.0.6.1. I have also updated the release notes with the 7.0.6.1 version. I have not yet added new content to release notes or any other topic. --- .../7.0.6.1/01_release_notes.mdx | 11 + .../7.0.6.1/02_requirements_overview.mdx | 20 + ...advanced_server_net_connector_overview.mdx | 41 ++ ...ling_and_configuring_the_net_connector.mdx | 268 ++++++++++ .../7.0.6.1/05_using_the_net_connector.mdx | 24 + .../06_opening_a_database_connection.mdx | 278 ++++++++++ .../07_retrieving_database_records.mdx | 102 ++++ .../7.0.6.1/08_parameterized_queries.mdx | 47 ++ .../09_inserting_records_in_a_database.mdx | 47 ++ .../10_deleting_records_in_a_database.mdx | 44 ++ ...red_procedures_in_your_net_application.mdx | 340 ++++++++++++ .../7.0.6.1/12_using_advanced_queueing.mdx | 492 ++++++++++++++++++ ...sing_a_ref_cursor_in_a_net_application.mdx | 104 ++++ .../7.0.6.1/14_using_plugins.mdx | 55 ++ .../7.0.6.1/15_using_object_types.mdx | 181 +++++++ .../7.0.6.1/16_scram_compatibility.mdx | 10 + ..._advanced_server_net_connector_logging.mdx | 82 +++ .../7.0.6.1/18_api_reference.mdx | 13 + .../images/connection_opened_successfully.png | 3 + .../net_connector/7.0.6.1/images/dialog.png | 3 + .../images/dotnet_installation_complete.png | 3 + .../images/dotnet_installation_dialog.png | 3 + .../images/dotnet_installation_wizard.png | 3 + .../7.0.6.1/images/ready_to_install.png | 3 + .../selecting_the_connectors_installer.png | 3 + .../images/starting_stackbuilder_plus.png | 3 + .../docs/net_connector/7.0.6.1/index.mdx | 19 + 27 files changed, 2202 insertions(+) create mode 100644 product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/05_using_the_net_connector.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/06_opening_a_database_connection.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/07_retrieving_database_records.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/08_parameterized_queries.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/09_inserting_records_in_a_database.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/10_deleting_records_in_a_database.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/12_using_advanced_queueing.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/13_using_a_ref_cursor_in_a_net_application.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/15_using_object_types.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/16_scram_compatibility.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/17_advanced_server_net_connector_logging.mdx create mode 100644 product_docs/docs/net_connector/7.0.6.1/18_api_reference.mdx create mode 100755 product_docs/docs/net_connector/7.0.6.1/images/connection_opened_successfully.png create mode 100755 product_docs/docs/net_connector/7.0.6.1/images/dialog.png create mode 100755 product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_complete.png create mode 100755 product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_dialog.png create mode 100755 product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_wizard.png create mode 100755 product_docs/docs/net_connector/7.0.6.1/images/ready_to_install.png create mode 100755 product_docs/docs/net_connector/7.0.6.1/images/selecting_the_connectors_installer.png create mode 100755 product_docs/docs/net_connector/7.0.6.1/images/starting_stackbuilder_plus.png create mode 100644 product_docs/docs/net_connector/7.0.6.1/index.mdx diff --git a/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx b/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx new file mode 100644 index 00000000000..a35d69c1ba6 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx @@ -0,0 +1,11 @@ +--- +title: "Release notes" + +--- +The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. + +New features, enhancements, bug fixes, and other changes in the EDB .NET Connector `7.0.6.1` include: + +| Type | Description | +| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Upstream merge | Merged with community .NET driver version 7.0.6. For more information about the merge updates, see . | diff --git a/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx new file mode 100644 index 00000000000..c3ff057ce23 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx @@ -0,0 +1,20 @@ +--- +title: "Product compatibility" +--- + + + +These are the supported versions and platforms for the EDB .NET Connector. + +The EDB .NET Connector is certified with EDB Postgres Advanced Server version 11 and later. + +The EDB .NET Connector graphical installers are supported on the following Windows platforms: + +64-bit Windows: + +- Windows Server 2019 +- Windows 10 + +32-bit Windows: + +- Windows 10 diff --git a/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx new file mode 100644 index 00000000000..cd151de3e95 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx @@ -0,0 +1,41 @@ +--- +title: "EDB .NET Connector overview" + +--- + + + +EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an EDB Postgres Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to EDB Postgres Advanced Server features. + +The .NET Connector supports the following frameworks: + +- .NET 7.0 +- .NET 6.0 +- .NET 5.0 +- .NET Core 3.1 +- .NET Standard 2.0 and 2.1 + + +## The .NET class hierarchy + +The .NET class hierarchy contains classes that you can use to create objects that control a connection to the EDB Postgres Advanced Server database and manipulate the data stored on the server. The following are a few of the most commonly used object classes. + +`EDBDataSource` + + `EDBDataSource` is the entry point for all the connections made to the database. It's responsible for issuing connections to the server and efficiently managing them. Starting with EDB .NET Connector 7.0.4.1, you no longer need direct instantiation of `EDBConnection`. Instantiate `EDBDataSource` and use the method provided to create commands or execute queries. + +`EDBConnection` + + The `EDBConnection` class represents a connection to EDB Postgres Advanced Server. An `EDBConnection` object contains a `ConnectionString` that tells the .NET client how to connect to an EDB Postgres Advanced Server database. Obtain `EDBConnection` from an `EDBDataSource` instance, and use it directly only in specific scenarios, such as transactions. + +`EDBCommand` + + An `EDBCommand` object contains an SQL command that the client executes against EDB Postgres 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 EDB Postgres 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 EDB Postgres Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an EDB Postgres Advanced Server database. diff --git a/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx new file mode 100644 index 00000000000..6256283cc01 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx @@ -0,0 +1,268 @@ +--- +title: "Installing and configuring the .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. + +1. After downloading the installer, right-click the installer icon, and select **Run As Administrator** from the context menu. When prompted, select an installation language and select **OK** to continue to the Setup window. + + ![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) + +1. Select **Next**. + + ![The Installation dialog box](images/dotnet_installation_dialog.png) + +1. Use the Installation Directory dialog box to specify the directory in which to install the connector. Select **Next**. + + ![The Ready to Install dialog box](images/ready_to_install.png) + +1. To start the installation, on the Ready to Install dialog box, select **Next**. Popups confirm the progress of the installation wizard. + + ![The installation is complete](images/dotnet_installation_complete.png) + +1. When the wizard informs you that it has completed the setup, select **Finish**. + +You can also use StackBuilder Plus to add or update the connector on an existing Advanced Server installation. + +1. To open StackBuilder Plus, from the Windows **Apps** menu, select **StackBuilder Plus**. + + ![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) + +1. When StackBuilder Plus opens, follow the onscreen instructions. + +1. From the Database Drivers node of the tree control, select the **EnterpriseDB.Net Connector** option. + + ![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) + +1. Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. + +## Configuring the .NET Connector + +For information about configuring the .NET Connector in each environment, see: + +- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. +- **.NET 7.0** Instructions for configuring for use with [.NET 7.0](#setup_7_0) +- **.NET 6.0** Instructions for configuring for use with [.NET 6.0](#setup_6_0). +- **.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). +- **.NET EntityFramework Core** Instructions for configuring for use with [.NET EntityFramework Core](#entity_setup). + +### Referencing the library files + + + +To reference library files with Microsoft Visual Studio: + +1. Select the project in the Solution Explorer. +2. Select **Project > Add Reference**. +3. In the Add Reference` dialog box, browse to select the appropriate library files. + +Optionally, you can copy the library files 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`. + +The method you use to include the namespace varies by the type of application you're writing. For example, the following command imports a namespace into an `ASP.NET` page: + +```text + <% import namespace="EnterpriseDB.EDBClient" %> +``` + +To import a namespace into a C# application, use: + +```text + using EnterpriseDB.EDBClient; +``` + +### .NET framework setup + +Each .NET version has specific setup instructions. + + + +#### .NET 7.0 + +For .NET 7.0, the data provider installation path is `C:\Program Files\edb\dotnet\net7.0\`. + +You must add the following dependencies to your project: + +- `EnterpriseDB.EDBClient.dll` + +Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. + + + +#### .NET 6.0 + +For .NET 6.0, the data provider installation path is: + + `C:\Program Files\edb\dotnet\net6.0\` + +You must add the following dependencies to your project: + +- `EnterpriseDB.EDBClient.dll` + +Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing library files. + + + +#### .NET 5.0 + +For .NET 5.0, the data provider installation path is `C:\Program Files\edb\dotnet\net5.0\`. + +You must add the following dependencies to your project: + +- `EnterpriseDB.EDBClient.dll` + +Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. + + + +#### .NET Core 3.1 + +For .NET Core 3.1, the data provider installation path is `C:\Program Files\edb\dotnet\netcoreapp3.1\`. + +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 on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the 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 file `System.Threading.Tasks.Extensions.dll` in your project. + +Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the 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 on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. + + + +#### .NET Entity Framework Core + +To configure the .NET Connector for use with Entity Framework Core, the data provider installation path is either: + +- `C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net7.0` + +- `C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net6.0` + +The following shared library file is required: + +- `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` + +!!! Note + + You can use Entity Framework Core with the `EnterpriseDB.EDBClient.dll` library available in the `net7.0` or `net6.0` subdirectory. + + +See [Referencing the library files](#referencing_the_library_files) for information about referencing the library files. + +The following NuGet packages are required: + +- `Microsoft.EntityFrameworkCore.Design` + +- `Microsoft.EntityFrameworkCore.Relational` + +- `Microsoft.EntityFrameworkCore.Abstractions` + + +For usage information about Entity Framework Core, see the [Microsoft documentation](https://learn.microsoft.com/en-us/ef/core/). + +**Prerequisite** + +To open a command prompt: + +Select **Tools > Command Line > Developer Command Prompt**. + +Install dotnet-ef (using the command prompt), + + `dotnet tool install --global dotnet-ef` + +**Sample project** + +Create a new Console Application based on .NET 7.0 or .NET 6.0.. + +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` + +**Database-first scenario** + +Issue the following command to create model classes corresponding to all objects in the specified database: + +```text +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, and delete operations. + +For further details, see the Microsoft documentation. + +Issue the following commands to create the initial database and tables: + +```text + dotnet ef migrations add InitialCreate --context BloggingContext + + dotnet ef database update --context BloggingContext +``` diff --git a/product_docs/docs/net_connector/7.0.6.1/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.6.1/05_using_the_net_connector.mdx new file mode 100644 index 00000000000..dcdac30a376 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/05_using_the_net_connector.mdx @@ -0,0 +1,24 @@ +--- +title: "Using the .NET Connector" + +--- + + + +These examples show how you can use the EDB object classes that are provided by the EDB .NET Connector that allow a .NET application to connect to and interact with an EDB Postgres Advanced Server database. + +To use these examples, place the .NET library files in the same directory as the compiled form of your application. All of these examples are written in C#, and each is embedded in an ASP.NET page. The same logic and code applies to other .NET applications (WinForm or console applications, for example). + +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 EDB Postgres Advanced Server host. + +```text + + + + + + +``` + +An EDB Postgres Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you're writing an application that doesn't use ASP.NET, provide the connection information in an application configuration file such as `app.config`. diff --git a/product_docs/docs/net_connector/7.0.6.1/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/7.0.6.1/06_opening_a_database_connection.mdx new file mode 100644 index 00000000000..8f5eb142b23 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/06_opening_a_database_connection.mdx @@ -0,0 +1,278 @@ +--- +title: "Opening a database connection" + +--- + + + +An `EDBConnection` object is responsible for handling the communication between an instance of EDB Postgres Advanced Server and a .NET application. Before you can access data stored in an EDB Postgres Advanced Server database, you must create and open an `EDBConnection` object. + +## Creating an EDBConnection object + +You can open a connection using one of the following approaches. In either case, you must import the namespace `EnterpriseDB.EDBClient`. + +### Connection with a data source + +1. Create an instance of the `EDBDataSource` object using a connection string as a parameter to the create method of the `EDBDataSource` class. + +2. Call the `OpenConnection` method of the `EDBDataSource` object to open a connection. + +This example shows how to open a connection using a data source: + + ```text + await using var dataSource = EDBDataSource.Create(ConnectionString); + var connection = dataSource.OpenConnection(); + ``` + +### Connection without a data source + +1. Create an instance of the `EDBConnection` object using a connection string as a parameter to the constructor of the `EDBConnection` class. + +2. Call the `Open` method of the `EDBConnection` object to open the connection. + +This example shows how to open a connection without a data source: + + ```text + EDBConnection conn = new EDBConnection(ConnectionString); + conn.Open(); + ``` + +!!! Note + For `EnterpriseDB.EDBClient 7.0.4` and later, we recommend `EDBDataSource` to connect to EDB Postgres Advanced Server database or execute SQL directly against it. For more information on data source, see the [Npgsql documentation](https://www.npgsql.org/doc/basic-usage.html). + + + + +## Connection string parameters + +A valid connection string specifies location and authentication information for an EDB Postgres 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 EDB Postgres Advanced Server database +- The name of an EDB Postgres Advanced Server user +- The password associated with that user + +You can include the following parameters in the connection string: + +`CommandTimeout` + + `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish executing 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 for the application to connect to. The default is 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` + + Specify a value of `true` to use Windows Integrated Security. By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. + +`Load Role Based Tables` + + Use `Load Role Based Tables` to load table OIDs based on role. This change affects only the loading of table type OID and not the composite type. Setting this parameter to `true` triggers the new functionality. The default value is `false`. + +`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 preallocate the specified number of connections with the server. The default value is `1`. + +`Password` + + When using clear text authentication, specify the password to use to establish a connection with the server. + +`Pooling` + + Specify a value of `false` to disable connection pooling. By default, `Pooling` is set to `true` to enable connection pooling. + +`No Reset On Close` + +When `Pooling` is enabled and the connection is closed, reopened, and the underlying connection is reused, then some operations are executed to discard the previous connection resources. You can override this behavior by enabling `No Reset On Close`. + +`Port` + + The `Port` parameter specifies the port for the application to connect to. + +`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 EDB Postgres Advanced Server host. + +`SSL` + + Specify a value of `true` to attempt a secure connection. By default, `SSL` is set to `false`. + +`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 can't be established. + +- `allow` — Connect without SSL. This parameter isn't supported. + +- `disable` — Don't attempt an SSL connection. This is the default behavior. + +`SyncNotification` + + Use the `SyncNotification` parameter to specify for `EDBDataprovider` to 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 to use for the connection. + +## Example: Opening a database connection using ASP.NET + +This example shows how to open a connection to an instance of EDB Postgres 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. Also see [Connection string parameters](#connection-string-parameters) for connection parameters. + +```cpp +<% @ Page Language="C#" %> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Configuration" %> + +``` + +If the connection is successful, a message appears indicating that the connection opened successfully. + +## Example: Opening a database connection from a console application + +This example opens a connection with an EDB Postgres 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. + +```ini + + + + + + +``` + +Enter the following code sample into a file: + +```csharp +using System; +using System.Data; +using EnterpriseDB.EDBClient; +using System.Configuration; +namespace EnterpriseDB +{ + class EDB + { + static void Main(string[] args) + { + var strConnectionString = ConfigurationManager.AppSettings["DB_CONN_STRING"]; + try + { + await using var dataSource = EDBDataSource.Create(strConnectionString); + var conn = dataSource.OpenConnection(); + Console.WriteLine("Connection Opened Successfully"); + conn.Close(); + } + catch(Exception exp) + { + throw new Exception(exp.ToString()); + } + } + } +} +``` + +Save the file as `EDBConnection-Sample.cs` and compile it with the following command: + +```text +csc /r:EnterpriseDB.EDBClient.dll /out:Console.exe EDBConnection-Sample.cs` +``` + +Compiling the sample generates a `Console.exe` file. You can execute the sample code by entering `Console.exe`. When executed, the console verifies that it opened successfully. + +## Example: Opening a database connection from a Windows form application + +This example opens 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. + +```csharp +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) + { + try + { + var strConnectionString = "Server=localhost;port=5444;username=edb;password=edb;database=edb"; + await using var dataSource = EDBDataSource.Create(strConnectionString); + var conn = dataSource.OpenConnection(); + MessageBox.Show("Connection Opened Successfully"); + conn.Close(); + } + catch(EDBException exp) + { + MessageBox.Show(exp.ToString()); + } + } + } +} +``` + +Change the database connection string to point to the database that you want to connect to. Then compile the file with the following command: + +```text +csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs +``` + +This command generates a `WinForm.exe` file in the same folder that the executable was compiled under. Invoking the executable displays a message that the connection was successful. diff --git a/product_docs/docs/net_connector/7.0.6.1/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/7.0.6.1/07_retrieving_database_records.mdx new file mode 100644 index 00000000000..c8c7cc6fb3a --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/07_retrieving_database_records.mdx @@ -0,0 +1,102 @@ +--- +title: "Retrieving database records" + +--- + + + +You can use a `SELECT` statement to retrieve records from the database using 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 `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 EDB Postgres 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. + +Loop through the contents of the `EDBDataReader` object to display the records returned by the query in a `WHILE` loop. + +The `Read()` method advances to the next record (if there is one) and returns `true` if a record exists. It returns `false` if `EDBDataReader` has reached the end of the result set. + +```cpp +<% @ 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`. Then, to invoke the program, enter the following URL in a browser: `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. + +```cpp +<% @ Page Language="C#" %> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + +``` + +Save the sample code in a file named `selectscalar.aspx` in a web root directory. + +To invoke the sample code, enter the following in a browser: `http://localhost/selectScalar.aspx` + +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 to an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/7.0.6.1/08_parameterized_queries.mdx b/product_docs/docs/net_connector/7.0.6.1/08_parameterized_queries.mdx new file mode 100644 index 00000000000..c6e393c296f --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/08_parameterized_queries.mdx @@ -0,0 +1,47 @@ +--- +title: "Parameterized queries" + +--- + + + +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 when you write your code. For example, the value referenced in a `WHERE` clause can be calculated from user input. + +As shown 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 shows using a parameterized query with an `UPDATE` statement that increases an employee salary: + +```cpp +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + +``` + +Save the sample code in a file named `updateSalary.aspx` in a web root directory. + +To invoke the sample code, enter the following in a browser: `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/7.0.6.1/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/7.0.6.1/09_inserting_records_in_a_database.mdx new file mode 100644 index 00000000000..228224eb3b8 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/09_inserting_records_in_a_database.mdx @@ -0,0 +1,47 @@ +--- +title: "Inserting records in a database" + +--- + + + +You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an EDB Postgres 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 an employee to the `emp` table: + +```cpp +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + +``` + +Save the sample code in a file named `insertEmployee.aspx` in a web root directory. + +To invoke the sample code, enter the following in a browser: `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/7.0.6.1/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/7.0.6.1/10_deleting_records_in_a_database.mdx new file mode 100644 index 00000000000..8c797af0868 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/10_deleting_records_in_a_database.mdx @@ -0,0 +1,44 @@ +--- +title: "Deleting records in a database" + +--- + + + +You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an EDB Postgres 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 specified by `EmpNo` to the `DELETE` command. The command is then executed using the `ExecuteNonQuery()` method. + +```cpp +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + +``` + +Save the sample code in a file named `deleteEmployee.aspx` in a web root directory. + +To invoke the sample code, enter the following in a browser: `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/7.0.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/7.0.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx new file mode 100644 index 00000000000..51a2c02f6f6 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx @@ -0,0 +1,340 @@ +--- +title: "Using SPL stored procedures in your .NET application" + +--- + + + +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 an improvement in performance by using stored procedures. A stored procedure needs to be parsed, compiled, and optimized only once on the server side. A SQL statement that's included in an application might be parsed, compiled, and optimized each time it's executed from a .NET application. + +To use a stored procedure in your .NET application you must: + +1. Create an SPL stored procedure on the EDB Postgres 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 + +This 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 EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: + +```sql +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 EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. + +### Using the EDBCommand object to execute a stored procedure + +The `CommandType` property of the `EDBCommand` object indicates 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: + +```cpp +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + +``` + +Save the sample code in a file named `storedProc.aspx` in a web root directory. + +To invoke the sample code, enter the following in a browser: `http://localhost/storedProc.aspx` + +## Example: Executing a stored procedure with IN parameters + +This example calls a stored procedure that includes `IN` parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: + +```sql +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 EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. + +### Passing input values to a stored procedure + +Calling a stored procedure that contains parameters is 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. + +This example shows the process of executing a parameterized stored procedure from a C# script: + +```cpp +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + +``` + +Save the sample code in a file named `storedProcInParam.aspx` in a web root directory. + +To invoke the sample code, enter the following in a browser: `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. + +```cpp +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 executes, a test record is inserted into the `emp` table, and the values inserted are displayed on the web page. + +## Example: Executing a stored procedure with IN, OUT, and INOUT parameters + +The previous example showed how to pass `IN` parameters to a stored procedure. The following examples show 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, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: + +```sql +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 EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. + +### Receiving output values from a stored procedure + +When retrieving values from `OUT` parameters, you must explicitly specify the direction of those 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 can retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. + +This code shows using the `ExecuteReader` method to retrieve a result set: + +```cpp +<% @ Page Language="C#" Debug="true"%> +<% @Import Namespace="EnterpriseDB.EDBClient" %> +<% @Import Namespace="System.Data" %> +<% @Import Namespace="System.Configuration" %> + +``` + +This code shows using the `ExecuteNonQuery` method to retrieve a result set: + +```cpp +<% @ 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/7.0.6.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/7.0.6.1/12_using_advanced_queueing.mdx new file mode 100644 index 00000000000..80029584880 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/12_using_advanced_queueing.mdx @@ -0,0 +1,492 @@ +--- +title: "Using advanced queueing" + +--- + + + +EDB Postgres Advanced Server advanced queueing provides message queueing and message processing for the EDB Postgres Advanced Server database. User-defined messages are stored in a queue. A collection of queues is stored in a queue table. Create a queue table before creating a queue that depends 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 messages to or remove messages from a queue or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, see [DBMS_AQ](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). + +On the client side, the application uses the EDB.NET driver to enqueue and dequeue messages. + +## Enqueueing or dequeueing a message + +For more information about using EDB Postgres Advanced Server's advanced queueing functionality, see [Built-in packages](/epas/latest/epas_compat_bip_guide/). + +### 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 EDB Postgres Advanced Server host database. Use the following SPL commands at the command line: + +#### Creating a user-defined type + +To specify a RAW data type, create a user-defined type. This example shows 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. This example shows 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 + +This example shows creating a queue named `MSG_QUEUE` in 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've 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 shows using the `queue.Enqueue` method. + +!!! Note + This code creates the message and serializes it. This is example code and doesn't compile if copied as it is. You must 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"; + EDBConnection.GlobalTypeMapper.MapComposite("myxml"); + con.ReloadTypes(); + 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 example code and doesn't compile if copied as it is. You must 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 = (MyXML) deqMsg.Payload; + + 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 | Reads 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 | Set from `EDBAQDequeueMode`. It represents the locking behavior linked with the dequeue option. | +| Navigation | Set from `EDBAQNavigationMode`. It represents the position of the message to fetch. | +| Visibility | Set from `EDBAQVisibility`. It represents whether the new message is dequeued 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's a Boolean expression. | +| Transformation | The transformation to apply 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 | Set from `EDBAQVisibility`. It represents whether the new message is enqueued as part of the current transaction. | +| RelativeMsgid | The relative message identifier. | +| SequenceDeviation | The sequence when to dequeue the message. | +| Transformation | The transformation to apply before enqueuing the message. | +| DeliveryMode | The delivery mode of the enqueued message. | + +### EDBAQMessage + +The `EDBAQMessage` class lists a message to enqueue/dequeue. + +| Property | Description | +| ------------ | -------------------------------- | +| Payload | The actual message to queue. | +| 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 after which the message is available for dequeuing, in seconds. | +| Expiration | The duration for which the message is available for dequeuing, in seconds. | +| Correlation | The correlation identifier. | +| Attempts | The number of attempts taken to dequeue the message. | +| RecipientList | The recipients list that overthrows the default queue subscribers. | +| ExceptionQueue | The name of the queue to move the unprocessed messages to. | +| EnqueueTime | The time when the message was enqueued. | +| State | The state of the message while dequeued. | +| 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 isn't reached. | + +### EDBAQMessageType + +The `EDBAQMessageType` class represents the types for payload. + +| Value | Description | +| --------- | ------------------------------------------------------------------------------------- | +| Raw | The raw message type.

Note: Currently, this payload type isn't supported. | +| UDT | The user-defined type message. | +| XML | The XML type message.

Note: Currently, this payload type isn't 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 use. | +| Name | The name of the queue. | +| MessageType | The message type that's enqueued/dequeued from this queue, for example `EDBAQMessageType.Udt`. | +| UdtTypeName | The user-defined type name of the message type. | +| EnqueueOptions | The enqueue options to use. | +| DequeuOptions | The dequeue options to use. | +| MessageProperties | The message properties to use. | + +### EDBAQVisibility + +The `EDBAQVisibility` class represents the visibility options available. + +| Value | Description | +| --------- | ----------------------------------------------------------- | +| Immediate | The enqueue/dequeue isn't part of the ongoing transaction. | +| On_Commit | The enqueue/dequeue is part of the current transaction. | + +!!! Note +- To review the default options for these parameters, see [DBMS_AQ](../../epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/#pID0E01HG0HA/). + - EDB advanced queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` can't be used with advanced queueing because `NoTypeLoading` doesn't load any user-defined types. diff --git a/product_docs/docs/net_connector/7.0.6.1/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/7.0.6.1/13_using_a_ref_cursor_in_a_net_application.mdx new file mode 100644 index 00000000000..3b77d3f4ba8 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/13_using_a_ref_cursor_in_a_net_application.mdx @@ -0,0 +1,104 @@ +--- +title: "Using a ref cursor in a .NET application" + +--- + + + +A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by executing the `OPEN FOR` statement using the cursor variable. A cursor variable isn't tied to a particular query like a static cursor. You can open the same cursor variable a number of times with the `OPEN FOR` statement containing different queries and each time. A new result set is created for that query and made available by way of the cursor variable. You can declare a cursor variable in two ways: + +- 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 + +This sample code creates a stored procedure called `refcur_inout_callee`. It specifies the data type of the ref cursor being passed as an OUT parameter. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: + +```sql +CREATE OR REPLACE PROCEDURE + refcur_inout_callee(v_refcur OUT SYS_REFCURSOR) +IS +BEGIN + OPEN v_refcur FOR SELECT ename FROM emp; +END; +``` + +This C# code uses the stored procedure to retrieve employee names from the `emp` table: + +```cpp +using System; +using System.Data; +using EnterpriseDB.EDBClient; +using System.Configuration; +namespace EDBRefCursor +{ + class EmpRefcursor + { + [STAThread] + static void Main(string[] args) + { + var strConnectionString = + ConfigurationManager.AppSettings["DB_CONN_STRING"]; + try + { + await using var dataSource = EDBDataSource.Create(ConnectionString); + var conn = await dataSource.OpenConnectionAsync(); + await using var tran = await connection.BeginTransactionAsync(); + using var 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.Output, false, 2, 2, + System.Data.DataRowVersion.Current, null)); + await command.PrepareAsync(); + command.Parameters[0].Value = null; + await command.ExecuteNonQueryAsync(); + var cursorName = command.Parameters[0].Value.ToString(); + command.CommandText = "fetch all in \"" + cursorName + "\""; + command.CommandType = CommandType.Text; + await using var reader = + await command.ExecuteReaderAsync(CommandBehavior.SequentialAccess); + var fc = reader.FieldCount; + while (await reader.ReadAsync()) + { + for (int i = 0; i < fc; i++) + { + Console.WriteLine(reader.GetString(i)); + } + } + await reader.CloseAsync(); + await tran.CommitAsync(); + await conn.CloseAsync(); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message.ToString()); + } + } + } +} +``` + +This .NET code snippet displays the result on the console: + +```cpp +for(int i = 0;i < fc; i++) +{ + Console.WriteLine(reader.GetString(i)); +} +``` + +You must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you're using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx b/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx new file mode 100644 index 00000000000..8f60d1b3f57 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx @@ -0,0 +1,55 @@ +--- +title: "Using plugins" + +--- + + + +EDB .Net driver plugins support the enhanced capabilities for different data types that are otherwise not available in .Net. The different plugins available support: + +- GeoJSON +- Json.NET +- NetTopologySuite +- NodaTime + +The plugins support the use of spatial, data/time, and JSON types. The following are the supported frameworks and data provider installation path for these plugins. + +## GeoJSON + +If you're 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're 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). + +## NetTopologySuite + +If you're 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're 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). diff --git a/product_docs/docs/net_connector/7.0.6.1/15_using_object_types.mdx b/product_docs/docs/net_connector/7.0.6.1/15_using_object_types.mdx new file mode 100644 index 00000000000..c57c5ba4713 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/15_using_object_types.mdx @@ -0,0 +1,181 @@ +--- +title: "Using object types in .NET" + +--- + + + +The SQL `CREATE TYPE` command creates a user-defined object type, which is stored in the EDB Postgres Advanced Server database. You can then reference these user-defined types in SPL procedures, SPL functions, and .NET programs. + +Create the basic object type with the `CREATE TYPE AS OBJECT` command. Optionally, use the `CREATE TYPE BODY` command. + +## Using an object type + +To use an object type, you must first create the object type in the EDB Postgres 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. 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; +``` + +This example is a complete .NET program that uses these user-defined object types: + +```text +using EnterpriseDB.EDBClient; +using System.Data.Common; +namespace TypesTest +{ + internal class Program + { + static async Task Main(string[] args) + { + var connString = "Server=localhost;Port=5444;database=edb;User ID=enterprisedb;password=edb;"; + var dataSourceBuilder = new EDBDataSourceBuilder(connString); + dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); + dataSourceBuilder.MapComposite("enterprisedb.emp_obj_typ"); + await using var dataSource = dataSourceBuilder.Build(); + await using var conn = await dataSource.OpenConnectionAsync(); + try + { + var address = new addr_object_type() + { + street = "123 MAIN STREET", + city = "EDISON", + state = "NJ", + zip = 8817 + }; + var emp = new emp_obj_typ() + { + empno = 9001, + ename = "JONES", + addr = address + }; + await using (var cmd = new EDBCommand("emp_obj_typ.display_emp", conn)) + { + cmd.CommandType = System.Data.CommandType.StoredProcedure; + EDBCommandBuilder.DeriveParameters(cmd); + cmd.Parameters[0].Value = emp; + cmd.Prepare(); + cmd.ExecuteNonQuery(); + var 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 EDB Postgres 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 `EDBDataSourceBuilder.MapComposite` maps the .NET type to the EDB Postgres Advanced Server types: + +```text +dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); +dataSourceBuilder.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); +``` + +Set the value of the parameter 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/7.0.6.1/16_scram_compatibility.mdx b/product_docs/docs/net_connector/7.0.6.1/16_scram_compatibility.mdx new file mode 100644 index 00000000000..feff2da342b --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/16_scram_compatibility.mdx @@ -0,0 +1,10 @@ +--- +title: "Scram compatibility" +legacyRedirects: + - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" + +--- + + + +The EDB .NET driver provides SCRAM-SHA-256 support for EDB Postgres Advanced Server version 10 and later. This support is available from EDB .NET 4.0.2.1 release and later. diff --git a/product_docs/docs/net_connector/7.0.6.1/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/7.0.6.1/17_advanced_server_net_connector_logging.mdx new file mode 100644 index 00000000000..03bd1ed820a --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/17_advanced_server_net_connector_logging.mdx @@ -0,0 +1,82 @@ +--- +title: "EDB .NET Connector logging" + +--- + + + +EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. EDB .NET Connector supports logging using the standard .NET `Microsoft.Extensions.Logging` package. For more information about logging in .Net, see [Logging in C# and .NET](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line). + +!!! Note + For versions earlier than 7.x, EDB .NET Connector had its own, custom logging API. + +## Console logging provider + +.NET logging API works with a variety of built-in and third-party logging providers. The console logging provider logs output to the console. + +### Console logging with EDBDataSource + +Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure an `EDBDataSource` with it. Any use of connections opened through this data source log using this logger factory. + +```text +var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); + +var dataSourceBuilder = new EDBDataSourceBuilder(connectionString); +dataSourceBuilder.UseLoggerFactory(loggerFactory); +await using var dataSource = dataSourceBuilder.Build(); + +await using var connection = await dataSource.OpenConnectionAsync(); +await using var command = new EDBCommand("SELECT 1", connection); +_ = await command.ExecuteScalarAsync(); +``` + +### Console logging without EDBDataSource + +Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure EDB .NET Connector's logger factory globally using `EDBLoggingConfiguration.InitializeLogging`. Configure it at the start of your program, before using any other EDB .NET Connector API. + +```text +var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); +EDBLoggingConfiguration.InitializeLogging(loggerFactory); + +await using var conn = new EDBConnection(connectionString); +await conn.OpenAsync(); +await using var command = new EDBCommand("SELECT 1", conn); +_ = await command.ExecuteScalarAsync(); +``` + +## Log levels + +The following log levels are available: + +- Trace +- Debug +- Information +- Warning +- Error +- Fatal + +This example shows how to change the log level to `Trace`: + +```text +var loggerFactory = LoggerFactory.Create(builder => builder +.SetMinimumLevel(LogLevel.Trace +.AddSimpleConsole() +); +``` + +## Formatting the log output + +This example shows how to format your log output. Create a `LoggerFactory` to restrict each log message to a single line and add a date time to the log: + +```text +var loggerFactory = LoggerFactory.Create(builder => +builder +.SetMinimumLevel(LogLevel.Trace) +.AddSimpleConsole( + options => + { + options.SingleLine = true; + options.TimestampFormat = "yyyy/MM/dd HH:mm:ss "; + } + )); +``` \ No newline at end of file diff --git a/product_docs/docs/net_connector/7.0.6.1/18_api_reference.mdx b/product_docs/docs/net_connector/7.0.6.1/18_api_reference.mdx new file mode 100644 index 00000000000..53050c37952 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/18_api_reference.mdx @@ -0,0 +1,13 @@ +--- +title: "API reference" + +--- + + + +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/7.0.6.1/images/connection_opened_successfully.png b/product_docs/docs/net_connector/7.0.6.1/images/connection_opened_successfully.png new file mode 100755 index 00000000000..bab12126d20 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.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/7.0.6.1/images/dialog.png b/product_docs/docs/net_connector/7.0.6.1/images/dialog.png new file mode 100755 index 00000000000..19cba54d1f9 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.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/7.0.6.1/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_complete.png new file mode 100755 index 00000000000..332ae795899 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.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/7.0.6.1/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_dialog.png new file mode 100755 index 00000000000..b465d536032 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.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/7.0.6.1/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_wizard.png new file mode 100755 index 00000000000..29c9a7f99f9 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.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/7.0.6.1/images/ready_to_install.png b/product_docs/docs/net_connector/7.0.6.1/images/ready_to_install.png new file mode 100755 index 00000000000..59e44d96bc5 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.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/7.0.6.1/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/7.0.6.1/images/selecting_the_connectors_installer.png new file mode 100755 index 00000000000..432e4473c09 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.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/7.0.6.1/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/7.0.6.1/images/starting_stackbuilder_plus.png new file mode 100755 index 00000000000..11665300652 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.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/7.0.6.1/index.mdx b/product_docs/docs/net_connector/7.0.6.1/index.mdx new file mode 100644 index 00000000000..fdcdfafff77 --- /dev/null +++ b/product_docs/docs/net_connector/7.0.6.1/index.mdx @@ -0,0 +1,19 @@ +--- +title: "EDB .NET Connector" +directoryDefaults: + description: "EDB .NET Connector version 7.0.6.1 documentation and release notes." +--- + +The EDB .NET Connector distributed with EDB Postgres Advanced Server provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. You can: + +- Connect to an instance of EDB Postgres Advanced Server. +- Retrieve information from an EDB Postgres Advanced Server database. +- Update information stored on an EDB Postgres Advanced Server database. + +To understand these examples, you need a solid working knowledge of C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. For details, see the [Npgsql User Guide](http://www.npgsql.org/doc/index.html). + +
+ +release_notes 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 3befb8767ab849e4b5e763a56a35bcb3e3d11b53 Mon Sep 17 00:00:00 2001 From: nidhibhammar <59045594+nidhibhammar@users.noreply.github.com> Date: Tue, 17 Oct 2023 14:00:29 +0530 Subject: [PATCH 08/12] first round of updating the content as per the inputs --- .../docs/net_connector/7.0.6.1/02_requirements_overview.mdx | 6 +++--- .../03_the_advanced_server_net_connector_overview.mdx | 3 +-- .../04_installing_and_configuring_the_net_connector.mdx | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx index c3ff057ce23..cf5341bec5b 100644 --- a/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx @@ -12,9 +12,9 @@ The EDB .NET Connector graphical installers are supported on the following Windo 64-bit Windows: -- Windows Server 2019 -- Windows 10 +- Windows Server 2019 and 2022 +- Windows 10 and 11 32-bit Windows: -- Windows 10 +- Windows 10 and 11 diff --git a/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx index cd151de3e95..660a94173a2 100644 --- a/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx @@ -11,8 +11,7 @@ The .NET Connector supports the following frameworks: - .NET 7.0 - .NET 6.0 -- .NET 5.0 -- .NET Core 3.1 +- .NET Framework 4.7.2, 4.8, and 4.8.1 - .NET Standard 2.0 and 2.1 diff --git a/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx index 6256283cc01..a293f802374 100644 --- a/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx @@ -48,8 +48,9 @@ For information about configuring the .NET Connector in each environment, see: - **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. - **.NET 7.0** Instructions for configuring for use with [.NET 7.0](#setup_7_0) - **.NET 6.0** Instructions for configuring for use with [.NET 6.0](#setup_6_0). -- **.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 Framework 4.7.2** Instructions for configuring for use with [.NET framework 4.7.2](#). +- **.NET Framework 4.8** Instructions for configuring for use with [.NET Framework 4.8](#). +- **.NET Framework 4.8.1** Instructions for configuring for use with [.NET Framework 4.8.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). From 270acb9eca2f27de5ae2c7b7475036900f7da35a Mon Sep 17 00:00:00 2001 From: nidhibhammar <59045594+nidhibhammar@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:02:52 +0530 Subject: [PATCH 09/12] Edited more content --- ...ling_and_configuring_the_net_connector.mdx | 32 +++++++++---------- .../7.0.6.1/14_using_plugins.mdx | 24 +++++++++++--- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx index a293f802374..4f7b6a9edfd 100644 --- a/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx @@ -113,37 +113,35 @@ Depending on your application type, you might need to import the namespace into -#### .NET 5.0 +#### .NET Framework 4.7.2 -For .NET 5.0, the data provider installation path is `C:\Program Files\edb\dotnet\net5.0\`. +For .NET Framework 4.7.2, the data provider installation path is C:\Program Files\edb\dotnet\net472\. -You must add the following dependencies to your project: +You must add the following dependency to your project. You may also need to add other dependencies from the same directory: -- `EnterpriseDB.EDBClient.dll` +EnterpriseDB.EDBClient.dll -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. +Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. - +#### .NET Framework 4.8 -#### .NET Core 3.1 +For .NET Framework 4.8, the data provider installation path is C:\Program Files\edb\dotnet\net48\. -For .NET Core 3.1, the data provider installation path is `C:\Program Files\edb\dotnet\netcoreapp3.1\`. +You must add the following dependency to your project. You may also need to add other dependencies from the same directory: -The following shared library files are required: +EnterpriseDB.EDBClient.dll -- `EnterpriseDB.EDBClient.dll` - -- `System.Threading.Tasks.Extensions.dll` +Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. -- `System.Runtime.CompilerServices.Unsafe.dll` +#### .NET Framework 4.8.1 -- `System.ValueTuple.dll` +For .NET Framework 4.8.1, the data provider installation path is C:\Program Files\edb\dotnet\net481\. -- `System.Memory.dll` +You must add the following dependency to your project. You may also need to add other dependencies from the same directory: -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. +EnterpriseDB.EDBClient.dll - +Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. #### .NET Standard 2.0 diff --git a/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx b/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx index 8f60d1b3f57..b723b3b0d87 100644 --- a/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx @@ -16,7 +16,11 @@ The plugins support the use of spatial, data/time, and JSON types. The following ## GeoJSON -If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path is `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0`. +If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path are: +`C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` +`C:\Program Files\edb\dotnet\plugins\GeoJSON\net472` +`C:\Program Files\edb\dotnet\plugins\GeoJSON\net48` +`C:\Program Files\edb\dotnet\plugins\GeoJSON\net481` The following shared library files are required: @@ -26,7 +30,11 @@ For detailed information about using the GeoJSON plugin, see the [Npgsql documen ## Json.NET -If you're 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`. +If you're using the Json.NET plugin on .NET Standard 2.0, the data provider installation path are: +`C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` +`C:\Program Files\edb\dotnet\plugins\Json.NET\net472` +`C:\Program Files\edb\dotnet\plugins\Json.NET\net48` +`C:\Program Files\edb\dotnet\plugins\Json.NET\net481` The following shared library files are required: @@ -36,7 +44,11 @@ For detailed information about using the Json.NET plugin, see the [Npgsql docume ## NetTopologySuite -If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path is `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0`. +If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path are: +`C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` +`C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net472` +`C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net48` +`C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net481` The following shared library files are required: @@ -46,7 +58,11 @@ For detailed information about using the NetTopologySuite type plugin, see the [ ## NodaTime -If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation path is `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0`. +If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation path are: +`C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` +`C:\Program Files\edb\dotnet\plugins\NodaTime\net472` +`C:\Program Files\edb\dotnet\plugins\NodaTime\net48` +`C:\Program Files\edb\dotnet\plugins\NodaTime\net481` The following shared library files are required: From b84b71ad0ed1dc357f8aecb76f5e0cdf71a6e137 Mon Sep 17 00:00:00 2001 From: nidhibhammar <59045594+nidhibhammar@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:18:56 +0530 Subject: [PATCH 10/12] Edits done as per feedback from Moazzum --- .../7.0.6.1/01_release_notes.mdx | 15 +++++-- .../7.0.6.1/02_requirements_overview.mdx | 2 +- ...ling_and_configuring_the_net_connector.mdx | 35 +++++++++------- .../7.0.6.1/14_using_plugins.mdx | 41 ++++++++++--------- 4 files changed, 54 insertions(+), 39 deletions(-) diff --git a/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx b/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx index a35d69c1ba6..8b039c726e9 100644 --- a/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx @@ -1,11 +1,18 @@ --- title: "Release notes" - --- + +Released: 20 Oct 2023 + The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. New features, enhancements, bug fixes, and other changes in the EDB .NET Connector `7.0.6.1` include: -| Type | Description | -| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Upstream merge | Merged with community .NET driver version 7.0.6. For more information about the merge updates, see . | +!!! Note Deprecation +This release removes support for .NET 5 and .NET Core 3.1. +!!! + +| Type | Description | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Upstream merge | Merged with community .NET driver version 7.0.6. For more information about the merge updates, see [community release notes](https://www.npgsql.org/doc/release-notes/7.0.html). | +| Enhancement | Added support for .NET 4.7.2, .NET 4.8, .NET 4.8.1 | diff --git a/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx index cf5341bec5b..fbd750391e3 100644 --- a/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx @@ -17,4 +17,4 @@ The EDB .NET Connector graphical installers are supported on the following Windo 32-bit Windows: -- Windows 10 and 11 +- Windows 10 diff --git a/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx index 4f7b6a9edfd..f7c68f4644a 100644 --- a/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx @@ -48,10 +48,10 @@ For information about configuring the .NET Connector in each environment, see: - **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. - **.NET 7.0** Instructions for configuring for use with [.NET 7.0](#setup_7_0) - **.NET 6.0** Instructions for configuring for use with [.NET 6.0](#setup_6_0). -- **.NET Framework 4.7.2** Instructions for configuring for use with [.NET framework 4.7.2](#). -- **.NET Framework 4.8** Instructions for configuring for use with [.NET Framework 4.8](#). -- **.NET Framework 4.8.1** Instructions for configuring for use with [.NET Framework 4.8.1](#). -- **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). +- **.NET Framework 4.7.2** Instructions for configuring for use with [.NET framework 4.7.2](#net-framework-472). +- **.NET Framework 4.8** Instructions for configuring for use with [.NET Framework 4.8](#net-framework-48). +- **.NET Framework 4.8.1** Instructions for configuring for use with [.NET Framework 4.8.1](#net-framework-481). +- **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2_0). - **.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). @@ -115,37 +115,47 @@ Depending on your application type, you might need to import the namespace into #### .NET Framework 4.7.2 -For .NET Framework 4.7.2, the data provider installation path is C:\Program Files\edb\dotnet\net472\. +For .NET Framework 4.7.2, the data provider installation path is: + + `C:\Program Files\edb\dotnet\net472\`. You must add the following dependency to your project. You may also need to add other dependencies from the same directory: -EnterpriseDB.EDBClient.dll +- `EnterpriseDB.EDBClient.dll` Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. #### .NET Framework 4.8 -For .NET Framework 4.8, the data provider installation path is C:\Program Files\edb\dotnet\net48\. +For .NET Framework 4.8, the data provider installation path is: + + `C:\Program Files\edb\dotnet\net48\`. You must add the following dependency to your project. You may also need to add other dependencies from the same directory: -EnterpriseDB.EDBClient.dll +- `EnterpriseDB.EDBClient.dll` Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. #### .NET Framework 4.8.1 -For .NET Framework 4.8.1, the data provider installation path is C:\Program Files\edb\dotnet\net481\. +For .NET Framework 4.8.1, the data provider installation path is: + + `C:\Program Files\edb\dotnet\net481\`. You must add the following dependency to your project. You may also need to add other dependencies from the same directory: -EnterpriseDB.EDBClient.dll +- `EnterpriseDB.EDBClient.dll` Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the 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\`. +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: @@ -157,9 +167,6 @@ You must add the following dependencies to your project: - `System.ValueTuple.dll` -!!! Note - If your target framework is .Net Core 2.0, then include the file `System.Threading.Tasks.Extensions.dll` in your project. - Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. diff --git a/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx b/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx index b723b3b0d87..9e8a3b1389e 100644 --- a/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx @@ -16,11 +16,12 @@ The plugins support the use of spatial, data/time, and JSON types. The following ## GeoJSON -If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path are: -`C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` -`C:\Program Files\edb\dotnet\plugins\GeoJSON\net472` -`C:\Program Files\edb\dotnet\plugins\GeoJSON\net48` -`C:\Program Files\edb\dotnet\plugins\GeoJSON\net481` +If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation paths are: + +- `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` +- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net472` +- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net48` +- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net481` The following shared library files are required: @@ -30,11 +31,11 @@ For detailed information about using the GeoJSON plugin, see the [Npgsql documen ## Json.NET -If you're using the Json.NET plugin on .NET Standard 2.0, the data provider installation path are: -`C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` -`C:\Program Files\edb\dotnet\plugins\Json.NET\net472` -`C:\Program Files\edb\dotnet\plugins\Json.NET\net48` -`C:\Program Files\edb\dotnet\plugins\Json.NET\net481` +If you're using the Json.NET plugin on .NET Standard 2.0, the data provider installation paths are: +- `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` +- `C:\Program Files\edb\dotnet\plugins\Json.NET\net472` +- `C:\Program Files\edb\dotnet\plugins\Json.NET\net48` +- `C:\Program Files\edb\dotnet\plugins\Json.NET\net481` The following shared library files are required: @@ -44,11 +45,11 @@ For detailed information about using the Json.NET plugin, see the [Npgsql docume ## NetTopologySuite -If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path are: -`C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` -`C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net472` -`C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net48` -`C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net481` +If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation paths are: +- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` +- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net472` +- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net48` +- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net481` The following shared library files are required: @@ -58,11 +59,11 @@ For detailed information about using the NetTopologySuite type plugin, see the [ ## NodaTime -If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation path are: -`C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` -`C:\Program Files\edb\dotnet\plugins\NodaTime\net472` -`C:\Program Files\edb\dotnet\plugins\NodaTime\net48` -`C:\Program Files\edb\dotnet\plugins\NodaTime\net481` +If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation paths are: +- `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` +- `C:\Program Files\edb\dotnet\plugins\NodaTime\net472` +- `C:\Program Files\edb\dotnet\plugins\NodaTime\net48` +- `C:\Program Files\edb\dotnet\plugins\NodaTime\net481` The following shared library files are required: From f52b3e794fa340151677f2837e25e5e7fd8f9f66 Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan <126472455+djw-m@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:37:51 +0100 Subject: [PATCH 11/12] Update product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx --- product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx b/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx index 8b039c726e9..30cbf66a4da 100644 --- a/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx +++ b/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx @@ -2,7 +2,7 @@ title: "Release notes" --- -Released: 20 Oct 2023 +Released: 25 Oct 2023 The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. From 8ee3e84893edb3248ad624af9722f88b020baf8f Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Mon, 23 Oct 2023 09:02:52 +0100 Subject: [PATCH 12/12] Removed defunct shared entry in reference Signed-off-by: Dj Walker-Morgan --- product_docs/docs/tpa/23/reference/platform-shared.mdx | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 product_docs/docs/tpa/23/reference/platform-shared.mdx diff --git a/product_docs/docs/tpa/23/reference/platform-shared.mdx b/product_docs/docs/tpa/23/reference/platform-shared.mdx deleted file mode 100644 index e1cf0fcd363..00000000000 --- a/product_docs/docs/tpa/23/reference/platform-shared.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Shared instances -originalFilePath: platform-shared.md - ----