Repository: edgexfoundry/edgex-go
Pull request #5141 (2025-05-02 19:25:24)

build(deps): Bump github.com/pebbe/zmq4 from 1.3.1 to 1.4.0
Bumps [github.com/pebbe/zmq4](https://github.com/pebbe/zmq4) from 1.3.1 to 1.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/pebbe/zmq4/releases">github.com/pebbe/zmq4's releases</a>.</em></p>
<blockquote>
<h2>v1.4.0</h2>
<p>support draft APIs ZMQ_HELLO_MSG, ZMQ_DISCONNECT_MSG and ZMQ_HICCUP_MSG</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/pebbe/zmq4/commit/8fc50510ccb572d491070d306b0d2ae4217c7808"><code>8fc5051</code></a> Merge pull request <a href="https://redirect.github.com/pebbe/zmq4/issues/211">#211</a> from simeyc/add-draft-apis</li>
<li><a href="https://github.com/pebbe/zmq4/commit/a48e3bae6af12bd804c33920c465c85daba91d3d"><code>a48e3ba</code></a> feat: add support for ZMQ_HELLO_MSG, ZMQ_DISCONNECT_MSG and ZMQ_HICCUP_MSG dr...</li>
<li>See full diff in <a href="https://github.com/pebbe/zmq4/compare/v1.3.1...v1.4.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/pebbe/zmq4&package-manager=go_modules&previous-version=1.3.1&new-version=1.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has been open for over 30 days.


sonarqubecloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=edgexfoundry_edgex-go&pullRequest=5141) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=edgexfoundry_edgex-go&pullRequest=5141&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=edgexfoundry_edgex-go&pullRequest=5141&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=edgexfoundry_edgex-go&pullRequest=5141&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=edgexfoundry_edgex-go&pullRequest=5141&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=edgexfoundry_edgex-go&pullRequest=5141&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=edgexfoundry_edgex-go&pullRequest=5141)


codecov-commenter: ## [Codecov](https://app.codecov.io/gh/edgexfoundry/edgex-go/pull/5141?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=edgexfoundry) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 26.61%. Comparing base [(`26b8ade`)](https://app.codecov.io/gh/edgexfoundry/edgex-go/commit/26b8ade39d6960e083940754aaa7dd0dccb12bed?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=edgexfoundry) to head [(`697161f`)](https://app.codecov.io/gh/edgexfoundry/edgex-go/commit/697161fb832e68537a3bd0af5ab1d39dadec64de?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=edgexfoundry).

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##             main    #5141   +/-   ##
=======================================
  Coverage   26.61%   26.61%           
=======================================
  Files         277      277           
  Lines       19933    19933           
=======================================
  Hits         5305     5305           
  Misses      13375    13375           
  Partials     1253     1253           
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/edgexfoundry/edgex-go/pull/5141?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=edgexfoundry).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=edgexfoundry).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
sonarqubecloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=edgexfoundry_edgex-go&pullRequest=5141) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=edgexfoundry_edgex-go&pullRequest=5141&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=edgexfoundry_edgex-go&pullRequest=5141&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=edgexfoundry_edgex-go&pullRequest=5141&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=edgexfoundry_edgex-go&pullRequest=5141&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=edgexfoundry_edgex-go&pullRequest=5141&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=edgexfoundry_edgex-go&pullRequest=5141)



Patch:
diff --git a/cmd/core-common-config-bootstrapper/res/configuration.yaml b/cmd/core-common-config-bootstrapper/res/configuration.yaml
index de1ae7cf..3f873734 100644
--- a/cmd/core-common-config-bootstrapper/res/configuration.yaml
+++ b/cmd/core-common-config-bootstrapper/res/configuration.yaml
@@ -141,3 +141,6 @@ device-services:
     Discovery:
       Enabled: false
       Interval: "0s"
+    AutoEvents:
+      # If set to true, only updated readings compared to the previous event are included in the generated auto event
+      SendChangedReadingsOnly: false
diff --git a/go.mod b/go.mod
index a731cd09..c2125689 100644
--- a/go.mod
+++ b/go.mod
@@ -1,29 +1,29 @@
 module github.com/edgexfoundry/edgex-go
 
-go 1.23.0
+go 1.23.7
 
 require (
 	github.com/blang/semver/v4 v4.0.0
 	github.com/eclipse/paho.mqtt.golang v1.5.0
-	github.com/edgexfoundry/go-mod-bootstrap/v4 v4.1.0-dev.6
-	github.com/edgexfoundry/go-mod-configuration/v4 v4.1.0-dev.2
-	github.com/edgexfoundry/go-mod-core-contracts/v4 v4.1.0-dev.1
-	github.com/edgexfoundry/go-mod-messaging/v4 v4.1.0-dev.3
-	github.com/edgexfoundry/go-mod-secrets/v4 v4.1.0-dev.1
+	github.com/edgexfoundry/go-mod-bootstrap/v4 v4.1.0-dev.18
+	github.com/edgexfoundry/go-mod-configuration/v4 v4.1.0-dev.9
+	github.com/edgexfoundry/go-mod-core-contracts/v4 v4.1.0-dev.6
+	github.com/edgexfoundry/go-mod-messaging/v4 v4.1.0-dev.10
+	github.com/edgexfoundry/go-mod-secrets/v4 v4.1.0-dev.3
 	github.com/fxamacker/cbor/v2 v2.8.0
-	github.com/go-co-op/gocron/v2 v2.16.1
+	github.com/go-co-op/gocron/v2 v2.16.2
 	github.com/gomodule/redigo v1.9.2
 	github.com/google/uuid v1.6.0
 	github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438
 	github.com/jackc/pgx/v5 v5.7.5
 	github.com/labstack/echo/v4 v4.13.4
-	github.com/pebbe/zmq4 v1.3.1
+	github.com/pebbe/zmq4 v1.4.0
 	github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
 	github.com/robfig/cron/v3 v3.0.1
-	github.com/spf13/cast v1.8.0
+	github.com/spf13/cast v1.9.2
 	github.com/spiffe/go-spiffe/v2 v2.5.0
 	github.com/stretchr/testify v1.10.0
-	golang.org/x/crypto v0.38.0
+	golang.org/x/crypto v0.40.0
 	gopkg.in/yaml.v3 v3.0.1
 )
 
@@ -32,7 +32,8 @@ require (
 	github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
 	github.com/cenkalti/backoff/v4 v4.3.0 // indirect
 	github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
-	github.com/edgexfoundry/go-mod-registry/v4 v4.1.0-dev.1 // indirect
+	github.com/edgexfoundry/go-mod-registry/v4 v4.1.0-dev.3 // indirect
+	github.com/emirpasic/gods v1.18.1 // indirect
 	github.com/fsnotify/fsnotify v1.8.0 // indirect
 	github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa // indirect
 	github.com/gabriel-vasile/mimetype v1.4.8 // indirect
@@ -54,11 +55,10 @@ require (
 	github.com/go-openapi/validate v0.24.0 // indirect
 	github.com/go-playground/locales v0.14.1 // indirect
 	github.com/go-playground/universal-translator v0.18.1 // indirect
-	github.com/go-playground/validator/v10 v10.25.0 // indirect
+	github.com/go-playground/validator/v10 v10.26.0 // indirect
 	github.com/go-resty/resty/v2 v2.16.5 // indirect
 	github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
 	github.com/gorilla/mux v1.8.1 // indirect
-	github.com/gorilla/schema v1.4.1 // indirect
 	github.com/gorilla/securecookie v1.1.2 // indirect
 	github.com/gorilla/websocket v1.5.3 // indirect
 	github.com/hashicorp/errwrap v1.1.0 // indirect
@@ -84,19 +84,19 @@ require (
 	github.com/mitchellh/mapstructure v1.5.0 // indirect
 	github.com/mitchellh/reflectwalk v1.0.2 // indirect
 	github.com/muhlemmer/gu v0.3.1 // indirect
-	github.com/nats-io/nats.go v1.40.1 // indirect
-	github.com/nats-io/nkeys v0.4.9 // indirect
+	github.com/nats-io/nats.go v1.42.0 // indirect
+	github.com/nats-io/nkeys v0.4.11 // indirect
 	github.com/nats-io/nuid v1.0.1 // indirect
 	github.com/oklog/ulid v1.3.1 // indirect
 	github.com/opentracing/opentracing-go v1.2.0 // indirect
-	github.com/openziti/channel/v3 v3.0.39 // indirect
-	github.com/openziti/edge-api v0.26.42 // indirect
-	github.com/openziti/foundation/v2 v2.0.59 // indirect
-	github.com/openziti/identity v1.0.100 // indirect
-	github.com/openziti/metrics v1.3.0 // indirect
-	github.com/openziti/sdk-golang v0.25.1 // indirect
-	github.com/openziti/secretstream v0.1.32 // indirect
-	github.com/openziti/transport/v2 v2.0.167 // indirect
+	github.com/openziti/channel/v4 v4.2.0 // indirect
+	github.com/openziti/edge-api v0.26.45 // indirect
+	github.com/openziti/foundation/v2 v2.0.63 // indirect
+	github.com/openziti/identity v1.0.101 // indirect
+	github.com/openziti/metrics v1.4.1 // indirect
+	github.com/openziti/sdk-golang v1.1.2 // indirect
+	github.com/openziti/secretstream v0.1.34 // indirect
+	github.com/openziti/transport/v2 v2.0.171 // indirect
 	github.com/orcaman/concurrent-map/v2 v2.0.1 // indirect
 	github.com/parallaxsecond/parsec-client-go v0.0.0-20221025095442-f0a77d263cf9 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
@@ -114,23 +114,23 @@ require (
 	github.com/x448/float16 v0.8.4 // indirect
 	github.com/yusufpapurcu/wmi v1.2.4 // indirect
 	github.com/zeebo/errs v1.4.0 // indirect
-	github.com/zitadel/oidc/v2 v2.12.2 // indirect
+	github.com/zitadel/logging v0.6.2 // indirect
+	github.com/zitadel/oidc/v3 v3.39.0 // indirect
+	github.com/zitadel/schema v1.3.1 // indirect
 	go.mongodb.org/mongo-driver v1.17.0 // indirect
 	go.mozilla.org/pkcs7 v0.9.0 // indirect
 	go.opentelemetry.io/otel v1.32.0 // indirect
 	go.opentelemetry.io/otel/metric v1.32.0 // indirect
 	go.opentelemetry.io/otel/trace v1.32.0 // indirect
-	golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect
-	golang.org/x/net v0.40.0 // indirect
-	golang.org/x/oauth2 v0.28.0 // indirect
-	golang.org/x/sync v0.14.0 // indirect
-	golang.org/x/sys v0.33.0 // indirect
-	golang.org/x/term v0.32.0 // indirect
-	golang.org/x/text v0.25.0 // indirect
+	golang.org/x/net v0.41.0 // indirect
+	golang.org/x/oauth2 v0.30.0 // indirect
+	golang.org/x/sync v0.16.0 // indirect
+	golang.org/x/sys v0.34.0 // indirect
+	golang.org/x/term v0.33.0 // indirect
+	golang.org/x/text v0.27.0 // indirect
 	golang.org/x/time v0.11.0 // indirect
 	google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
 	google.golang.org/grpc v1.70.0 // indirect
 	google.golang.org/protobuf v1.36.6 // indirect
-	gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
 	nhooyr.io/websocket v1.8.17 // indirect
 )
diff --git a/go.sum b/go.sum
index fcffec6a..fdcd215b 100644
--- a/go.sum
+++ b/go.sum
@@ -51,6 +51,8 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB
 github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
 github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
 github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
+github.com/bmatcuk/doublestar/v4 v4.8.1 h1:54Bopc5c2cAvhLRAzqOGCYHYyhcDHsFF4wWIR5wKP38=
+github.com/bmatcuk/doublestar/v4 v4.8.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
 github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
 github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -70,18 +72,18 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/eclipse/paho.mqtt.golang v1.5.0 h1:EH+bUVJNgttidWFkLLVKaQPGmkTUfQQqjOsyvMGvD6o=
 github.com/eclipse/paho.mqtt.golang v1.5.0/go.mod h1:du/2qNQVqJf/Sqs4MEL77kR8QTqANF7XU7Fk0aOTAgk=
-github.com/edgexfoundry/go-mod-bootstrap/v4 v4.1.0-dev.6 h1:adNPhd8wIyfN/jLCgaoDnfrEMpjgrrjif2J1d5NxQWM=
-github.com/edgexfoundry/go-mod-bootstrap/v4 v4.1.0-dev.6/go.mod h1:OBGpsKabCFZL8FIP6l4YMsdmB1fCQyGoxVV+iozHSBw=
-github.com/edgexfoundry/go-mod-configuration/v4 v4.1.0-dev.2 h1:AzyibDJVdAVgkBUco62E6jgQvyVJVrfrMRiKVaaAbhU=
-github.com/edgexfoundry/go-mod-configuration/v4 v4.1.0-dev.2/go.mod h1:p7W/+dSctTVxtfM+QwGbWEPtKruOuap6zQSqIdjaABg=
-github.com/edgexfoundry/go-mod-core-contracts/v4 v4.1.0-dev.1 h1:ORBHI70qCQPrPQkYVQyeCcZrMdopbUVfHArRAEDATHE=
-github.com/edgexfoundry/go-mod-core-contracts/v4 v4.1.0-dev.1/go.mod h1:wFvtcD3x4oQ+cXzj9mBv/HXF0anogayx6ITuo8BNyo8=
-github.com/edgexfoundry/go-mod-messaging/v4 v4.1.0-dev.3 h1:7k/HzmIuCO59JW+D+h+t9uUNXpProN1AdCgCSdg9U20=
-github.com/edgexfoundry/go-mod-messaging/v4 v4.1.0-dev.3/go.mod h1:ZGVUon+Egw8KKhykUuLsS+FAWZhSytnlQllVc/p7eZw=
-github.com/edgexfoundry/go-mod-registry/v4 v4.1.0-dev.1 h1:AE5zVRU4OccopY75/llB/N5k7qbzu5Qp0cgu5h5QHCE=
-github.com/edgexfoundry/go-mod-registry/v4 v4.1.0-dev.1/go.mod h1:mzBf3SXxARJcfdsC/S2Mz72KG0o//0hxgOLcOwkfxDA=
-github.com/edgexfoundry/go-mod-secrets/v4 v4.1.0-dev.1 h1:E9sITYyH6gIsK6iQkBhjDSPE5KyL4X7C182QYR3qAKk=
-github.com/edgexfoundry/go-mod-secrets/v4 v4.1.0-dev.1/go.mod h1:AUnIFnmMfkh26/XbFrp+dQ/9Sd9tbEmAXsCDb6fNAOU=
+github.com/edgexfoundry/go-mod-bootstrap/v4 v4.1.0-dev.18 h1:mtNsF3zB2CVqx+7KJ55L9MfmgLhPRuChpNbHi1xJJDY=
+github.com/edgexfoundry/go-mod-bootstrap/v4 v4.1.0-dev.18/go.mod h1:rRHVWrKd6ZyNoNFDBBrf0mQbire7uoelk8rgt0p5eaU=
+github.com/edgexfoundry/go-mod-configuration/v4 v4.1.0-dev.9 h1:jDo1JSsVVngrLa2l5Fp+VpTfwOQ/CoHXM20s6XVfs+4=
+github.com/edgexfoundry/go-mod-configuration/v4 v4.1.0-dev.9/go.mod h1:rVooo5YB0fLbviw4mneKEc2JJ+Hrcy/KiTHUsll0oFs=
+github.com/edgexfoundry/go-mod-core-contracts/v4 v4.1.0-dev.6 h1:sk+8Nn2OTybVgHHw/0ImTNueDwZfdUQFmrC9GEd/IIc=
+github.com/edgexfoundry/go-mod-core-contracts/v4 v4.1.0-dev.6/go.mod h1:+FTlgTE3IynyUrf2cHw6LWJ5Ns+RZN4ywiJb9rSfL4Q=
+github.com/edgexfoundry/go-mod-messaging/v4 v4.1.0-dev.10 h1:YjXe8oF6uGIlMUiYgzMUMlIlwGbxye0vaw3tfLFqE74=
+github.com/edgexfoundry/go-mod-messaging/v4 v4.1.0-dev.10/go.mod h1:sEuzs69BePH6XdkZhoIe213uRFPLW/w7jsdQcvpcpJ0=
+github.com/edgexfoundry/go-mod-registry/v4 v4.1.0-dev.3 h1:Qg4NPW12zZ++NUpdHMbxVMAPSO7N9eKFrEAM1pqEx+E=
+github.com/edgexfoundry/go-mod-registry/v4 v4.1.0-dev.3/go.mod h1:WGRU3Yq7FV0RiDa/dA6IvHaWwD4VzibDa2sm0t3vXi4=
+github.com/edgexfoundry/go-mod-secrets/v4 v4.1.0-dev.3 h1:nKioDN+UNwm2D09vpak5cOgY6XS+4mCzcr4uqzBKK3c=
+github.com/edgexfoundry/go-mod-secrets/v4 v4.1.0-dev.3/go.mod h1:UzNorRohPR0Rrks51D5NFPGk+TljhMIjgVUtTaynCLQ=
 github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
 github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -105,8 +107,10 @@ github.com/fxamacker/cbor/v2 v2.8.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj2
 github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
 github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
 github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
-github.com/go-co-op/gocron/v2 v2.16.1 h1:ux/5zxVRveCaCuTtNI3DiOk581KC1KpJbpJFYUEVYwo=
-github.com/go-co-op/gocron/v2 v2.16.1/go.mod h1:opexeOFy5BplhsKdA7bzY9zeYih8I8/WNJ4arTIFPVc=
+github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8=
+github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
+github.com/go-co-op/gocron/v2 v2.16.2 h1:r08P663ikXiulLT9XaabkLypL/W9MoCIbqgQoAutyX4=
+github.com/go-co-op/gocron/v2 v2.16.2/go.mod h1:4YTLGCCAH75A5RlQ6q+h+VacO7CgjkgP0EJ+BEOXRSI=
 github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -149,8 +153,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
 github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
 github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
 github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
-github.com/go-playground/validator/v10 v10.25.0 h1:5Dh7cjvzR7BRZadnsVOzPhWsrwUr0nmsZJxEAnFLNO8=
-github.com/go-playground/validator/v10 v10.25.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus=
+github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k=
+github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
 github.com/go-resty/resty/v2 v2.16.5 h1:hBKqmWrr7uRc3euHVqmh1HTHcKn99Smr7o5spptdhTM=
 github.com/go-resty/resty/v2 v2.16.5/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA=
 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -232,8 +236,6 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
 github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
 github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
 github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
-github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E=
-github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM=
 github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA=
 github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo=
 github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
@@ -277,8 +279,8 @@ github.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs=
 github.com/jackc/pgx/v5 v5.7.5/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M=
 github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
 github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
-github.com/jeremija/gosubmit v0.2.7 h1:At0OhGCFGPXyjPYAsCchoBUhE099pcBXmsb4iZqROIc=
-github.com/jeremija/gosubmit v0.2.7/go.mod h1:Ui+HS073lCFREXBbdfrJzMB57OI/bdxTiLtrDHHhFPI=
+github.com/jeremija/gosubmit v0.2.8 h1:mmSITBz9JxVtu8eqbN+zmmwX7Ij2RidQxhcwRVI4wqA=
+github.com/jeremija/gosubmit v0.2.8/go.mod h1:Ui+HS073lCFREXBbdfrJzMB57OI/bdxTiLtrDHHhFPI=
 github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I=
 github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60=
 github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
@@ -352,10 +354,10 @@ github.com/muhlemmer/gu v0.3.1 h1:7EAqmFrW7n3hETvuAdmFmn4hS8W+z3LgKtrnow+YzNM=
 github.com/muhlemmer/gu v0.3.1/go.mod h1:YHtHR+gxM+bKEIIs7Hmi9sPT3ZDUvTN/i88wQpZkrdM=
 github.com/muhlemmer/httpforwarded v0.1.0 h1:x4DLrzXdliq8mprgUMR0olDvHGkou5BJsK/vWUetyzY=
 github.com/muhlemmer/httpforwarded v0.1.0/go.mod h1:yo9czKedo2pdZhoXe+yDkGVbU0TJ0q9oQ90BVoDEtw0=
-github.com/nats-io/nats.go v1.40.1 h1:MLjDkdsbGUeCMKFyCFoLnNn/HDTqcgVa3EQm+pMNDPk=
-github.com/nats-io/nats.go v1.40.1/go.mod h1:wV73x0FSI/orHPSYoyMeJB+KajMDoWyXmFaRrrYaaTo=
-github.com/nats-io/nkeys v0.4.9 h1:qe9Faq2Gxwi6RZnZMXfmGMZkg3afLLOtrU+gDZJ35b0=
-github.com/nats-io/nkeys v0.4.9/go.mod h1:jcMqs+FLG+W5YO36OX6wFIFcmpdAns+w1Wm6D3I/evE=
+github.com/nats-io/nats.go v1.42.0 h1:ynIMupIOvf/ZWH/b2qda6WGKGNSjwOUutTpWRvAmhaM=
+github.com/nats-io/nats.go v1.42.0/go.mod h1:iRWIPokVIFbVijxuMQq4y9ttaBTMe0SFdlZfMDd+33g=
+github.com/nats-io/nkeys v0.4.11 h1:q44qGV008kYd9W1b1nEBkNzvnWxtRSQ7A8BoqRrcfa0=
+github.com/nats-io/nkeys v0.4.11/go.mod h1:szDimtgmfOi9n25JpfIdGw12tZFYXqhGxjhVxsatHVE=
 github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
 github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
@@ -376,29 +378,29 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak=
 github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
 github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
 github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
-github.com/openziti/channel/v3 v3.0.39 h1:UM0iY0tbz4EbOVT3tX4mfN1wSAXxkkWIrKmQ7RhE/Hg=
-github.com/openziti/channel/v3 v3.0.39/go.mod h1:7k3mQhtWlgX0HaQBkllDTOH5WAf7DcyyMLqJXrL+/fI=
-github.com/openziti/edge-api v0.26.42 h1:Wi/BUttSUvedT9XGht7vi/zI/TNGc3ApvjkAviWhauA=
-github.com/openziti/edge-api v0.26.42/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng=
-github.com/openziti/foundation/v2 v2.0.59 h1:PJwrcTq62x+cONBeKMlnsuphsTlOvTz8j8prYnehm8o=
-github.com/openziti/foundation/v2 v2.0.59/go.mod h1:76gmsdIBHvv4O3I0TuFBfO58Rv7YN8FA0ojwYz27ZxE=
-github.com/openziti/identity v1.0.100 h1:FTkbhykDCMw1z/wxEeDfmq1aBp2tLRjZ3ggioRT4pg8=
-github.com/openziti/identity v1.0.100/go.mod h1:E4SHqfXaZldDCo/GIdSD/Xg61obuolWYg9Qe8lqGUrQ=
-github.com/openziti/metrics v1.3.0 h1:oeythnUY2gs48MYM/HelAbJupfP/u81VYKMEwaGHeRM=
-github.com/openziti/metrics v1.3.0/go.mod h1:MOLcoTxhPNla6+NWUCMVTnl1PNqTU40qrbKVa/lVVgg=
-github.com/openziti/sdk-golang v0.25.1 h1:ArT3xXR8ze3E2W0U1uWLNn8nhZ0J+BEUHPpzCeWxD+k=
-github.com/openziti/sdk-golang v0.25.1/go.mod h1:eWHhCt66xO1uv+GOrsEE3eLvgumLGnJ97kXF1g5YP3k=
-github.com/openziti/secretstream v0.1.32 h1:89/ZVcwIQjdVmWDfVRfMEChJJXTLXJ59AYBw5j646M4=
-github.com/openziti/secretstream v0.1.32/go.mod h1:8YaIbjyMwBeKQ7eOYcoVPKHT10u+4OVPXpnZAeDzC6o=
-github.com/openziti/transport/v2 v2.0.167 h1:KE2u04cPAO+Xx9eidcYMhAwoGccXZOVnqmhG7nWeuBo=
-github.com/openziti/transport/v2 v2.0.167/go.mod h1:RYom6Xjt8gZaCmL0t4FrIcM46RfvqDtoRSUixq8V+mI=
+github.com/openziti/channel/v4 v4.2.0 h1:oDWDECsMlGqYOWTR7cpvWiEtDgK2zH5XYyU94mMobUQ=
+github.com/openziti/channel/v4 v4.2.0/go.mod h1:t42XcuNICtJSizetoZbmml3l5AE7d/LDCf29c+Ene4Q=
+github.com/openziti/edge-api v0.26.45 h1:M5rR28yEIIpbVo7F7c5tF+z2qNKqvN55pK6bZqQHn+8=
+github.com/openziti/edge-api v0.26.45/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng=
+github.com/openziti/foundation/v2 v2.0.63 h1:7D8JhHT3i4H5owF+XnTdyjCKn809xEcFD8/RG1h9QYA=
+github.com/openziti/foundation/v2 v2.0.63/go.mod h1:sAtu+ulsxJWJ2iZ16UMBZVocRB3beBpHOE6Wy5RuvJI=
+github.com/openziti/identity v1.0.101 h1:XujPT6eCv3Gqsodh9846EoWfQZwDAFrjPLxm1cipveY=
+github.com/openziti/identity v1.0.101/go.mod h1:OZLcSf2wGqAa7/8SmbwLQxv0Gsv4i4pxTk83WPHIr+o=
+github.com/openziti/metrics v1.4.1 h1:JMnfmW8liTzmqJpd7HDPCSvDDFg1UrE0WoLhW9XdIG8=
+github.com/openziti/metrics v1.4.1/go.mod h1:MOLcoTxhPNla6+NWUCMVTnl1PNqTU40qrbKVa/lVVgg=
+github.com/openziti/sdk-golang v1.1.2 h1:Q7YqFcAjfkH9ZZp+yYPIAvEWt/DOhhOxBx1drXyjhvE=
+github.com/openziti/sdk-golang v1.1.2/go.mod h1:sXLPdy/Q0Zor5ef08H+W60EEy6ofEDpeZFlP4SWwc4w=
+github.com/openziti/secretstream v0.1.34 h1:H2/g90s81vkTWwSodeHP7tkf9SZA6pp4L1rqR7UrZUk=
+github.com/openziti/secretstream v0.1.34/go.mod h1:LwKcXz+x1grnVn/kdWxLYO6LZOPqQgXNSkGUPvfjl7w=
+github.com/openziti/transport/v2 v2.0.171 h1:7vgQLANLXP4WNYuRxeOcCx++/t9QpmcDfwlRagtfigc=
+github.com/openziti/transport/v2 v2.0.171/go.mod h1:F4FIT6aH8QnHBC/2N/RcqbGRI5oT3+1ojvWyYldTNIw=
 github.com/orcaman/concurrent-map/v2 v2.0.1 h1:jOJ5Pg2w1oeB6PeDurIYf6k9PQ+aTITr/6lP/L/zp6c=
 github.com/orcaman/concurrent-map/v2 v2.0.1/go.mod h1:9Eq3TG2oBe5FirmYWQfYO5iH1q0Jv47PLaNK++uCdOM=
 github.com/parallaxsecond/parsec-client-go v0.0.0-20221025095442-f0a77d263cf9 h1:mOvehYivJ4Aqu2CPe3D3lv8jhqOI9/1o0THxJHBE0qw=
 github.com/parallaxsecond/parsec-client-go v0.0.0-20221025095442-f0a77d263cf9/go.mod h1:gLH27qo/dvMhLTVVyMELpe3Tut7sOfkiDg7ZpeqKwsw=
 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
-github.com/pebbe/zmq4 v1.3.1 h1:WmGnjErIFjb43M6hq5nB/g9cUx9YQAXurAwfZV2Cgeo=
-github.com/pebbe/zmq4 v1.3.1/go.mod h1:nqnPueOapVhE2wItZ0uOErngczsJdLOGkebMxaO8r48=
+github.com/pebbe/zmq4 v1.4.0 h1:gO5P92Ayl8GXpPZdYcD62Cwbq0slSBVVQRIXwGSJ6eQ=
+github.com/pebbe/zmq4 v1.4.0/go.mod h1:nqnPueOapVhE2wItZ0uOErngczsJdLOGkebMxaO8r48=
 github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
 github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -419,8 +421,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
 github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
-github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po=
-github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
+github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA=
+github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
@@ -440,8 +442,8 @@ github.com/speps/go-hashids v2.0.0+incompatible h1:kSfxGfESueJKTx0mpER9Y/1XHl+FV
 github.com/speps/go-hashids v2.0.0+incompatible/go.mod h1:P7hqPzMdnZOfyIk+xrlG1QaSMw+gCBdHKsBDnhpaZvc=
 github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
 github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
-github.com/spf13/cast v1.8.0 h1:gEN9K4b8Xws4EX0+a0reLmhq8moKn7ntRlQYgjPeCDk=
-github.com/spf13/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
+github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE=
+github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
 github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
 github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
 github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
@@ -480,8 +482,12 @@ github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo
 github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
 github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM=
 github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4=
-github.com/zitadel/oidc/v2 v2.12.2 h1:3kpckg4rurgw7w7aLJrq7yvRxb2pkNOtD08RH42vPEs=
-github.com/zitadel/oidc/v2 v2.12.2/go.mod h1:vhP26g1g4YVntcTi0amMYW3tJuid70nxqxf+kb6XKgg=
+github.com/zitadel/logging v0.6.2 h1:MW2kDDR0ieQynPZ0KIZPrh9ote2WkxfBif5QoARDQcU=
+github.com/zitadel/logging v0.6.2/go.mod h1:z6VWLWUkJpnNVDSLzrPSQSQyttysKZ6bCRongw0ROK4=
+github.com/zitadel/oidc/v3 v3.39.0 h1:WK3eNqmgshiYo1oEqONfXXbPbve+Qzgjl8KhKDFUvxc=
+github.com/zitadel/oidc/v3 v3.39.0/go.mod h1:JwdgdU/WxkmBtWuE8/pEjAbDTWXxJGqBix/gUoeEig4=
+github.com/zitadel/schema v1.3.1 h1:QT3kwiRIRXXLVAs6gCK/u044WmUVh6IlbLXUsn6yRQU=
+github.com/zitadel/schema v1.3.1/go.mod h1:071u7D2LQacy1HAN+YnMd/mx1qVE2isb0Mjeqg46xnU=
 go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
 go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
 go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ=
@@ -520,8 +526,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
-golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
-golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
+golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
+golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -532,8 +538,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
 golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc=
-golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=
 golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
 golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -601,8 +605,8 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd
 golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
 golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
 golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
-golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
-golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
+golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
+golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -615,8 +619,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ
 golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc=
-golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
+golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
+golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -629,8 +633,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
-golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
+golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
+golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
 golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -688,13 +692,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
-golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
+golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
-golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
+golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg=
+golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -704,8 +708,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
-golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
+golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
+golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -883,8 +887,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
-gopkg.in/go-jose/go-jose.v2 v2.6.3 h1:nt80fvSDlhKWQgSWyHyy5CfmlQr+asih51R8PTWNKKs=
-gopkg.in/go-jose/go-jose.v2 v2.6.3/go.mod h1:zzZDPkNNw/c9IE7Z9jr11mBZQhKQTMzoEEIoEdZlFBI=
 gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
diff --git a/internal/core/command/application/command.go b/internal/core/command/application/command.go
index 455c678e..1ab84f4a 100644
--- a/internal/core/command/application/command.go
+++ b/internal/core/command/application/command.go
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2021 IOTech Ltd
+// Copyright (C) 2021-2025 IOTech Ltd
 //
 // SPDX-License-Identifier: Apache-2.0
 
@@ -43,8 +43,11 @@ func AllCommands(offset int, limit int, dic *di.Container) (deviceCoreCommands [
 	configuration := commandContainer.ConfigurationFrom(dic.Get)
 	serviceUrl := configuration.Service.Url()
 
-	deviceCoreCommands = make([]dtos.DeviceCoreCommand, len(multiDevicesResponse.Devices))
-	for i, device := range multiDevicesResponse.Devices {
+	for _, device := range multiDevicesResponse.Devices {
+		if len(device.ProfileName) == 0 {
+			// if the profile is not set, skip the profile query
+			continue
+		}
 		deviceProfileResponse, err := dpc.DeviceProfileByName(context.Background(), device.ProfileName)
 		if err != nil {
 			return deviceCoreCommands, totalCount, errors.NewCommonEdgeXWrapper(err)
@@ -53,11 +56,11 @@ func AllCommands(offset int, limit int, dic *di.Container) (deviceCoreCommands [
 		if err != nil {
 			return nil, totalCount, errors.NewCommonEdgeXWrapper(err)
 		}
-		deviceCoreCommands[i] = dtos.DeviceCoreCommand{
+		deviceCoreCommands = append(deviceCoreCommands, dtos.DeviceCoreCommand{
 			DeviceName:   device.Name,
 			ProfileName:  device.ProfileName,
 			CoreCommands: commands,
-		}
+		})
 	}
 	return deviceCoreCommands, multiDevicesResponse.TotalCount, nil
 }
diff --git a/internal/core/command/controller/messaging/internal.go b/internal/core/command/controller/messaging/internal.go
index bcfe6351..1ecfc35a 100644
--- a/internal/core/command/controller/messaging/internal.go
+++ b/internal/core/command/controller/messaging/internal.go
@@ -57,7 +57,9 @@ func SubscribeCommandRequests(ctx context.Context, requestTimeout time.Duration,
 			case err = <-messageErrors:
 				lc.Error(err.Error())
 			case requestEnvelope := <-messages:
-				processDeviceCommandRequest(messageBus, requestEnvelope, baseTopic, requestTimeout, lc, dic)
+				go func() {
+					processDeviceCommandRequest(messageBus, requestEnvelope, baseTopic, requestTimeout, lc, dic)
+				}()
 			}
 		}
 	}()
@@ -211,7 +213,9 @@ func SubscribeCommandQueryRequests(ctx context.Context, dic *di.Container) error
 			case err = <-messageErrors:
 				lc.Error(err.Error())
 			case requestEnvelope := <-messages:
-				processCommandQueryRequest(messageBus, requestEnvelope, baseTopic, lc, dic)
+				go func() {
+					processCommandQueryRequest(messageBus, requestEnvelope, baseTopic, lc, dic)
+				}()
 			}
 		}
 	}()
diff --git a/internal/core/data/application/reading.go b/internal/core/data/application/reading.go
index ed219356..6e69600c 100644
--- a/internal/core/data/application/reading.go
+++ b/internal/core/data/application/reading.go
@@ -8,11 +8,13 @@ package application
 import (
 	"context"
 	"fmt"
+	"slices"
 	"sync"
 	"time"
 
 	bootstrapContainer "github.com/edgexfoundry/go-mod-bootstrap/v4/bootstrap/container"
 	"github.com/edgexfoundry/go-mod-bootstrap/v4/di"
+	"github.com/edgexfoundry/go-mod-core-contracts/v4/common"
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos"
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/errors"
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/models"
@@ -311,7 +313,7 @@ func AsyncPurgeEvent(ctx context.Context, dic *di.Container) errors.EdgeX {
 					lc.Info("Exiting event retention")
 					return
 				case <-timer.C:
-					err = purgeEventByAutoEvents(dic)
+					err = purgeEvents(dic)
 					if err != nil {
 						lc.Errorf("Failed to purge events and readings, %v", err)
 						break
@@ -324,20 +326,24 @@ func AsyncPurgeEvent(ctx context.Context, dic *di.Container) errors.EdgeX {
 	return nil
 }
 
-func purgeEventByAutoEvents(dic *di.Container) errors.EdgeX {
+func purgeEvents(dic *di.Container) errors.EdgeX {
 	devices := container.DeviceStoreFrom(dic.Get).Devices()
 	for _, device := range devices {
 		for _, e := range device.AutoEvents {
-			err := purgeEvent(device.Name, e, dic)
-			if err != nil {
+			if err := purgeEventsByAutoEvent(device.Name, e, dic); err != nil {
 				return errors.NewCommonEdgeXWrapper(err)
 			}
 		}
+
+		// purge events that are not in auto events
+		if err := purgeNoneAutoEventsByDevice(device, dic); err != nil {
+			return errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("purge device '%s' events not coming from auto events", device.Name), err)
+		}
 	}
 	return nil
 }
 
-func purgeEvent(deviceName string, autoEvent models.AutoEvent, dic *di.Container) errors.EdgeX {
+func purgeEventsByAutoEvent(deviceName string, autoEvent models.AutoEvent, dic *di.Container) errors.EdgeX {
 	config := container.ConfigurationFrom(dic.Get)
 	// apply the default retention policy, when maxCap/minCap/duration are not specified or equal to zero/empty string
 	// which are mentioned in the documentation
@@ -465,3 +471,58 @@ func countBasedEventRetention(deviceName string, autoEvent models.AutoEvent, dic
 	}
 	return nil
 }
+
+func purgeNoneAutoEventsByDevice(device models.Device, dic *di.Container) errors.EdgeX {
+	if len(device.ProfileName) == 0 {
+		return nil
+	}
+	sources, err := noneAutoEventSourcesByDevice(device, dic)
+	if err != nil {
+		return errors.NewCommonEdgeXWrapper(err)
+	}
+	for _, source := range sources {
+		autoEvent := models.AutoEvent{SourceName: source} // Empty AutoEvent.Retention will apply default retention policy
+		err = purgeEventsByAutoEvent(device.Name, autoEvent, dic)
+		if err != nil {
+			return errors.NewCommonEdgeXWrapper(err)
+		}
+	}
+	return nil
+}
+
+// noneAutoEventSourcesByDevice returns sources that are not defined in the device's auto events
+func noneAutoEventSourcesByDevice(device models.Device, dic *di.Container) ([]string, errors.EdgeX) {
+	profileClient := bootstrapContainer.DeviceProfileClientFrom(dic.Get)
+	profile, err := profileClient.DeviceProfileByName(context.Background(), device.ProfileName)
+	if err != nil {
+		return nil, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("retrieve event sources not in auto events from the device '%s'", device.Name), err)
+	}
+	var sources []string
+	for _, r := range profile.Profile.DeviceResources {
+		// skip the device resource that is associated with any AutoEvent definitions.
+		if contained := slices.ContainsFunc(device.AutoEvents, func(event models.AutoEvent) bool {
+			return event.SourceName == r.Name
+		}); contained {
+			continue
+		}
+		// skip write-only device resource that do not generate events
+		if r.Properties.ReadWrite == common.ReadWrite_W {
+			continue
+		}
+		sources = append(sources, r.Name)
+	}
+	for _, c := range profile.Profile.DeviceCommands {
+		// skip the device command that is associated with any AutoEvent definitions.
+		if contained := slices.ContainsFunc(device.AutoEvents, func(event models.AutoEvent) bool {
+			return event.SourceName == c.Name
+		}); contained {
+			continue
+		}
+		// skip write-only device command that do not generate events
+		if c.ReadWrite == common.ReadWrite_W {
+			continue
+		}
+		sources = append(sources, c.Name)
+	}
+	return sources, nil
+}
diff --git a/internal/core/data/embed/sql/versions/4.1.0-dev/00-tables.sql b/internal/core/data/embed/sql/versions/4.1.0-dev/00-tables.sql
new file mode 100644
index 00000000..1fc5001b
--- /dev/null
+++ b/internal/core/data/embed/sql/versions/4.1.0-dev/00-tables.sql
@@ -0,0 +1,9 @@
+--
+-- Copyright (C) 2025 IOTech Ltd
+--
+-- SPDX-License-Identifier: Apache-2.0
+
+ALTER TABLE core_data.device_info ADD COLUMN IF NOT EXISTS mark_deleted BOOLEAN DEFAULT false;
+
+-- create index on reading(event_id) to enhance the query performance
+CREATE INDEX IF NOT EXISTS idx_reading_event_id ON core_data.reading(event_id);
diff --git a/internal/core/keeper/controller/http/kv.go b/internal/core/keeper/controller/http/kv.go
index c986b298..e12e940c 100644
--- a/internal/core/keeper/controller/http/kv.go
+++ b/internal/core/keeper/controller/http/kv.go
@@ -19,6 +19,8 @@ import (
 	"github.com/edgexfoundry/go-mod-bootstrap/v4/di"
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/requests"
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/responses"
+	"github.com/edgexfoundry/go-mod-core-contracts/v4/models"
+
 	"github.com/labstack/echo/v4"
 )
 
@@ -127,6 +129,9 @@ func (rc *KVController) DeleteKeys(c echo.Context) error {
 		return utils.WriteErrorResponse(w, ctx, lc, err, "")
 	}
 
+	// publish the key change event
+	go application.PublishKeyChange(models.KVS{Key: key}, key, ctx, rc.dic)
+
 	response := responses.NewKeysResponse("", "", http.StatusOK, resp)
 	utils.WriteHttpHeader(w, ctx, http.StatusOK)
 	return pkg.EncodeAndWriteResponse(response, w, lc)
diff --git a/internal/pkg/cache/device.go b/internal/pkg/cache/device.go
index e879f404..08b18c2d 100644
--- a/internal/pkg/cache/device.go
+++ b/internal/pkg/cache/device.go
@@ -3,7 +3,6 @@
 package cache
 
 import (
-	"maps"
 	"sync"
 
 	bootstrapContainer "github.com/edgexfoundry/go-mod-bootstrap/v4/bootstrap/container"
@@ -75,7 +74,11 @@ func (s *activeDeviceStore) Devices() map[string]models.Device {
 	s.mutex.RLock()
 	defer s.mutex.RUnlock()
 	// since the device map might change, return the copy of devices to prevent unexpected result
-	return maps.Clone(s.activeDeviceMap)
+	clonedDevices := make(map[string]models.Device, len(s.activeDeviceMap))
+	for deviceName, device := range s.activeDeviceMap {
+		clonedDevices[deviceName] = device.Clone()
+	}
+	return clonedDevices
 }
 
 func DeviceStore(dic *di.Container) ActiveDeviceStore {
diff --git a/internal/pkg/db/postgres/utils.go b/internal/pkg/db/postgres/utils.go
index 61e4b1a8..c96d2ee0 100644
--- a/internal/pkg/db/postgres/utils.go
+++ b/internal/pkg/db/postgres/utils.go
@@ -91,7 +91,7 @@ func getSortedSqlFileNames(embedFiles embed.FS, sqlFilesDir string) ([]string, e
 		if err != nil {
 			continue
 		}
-		sqlFiles = append(sqlFiles, sqlFileName{order, filepath.Join(sqlFilesDir, fileName)})
+		sqlFiles = append(sqlFiles, sqlFileName{order, toEmbedPath(sqlFilesDir, fileName)})
 	}
 
 	return sqlFiles.getSortedNames(), nil
@@ -144,3 +144,8 @@ func WrapDBError(message string, err error) errors.EdgeX {
 	}
 	return errors.NewCommonEdgeX(errors.KindDatabaseError, message, err)
 }
+
+// toEmbedPath converts a path to the format required for go embed by using '/' as the separator.
+func toEmbedPath(baseDir, fileName string) string {
+	return filepath.ToSlash(filepath.Join(baseDir, fileName))
+}
diff --git a/internal/pkg/infrastructure/postgres/consts.go b/internal/pkg/infrastructure/postgres/consts.go
index ef957979..7e683510 100644
--- a/internal/pkg/infrastructure/postgres/consts.go
+++ b/internal/pkg/infrastructure/postgres/consts.go
@@ -12,6 +12,7 @@ import (
 	proxyauth "github.com/edgexfoundry/edgex-go/internal/security/proxyauth/embed"
 	notifications "github.com/edgexfoundry/edgex-go/internal/support/notifications/embed"
 	scheduler "github.com/edgexfoundry/edgex-go/internal/support/scheduler/embed"
+	"github.com/edgexfoundry/go-mod-core-contracts/v4/common"
 )
 
 // constants relate to the postgres db table names
@@ -43,6 +44,17 @@ const (
 	nameCol     = "name"
 )
 
+// constants relate to the named arguments as specified for SQL conditions
+const (
+	offsetCondition      = common.Offset
+	limitCondition       = common.Limit
+	startTimeCondition   = common.Start
+	endTimeCondition     = common.End
+	jsonContentCondition = "jsonContent"
+	categoryCondition    = "category"
+	labelsCondition      = "labels"
+)
+
 // constants relate to the event/reading postgres db table column names
 const (
 	deviceNameCol     = "devicename"
@@ -59,6 +71,7 @@ const (
 	binaryValueCol    = "binaryvalue"
 	mediaTypeCol      = "mediatype"
 	objectValueCol    = "objectvalue"
+	markDeletedCol    = "mark_deleted"
 )
 
 // constants relate to the keeper postgres db table column names
diff --git a/internal/pkg/infrastructure/postgres/device.go b/internal/pkg/infrastructure/postgres/device.go
index 197a3244..f473ad8b 100644
--- a/internal/pkg/infrastructure/postgres/device.go
+++ b/internal/pkg/infrastructure/postgres/device.go
@@ -80,7 +80,8 @@ func (c *Client) DevicesByServiceName(offset int, limit int, name string) ([]mod
 	ctx := context.Background()
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{serviceNameField: name}
-	return queryDevices(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(deviceTableName), queryObj, offset, validLimit)
+	return queryDevices(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(deviceTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 }
 
 // DeviceIdExists checks the device existence by id
@@ -132,12 +133,14 @@ func (c *Client) AllDevices(offset int, limit int, labels []string) (devices []m
 	if len(labels) > 0 {
 		c.loggingClient.Debugf("Querying devices by labels: %v", labels)
 		queryObj := map[string]any{labelsField: labels}
-		devices, err = queryDevices(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(deviceTableName), queryObj, offset, validLimit)
+		devices, err = queryDevices(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(deviceTableName),
+			pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 		if err != nil {
 			return devices, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all devices by labels", err)
 		}
 	} else {
-		devices, err = queryDevices(ctx, c.ConnPool, sqlQueryContentWithPagination(deviceTableName), offset, validLimit)
+		devices, err = queryDevices(ctx, c.ConnPool, sqlQueryContentWithPaginationAsNamedArgs(deviceTableName),
+			pgx.NamedArgs{offsetCondition: offset, limitCondition: validLimit})
 		if err != nil {
 			return devices, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all devices", err)
 		}
@@ -151,7 +154,8 @@ func (c *Client) DevicesByProfileName(offset int, limit int, profileName string)
 	ctx := context.Background()
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{profileNameField: profileName}
-	return queryDevices(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(deviceTableName), queryObj, offset, validLimit)
+	return queryDevices(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(deviceTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 }
 
 // UpdateDevice updates a device
diff --git a/internal/pkg/infrastructure/postgres/device_profile.go b/internal/pkg/infrastructure/postgres/device_profile.go
index 126fc46f..b5cb2dce 100644
--- a/internal/pkg/infrastructure/postgres/device_profile.go
+++ b/internal/pkg/infrastructure/postgres/device_profile.go
@@ -148,12 +148,14 @@ func (c *Client) AllDeviceProfiles(offset int, limit int, labels []string) (prof
 	if len(labels) > 0 {
 		c.loggingClient.Debugf("Querying device profiles by labels: %v", labels)
 		queryObj := map[string]any{labelsField: labels}
-		profiles, err = queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(deviceProfileTableName), queryObj, offset, validLimit)
+		profiles, err = queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(deviceProfileTableName),
+			pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 		if err != nil {
 			return profiles, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all device profiles by labels", err)
 		}
 	} else {
-		profiles, err = queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentWithPagination(deviceProfileTableName), offset, validLimit)
+		profiles, err = queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentWithPaginationAsNamedArgs(deviceProfileTableName),
+			pgx.NamedArgs{offsetCondition: offset, limitCondition: validLimit})
 		if err != nil {
 			return profiles, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all device profiles", err)
 		}
@@ -167,7 +169,8 @@ func (c *Client) DeviceProfilesByModel(offset int, limit int, model string) ([]m
 	ctx := context.Background()
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{modelField: model}
-	return queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(deviceProfileTableName), queryObj, offset, validLimit)
+	return queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(deviceProfileTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 }
 
 // DeviceProfilesByManufacturer query device profiles with offset, limit and manufacturer
@@ -175,7 +178,8 @@ func (c *Client) DeviceProfilesByManufacturer(offset int, limit int, manufacture
 	ctx := context.Background()
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{manufacturerField: manufacturer}
-	return queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(deviceProfileTableName), queryObj, offset, validLimit)
+	return queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(deviceProfileTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 }
 
 // DeviceProfilesByManufacturerAndModel query device profiles with offset, limit, manufacturer and model
@@ -183,7 +187,8 @@ func (c *Client) DeviceProfilesByManufacturerAndModel(offset int, limit int, man
 	ctx := context.Background()
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{modelField: model, manufacturerField: manufacturer}
-	return queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(deviceProfileTableName), queryObj, offset, validLimit)
+	return queryDeviceProfiles(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(deviceProfileTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 }
 
 // DeviceProfileCountByLabels returns the total count of Device Profiles with labels specified.  If no label is specified, the total count of all device profiles will be returned.
diff --git a/internal/pkg/infrastructure/postgres/device_service.go b/internal/pkg/infrastructure/postgres/device_service.go
index 851d02f2..8922511f 100644
--- a/internal/pkg/infrastructure/postgres/device_service.go
+++ b/internal/pkg/infrastructure/postgres/device_service.go
@@ -122,7 +122,8 @@ func (c *Client) AllDeviceServices(offset int, limit int, labels []string) (devi
 	if len(labels) > 0 {
 		c.loggingClient.Debugf("Querying device services by labels: %v", labels)
 		queryObj := map[string]any{labelsField: labels}
-		deviceServices, err = queryDeviceServices(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(deviceServiceTableName), queryObj, offset, validLimit)
+		deviceServices, err = queryDeviceServices(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(deviceServiceTableName),
+			pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 		if err != nil {
 			return deviceServices, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all device services by labels", err)
 		}
diff --git a/internal/pkg/infrastructure/postgres/deviceinfo.go b/internal/pkg/infrastructure/postgres/deviceinfo.go
index 6a146197..b96919fc 100644
--- a/internal/pkg/infrastructure/postgres/deviceinfo.go
+++ b/internal/pkg/infrastructure/postgres/deviceinfo.go
@@ -115,9 +115,9 @@ func (c *Client) addDeviceInfo(deviceInfo models.DeviceInfo) (int, errors.EdgeX)
 }
 
 // deviceInfosByConds query deviceInfos by specified conditions
-func (c *Client) deviceInfosByConds(cols []string, values []any) ([]models.DeviceInfo, errors.EdgeX) {
-	sqlStmt := sqlQueryAllWithConds(deviceInfoTableName, cols...)
-	rows, err := c.ConnPool.Query(context.Background(), sqlStmt, values...)
+func (c *Client) deviceInfosByConds(cols []string, values pgx.NamedArgs) ([]models.DeviceInfo, errors.EdgeX) {
+	sqlStmt := sqlQueryAllWithNamedArgConds(deviceInfoTableName, cols...)
+	rows, err := c.ConnPool.Query(context.Background(), sqlStmt, values)
 	if err != nil {
 		return nil, pgClient.WrapDBError("failed to query deviceInfos", err)
 	}
@@ -138,9 +138,18 @@ func (c *Client) deviceInfosByConds(cols []string, values []any) ([]models.Devic
 // only calling this func when corresponding events/readings have been removed, otherwise may
 // potentially break referential integrity between events/readings/device_info records
 func deleteDeviceInfoById(ctx context.Context, tx pgx.Tx, id int) errors.EdgeX {
-	_, err := tx.Exec(ctx, sqlDeleteById(deviceInfoTableName), id)
+	_, err := tx.Exec(ctx, fmt.Sprintf("DELETE FROM %s WHERE %s = @%s", deviceInfoTableName, idCol, idCol), pgx.NamedArgs{idCol: id})
 	if err != nil {
 		return pgClient.WrapDBError(fmt.Sprintf("failed to delete deviceInfo by id %d", id), err)
 	}
 	return nil
 }
+
+// updateDeviceInfosDeletableByDeviceName updates deviceInfos by deviceName as deletable
+func (c *Client) updateDeviceInfosDeletableByDeviceName(deviceName string) errors.EdgeX {
+	_, err := c.ConnPool.Exec(context.Background(), fmt.Sprintf("UPDATE %s SET %s = true WHERE %s=$1", deviceInfoTableName, markDeletedCol, deviceNameCol), deviceName)
+	if err != nil {
+		return pgClient.WrapDBError(fmt.Sprintf("update %s to deletable by devicename '%s'", deviceInfoTableName, deviceName), err)
+	}
+	return nil
+}
diff --git a/internal/pkg/infrastructure/postgres/event.go b/internal/pkg/infrastructure/postgres/event.go
index e2bef051..27b2d1b1 100644
--- a/internal/pkg/infrastructure/postgres/event.go
+++ b/internal/pkg/infrastructure/postgres/event.go
@@ -26,7 +26,7 @@ func (c *Client) AllEvents(offset, limit int) ([]model.Event, errors.EdgeX) {
 	ctx := context.Background()
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 
-	events, err := queryEvents(ctx, c.ConnPool, sqlQueryAllEventWithPaginationDescByCol(originCol), offset, validLimit)
+	events, err := queryEvents(ctx, c.ConnPool, sqlQueryAllEventWithPaginationDescByCol(originCol), pgx.NamedArgs{offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.KindDatabaseError, "failed to query all events", err)
 	}
@@ -91,7 +91,7 @@ func (c *Client) EventById(id string) (model.Event, errors.EdgeX) {
 	ctx := context.Background()
 	var event model.Event
 
-	rows, err := c.ConnPool.Query(ctx, sqlQueryAllEventById(), id)
+	rows, err := c.ConnPool.Query(ctx, sqlQueryAllEventById(), pgx.NamedArgs{idCol: id})
 	if err != nil {
 		return event, pgClient.WrapDBError(fmt.Sprintf("failed to query event with id '%s'", id), err)
 	}
@@ -103,7 +103,7 @@ func (c *Client) EventById(id string) (model.Event, errors.EdgeX) {
 		}
 
 		// query reading by the specific even_id and origin descending
-		readings, err := queryReadings(ctx, c.ConnPool, sqlQueryAllReadingAndDescWithConds(originCol, eventIdFKCol), e.Id)
+		readings, err := queryReadings(ctx, c.ConnPool, sqlQueryAllReadingAndDescWithConds(originCol, eventIdFKCol), pgx.NamedArgs{eventIdFKCol: e.Id})
 		if err != nil {
 			return model.Event{}, err
 		}
@@ -123,26 +123,26 @@ func (c *Client) EventById(id string) (model.Event, errors.EdgeX) {
 
 // EventTotalCount returns the total count of Event from db
 func (c *Client) EventTotalCount() (uint32, errors.EdgeX) {
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCount(eventTableName))
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountEvent())
 }
 
 // EventCountByDeviceName returns the count of Event associated a specific Device from db
 func (c *Client) EventCountByDeviceName(deviceName string) (uint32, errors.EdgeX) {
 	sqlStatement := sqlQueryCountEventByCol(deviceNameCol)
 
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, deviceName)
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, pgx.NamedArgs{deviceNameCol: deviceName})
 }
 
 // EventCountByTimeRange returns the count of Event by time range from db
 func (c *Client) EventCountByTimeRange(start int64, end int64) (uint32, errors.EdgeX) {
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountEventByTimeRangeCol(originCol, nil), start, end)
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountEventByTimeRangeCol(originCol, nil), pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end})
 }
 
 // EventCountByDeviceNameAndSourceNameAndLimit returns the count of Event by deviceName, resourceName, and limit from db
 // this is used to check whether the event number is reach the event retention maxCap
 func (c *Client) EventCountByDeviceNameAndSourceNameAndLimit(deviceName, sourceName string, limit int) (uint32, errors.EdgeX) {
 	sqlStatement := sqlCountEventByDeviceNameAndSourceNameAndLimit()
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, deviceName, sourceName, limit)
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, pgx.NamedArgs{deviceNameCol: deviceName, sourceNameCol: sourceName, limitCondition: limit})
 }
 
 // EventsByDeviceName query events by offset, limit and device name
@@ -151,7 +151,7 @@ func (c *Client) EventsByDeviceName(offset int, limit int, name string) ([]model
 
 	sqlStatement := sqlQueryAllEventAndDescWithCondsAndPage(originCol, deviceNameCol)
 
-	events, err := queryEvents(context.Background(), c.ConnPool, sqlStatement, name, offset, validLimit)
+	events, err := queryEvents(context.Background(), c.ConnPool, sqlStatement, pgx.NamedArgs{deviceNameCol: name, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.KindDatabaseError, fmt.Sprintf("failed to query events by device '%s'", name), err)
 	}
@@ -162,9 +162,9 @@ func (c *Client) EventsByDeviceName(offset int, limit int, name string) ([]model
 func (c *Client) EventsByTimeRange(start int64, end int64, offset int, limit int) ([]model.Event, errors.EdgeX) {
 	ctx := context.Background()
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
-	sqlStatement := sqlQueryAllEventWithPaginationAndTimeRangeDescByCol(originCol, originCol, nil)
+	sqlStatement := sqlQueryAllEventWithPaginationAndTimeRangeDescByCol(originCol, originCol)
 
-	events, err := queryEvents(ctx, c.ConnPool, sqlStatement, start, end, offset, validLimit)
+	events, err := queryEvents(ctx, c.ConnPool, sqlStatement, pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
@@ -174,7 +174,6 @@ func (c *Client) EventsByTimeRange(start int64, end int64, offset int, limit int
 // DeleteEventById removes an event by id
 func (c *Client) DeleteEventById(id string) errors.EdgeX {
 	ctx := context.Background()
-	sqlStatement := sqlDeleteById(eventTableName)
 
 	event, err := c.EventById(id)
 	if err != nil {
@@ -188,7 +187,8 @@ func (c *Client) DeleteEventById(id string) errors.EdgeX {
 			return err
 		}
 
-		if err = deleteEvents(ctx, tx, sqlStatement, id); err != nil {
+		sqlStatement := fmt.Sprintf("DELETE FROM %s WHERE %s = @%s", eventTableName, idCol, idCol)
+		if err = deleteEvents(ctx, tx, sqlStatement, pgx.NamedArgs{idCol: id}); err != nil {
 			return err
 		}
 		return nil
@@ -202,16 +202,24 @@ func (c *Client) DeleteEventById(id string) errors.EdgeX {
 // DeleteEventsByDeviceName deletes specific device's events and corresponding readings
 // This function is implemented to starts up two goroutines to delete readings and events in the background to achieve better performance
 func (c *Client) DeleteEventsByDeviceName(deviceName string) errors.EdgeX {
-	return c.deleteEventsByConditions([]string{deviceNameCol}, []any{deviceName})
+	// update deviceInfo as deletable, then event and reading will not return when the user query event or reading by the specific device
+	if err := c.updateDeviceInfosDeletableByDeviceName(deviceName); err != nil {
+		return errors.NewCommonEdgeX(errors.Kind(err), "delete events by deviceName", err)
+	}
+	// delete events, readings, deviceInfos
+	if err := c.deleteEventsByConditions([]string{deviceNameCol}, pgx.NamedArgs{deviceNameCol: deviceName}); err != nil {
+		return errors.NewCommonEdgeX(errors.Kind(err), "delete events by deviceName", err)
+	}
+	return nil
 }
 
 // DeleteEventsByDeviceNameAndSourceName deletes specific device's events and corresponding readings
 func (c *Client) DeleteEventsByDeviceNameAndSourceName(deviceName, sourceName string) errors.EdgeX {
-	return c.deleteEventsByConditions([]string{deviceNameCol, sourceNameCol}, []any{deviceName, sourceName})
+	return c.deleteEventsByConditions([]string{deviceNameCol, sourceNameCol}, pgx.NamedArgs{deviceNameCol: deviceName, sourceNameCol: sourceName})
 }
 
 // deleteEventsByConditions deletes specific device's events and corresponding readings
-func (c *Client) deleteEventsByConditions(cols []string, values []any) errors.EdgeX {
+func (c *Client) deleteEventsByConditions(cols []string, values pgx.NamedArgs) errors.EdgeX {
 	ctx := context.Background()
 
 	sqlStatement := sqlDeleteEventsByColumn(cols...)
@@ -226,12 +234,12 @@ func (c *Client) deleteEventsByConditions(cols []string, values []any) errors.Ed
 		pgxErr := pgx.BeginFunc(ctx, c.ConnPool, func(tx pgx.Tx) error {
 			// select the event-ids of the specified device name from event table as the sub-query of deleting readings
 			subSqlStatement := sqlQueryEventIdFieldsByCol(cols...)
-			if err = deleteReadingsBySubQuery(ctx, tx, subSqlStatement, values...); err != nil {
+			if err = deleteReadingsBySubQuery(ctx, tx, subSqlStatement, values); err != nil {
 				c.loggingClient.Errorf("failed delete readings with conditions '%v' '%v': %v", cols, values, err)
 				return err
 			}
 
-			err = deleteEvents(ctx, tx, sqlStatement, values...)
+			err = deleteEvents(ctx, tx, sqlStatement, values)
 			if err != nil {
 				c.loggingClient.Errorf("failed delete event with conditions '%v' '%v': %v", cols, values, err)
 				return err
@@ -267,28 +275,31 @@ func (c *Client) DeleteEventsByAge(age int64) errors.EdgeX {
 // DeleteEventsByAgeAndDeviceNameAndSourceName deletes events and their corresponding readings that are older than age
 // This function is implemented to starts up two goroutines to delete readings and events in the background to achieve better performance
 func (c *Client) DeleteEventsByAgeAndDeviceNameAndSourceName(age int64, deviceName, sourceName string) errors.EdgeX {
-	return c.deleteEventsByAgeAndConditions(age, []string{deviceNameCol, sourceNameCol}, []any{deviceName, sourceName})
+	return c.deleteEventsByAgeAndConditions(age, []string{deviceNameCol, sourceNameCol}, pgx.NamedArgs{deviceNameCol: deviceName, sourceNameCol: sourceName})
 }
 
 // deleteEventsByAgeAndConditions deletes events and their corresponding readings that are older than age
 // This function is implemented to starts up two goroutines to delete readings and events in the background to achieve better performance
-func (c *Client) deleteEventsByAgeAndConditions(age int64, cols []string, values []any) errors.EdgeX {
+func (c *Client) deleteEventsByAgeAndConditions(age int64, cols []string, values pgx.NamedArgs) errors.EdgeX {
 	ctx := context.Background()
 	expireTimestamp := time.Now().UnixNano() - age
+	if len(values) == 0 {
+		values = pgx.NamedArgs{}
+	}
+	values[endTimeCondition] = expireTimestamp
 	sqlStatement := sqlDeleteEventsByTimeRangeAndColumn(originCol, cols...)
-	args := append([]any{expireTimestamp}, values...)
 
 	go func() {
 		// delete events and readings in a transaction
 		_ = pgx.BeginFunc(ctx, c.ConnPool, func(tx pgx.Tx) error {
 			// select the event ids within the origin time range from event table as the sub-query of deleting readings
 			subSqlStatement := sqlQueryEventIdFieldByTimeRangeAndConditions(originCol, cols...)
-			if err := deleteReadingsBySubQuery(ctx, tx, subSqlStatement, args...); err != nil {
+			if err := deleteReadingsBySubQuery(ctx, tx, subSqlStatement, values); err != nil {
 				c.loggingClient.Errorf("failed delete readings by age '%d' nanoseconds: %v", age, err)
 				return err
 			}
 
-			err := deleteEvents(ctx, tx, sqlStatement, args...)
+			err := deleteEvents(ctx, tx, sqlStatement, values)
 			if err != nil {
 				c.loggingClient.Errorf("failed delete event by age '%d' nanoseconds: %v", age, err)
 				return err
@@ -301,8 +312,8 @@ func (c *Client) deleteEventsByAgeAndConditions(age int64, cols []string, values
 }
 
 // queryEvents queries the data rows with given sql statement and passed args, and unmarshal the data rows to the Event model slice
-func queryEvents(ctx context.Context, connPool *pgxpool.Pool, sql string, args ...any) ([]model.Event, errors.EdgeX) {
-	rows, err := connPool.Query(ctx, sql, args...)
+func queryEvents(ctx context.Context, connPool *pgxpool.Pool, sql string, args pgx.NamedArgs) ([]model.Event, errors.EdgeX) {
+	rows, err := connPool.Query(ctx, sql, args)
 	if err != nil {
 		return nil, pgClient.WrapDBError("query failed", err)
 	}
@@ -315,7 +326,7 @@ func queryEvents(ctx context.Context, connPool *pgxpool.Pool, sql string, args .
 		}
 
 		// query reading by the specific even_id and origin descending
-		readings, err := queryReadings(ctx, connPool, sqlQueryAllReadingAndDescWithConds(originCol, eventIdFKCol), event.Id)
+		readings, err := queryReadings(ctx, connPool, sqlQueryAllReadingAndDescWithConds(originCol, eventIdFKCol), pgx.NamedArgs{eventIdFKCol: event.Id})
 
 		if err != nil {
 			return model.Event{}, err
@@ -333,11 +344,11 @@ func queryEvents(ctx context.Context, connPool *pgxpool.Pool, sql string, args .
 }
 
 // deleteEvents delete the data rows with given sql statement and passed args in a db transaction
-func deleteEvents(ctx context.Context, tx pgx.Tx, sqlStatement string, args ...any) errors.EdgeX {
+func deleteEvents(ctx context.Context, tx pgx.Tx, sqlStatement string, args pgx.NamedArgs) errors.EdgeX {
 	commandTag, err := tx.Exec(
 		ctx,
 		sqlStatement,
-		args...,
+		args,
 	)
 	if err != nil {
 		return pgClient.WrapDBError("event(s) delete failed", err)
@@ -354,7 +365,7 @@ func (c *Client) LatestEventByDeviceNameAndSourceNameAndOffset(deviceName, sourc
 	events, err := queryEvents(
 		ctx, c.ConnPool,
 		sqlQueryAllEventAndDescWithCondsAndPage(originCol, deviceNameCol, sourceNameCol),
-		deviceName, sourceName, offset, 1,
+		pgx.NamedArgs{deviceNameCol: deviceName, sourceNameCol: sourceName, offsetCondition: offset, limitCondition: 1},
 	)
 	if err != nil {
 		return model.Event{}, errors.NewCommonEdgeX(errors.KindDatabaseError, "failed to query all events", err)
@@ -374,7 +385,10 @@ func (c *Client) LatestEventByDeviceNameAndSourceNameAndAgeAndOffset(deviceName,
 	sqlStmt := sqlQueryAllEventAndDescWithCondsAndPagAndUpperLimitTime(originCol, originCol, deviceNameCol, sourceNameCol)
 	events, err := queryEvents(
 		ctx, c.ConnPool, sqlStmt,
-		expireTimestamp, deviceName, sourceName, offset, 1,
+		pgx.NamedArgs{
+			endTimeCondition: expireTimestamp,
+			deviceNameCol:    deviceName, sourceNameCol: sourceName,
+			offsetCondition: offset, limitCondition: 1},
 	)
 	if err != nil {
 		return model.Event{}, errors.NewCommonEdgeX(errors.KindDatabaseError, "failed to query all events", err)
diff --git a/internal/pkg/infrastructure/postgres/keystore.go b/internal/pkg/infrastructure/postgres/keystore.go
index 8fd9953b..f5d312ea 100644
--- a/internal/pkg/infrastructure/postgres/keystore.go
+++ b/internal/pkg/infrastructure/postgres/keystore.go
@@ -15,6 +15,7 @@ import (
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/errors"
 
 	"github.com/google/uuid"
+	"github.com/jackc/pgx/v5"
 )
 
 // AddKey adds a new key to the database
@@ -49,7 +50,7 @@ func (c *Client) UpdateKey(name, content string) errors.EdgeX {
 func (c *Client) ReadKeyContent(name string) (string, errors.EdgeX) {
 	var fileContent string
 	row := c.ConnPool.QueryRow(context.Background(),
-		fmt.Sprintf("SELECT %s FROM %s WHERE %s = $1", contentCol, keyStoreTableName, nameCol), name)
+		fmt.Sprintf("SELECT %s FROM %s WHERE %s = @%s", contentCol, keyStoreTableName, nameCol, nameCol), pgx.NamedArgs{nameCol: name})
 	if err := row.Scan(&fileContent); err != nil {
 		return fileContent, pgClient.WrapDBError("failed to query key content", err)
 	}
diff --git a/internal/pkg/infrastructure/postgres/models/deviceinfo.go b/internal/pkg/infrastructure/postgres/models/deviceinfo.go
index 4f525ddb..2a846b3d 100644
--- a/internal/pkg/infrastructure/postgres/models/deviceinfo.go
+++ b/internal/pkg/infrastructure/postgres/models/deviceinfo.go
@@ -15,4 +15,5 @@ type DeviceInfo struct {
 	ValueType    string
 	Units        string
 	MediaType    string
+	MarkDeleted  bool
 }
diff --git a/internal/pkg/infrastructure/postgres/notification.go b/internal/pkg/infrastructure/postgres/notification.go
index a48b17c8..00e19371 100644
--- a/internal/pkg/infrastructure/postgres/notification.go
+++ b/internal/pkg/infrastructure/postgres/notification.go
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2024 IOTech Ltd
+// Copyright (C) 2024-2025 IOTech Ltd
 //
 // SPDX-License-Identifier: Apache-2.0
 
@@ -72,7 +72,8 @@ func (c *Client) NotificationsByCategory(offset, limit int, ack, category string
 		queryObj[acknowledgedField] = cast.ToBool(ack)
 	}
 
-	notifications, err := queryNotifications(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPagination(notificationTableName), queryObj, offset, validLimit)
+	notifications, err := queryNotifications(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(notificationTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query all notifications by category %s", category), err)
 	}
@@ -87,7 +88,8 @@ func (c *Client) NotificationsByLabel(offset, limit int, ack, label string) ([]m
 	if len(ack) != 0 {
 		queryObj[acknowledgedField] = cast.ToBool(ack)
 	}
-	notifications, err := queryNotifications(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPagination(notificationTableName), queryObj, offset, validLimit)
+	notifications, err := queryNotifications(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(notificationTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query all notifications by label %s", label), err)
 	}
@@ -103,7 +105,8 @@ func (c *Client) NotificationsByStatus(offset, limit int, ack, status string) ([
 		queryObj[acknowledgedField] = cast.ToBool(ack)
 	}
 
-	notifications, err := queryNotifications(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPagination(notificationTableName), queryObj, offset, validLimit)
+	notifications, err := queryNotifications(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(notificationTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query all notifications by status %s", status), err)
 	}
@@ -263,7 +266,8 @@ func (c *Client) NotificationTotalCount() (uint32, errors.EdgeX) {
 
 // LatestNotificationByOffset returns the latest notification by offset
 func (c *Client) LatestNotificationByOffset(offset uint32) (models.Notification, errors.EdgeX) {
-	notification, err := queryNotification(context.Background(), c.ConnPool, sqlQueryContentWithPagination(notificationTableName), offset, 1)
+	notification, err := queryNotification(context.Background(), c.ConnPool, sqlQueryContentWithPaginationAsNamedArgs(notificationTableName),
+		pgx.NamedArgs{offsetCondition: offset, limitCondition: 1})
 	if err != nil {
 		return notification, errors.NewCommonEdgeX(errors.Kind(err), "failed to query latest notification by offset", err)
 	}
@@ -313,14 +317,13 @@ func notificationsByTimeRange(connPool *pgxpool.Pool, start, end int64, offset,
 	if err != nil {
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
-	args := []any{validStart, validEnd}
+	args := pgx.NamedArgs{startTimeCondition: validStart, endTimeCondition: validEnd, offsetCondition: offset, limitCondition: validLimit}
 	if len(ack) != 0 {
-		args = append(args, map[string]any{acknowledgedField: cast.ToBool(ack)})
+		args[jsonContentCondition] = map[string]any{acknowledgedField: cast.ToBool(ack)}
 	} else {
-		args = append(args, map[string]any{})
+		args[jsonContentCondition] = map[string]any{}
 	}
-	args = append(args, offset, validLimit)
-	notifications, err := queryNotifications(context.Background(), connPool, sqlQueryContentWithTimeRangeAndPagination(notificationTableName), args...)
+	notifications, err := queryNotifications(context.Background(), connPool, sqlQueryContentWithTimeRangeAndPaginationAsNamedArgs(notificationTableName), args)
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all notifications by time range", err)
 	}
@@ -335,23 +338,23 @@ func notificationsByCategoriesAndLabels(connPool *pgxpool.Pool, offset, limit in
 	FROM (
 	    SELECT content, COALESCE((content->>'%s')::bigint, 0) AS sort_key
 			FROM %s 
-			WHERE (content ->> '%s') = ANY($1)
+			WHERE (content ->> '%s') = ANY(@%s)
 		UNION
 		SELECT content, COALESCE((content->>'%s')::bigint, 0) AS sort_key 
 			FROM %s 
-			WHERE (content -> '%s')::jsonb ?| $2::text[]
+			WHERE (content -> '%s')::jsonb ?| @%s::text[]
 	)
-	WHERE content @> $3::jsonb
-	ORDER BY sort_key OFFSET $4 LIMIT $5;
-	`, createdField, notificationTableName, categoryField, createdField, notificationTableName, labelsField)
-	args := []any{categories, labels}
+	WHERE content @> @%s::jsonb
+	ORDER BY sort_key OFFSET @%s LIMIT @%s;
+	`, createdField, notificationTableName, categoryField, categoryCondition, createdField,
+		notificationTableName, labelsField, labelsCondition, jsonContentCondition, offsetCondition, limitCondition)
+	args := pgx.NamedArgs{categoryCondition: categories, labelsCondition: labels, offsetCondition: offset, limitCondition: validLimit}
 	if len(ack) != 0 {
-		args = append(args, map[string]any{acknowledgedField: cast.ToBool(ack)})
+		args[jsonContentCondition] = map[string]any{acknowledgedField: cast.ToBool(ack)}
 	} else {
-		args = append(args, map[string]any{})
+		args[jsonContentCondition] = map[string]any{}
 	}
-	args = append(args, offset, validLimit)
-	notifications, err := queryNotifications(context.Background(), connPool, sql, args...)
+	notifications, err := queryNotifications(context.Background(), connPool, sql, args)
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all notifications by categories and labels", err)
 	}
@@ -362,29 +365,29 @@ func notificationsByCategoriesAndLabels(connPool *pgxpool.Pool, offset, limit in
 func notificationsByQueryConditions(connPool *pgxpool.Pool, offset, limit int, condition requests.NotificationQueryCondition, ack string) ([]models.Notification, errors.EdgeX) {
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 
-	args := []any{condition.Start, condition.End}
+	args := pgx.NamedArgs{startTimeCondition: condition.Start, endTimeCondition: condition.End, offsetCondition: offset, limitCondition: validLimit}
 	if len(ack) != 0 {
-		args = append(args, map[string]any{acknowledgedField: cast.ToBool(ack)})
+		args[jsonContentCondition] = map[string]any{acknowledgedField: cast.ToBool(ack)}
 	} else {
-		args = append(args, map[string]any{})
+		args[jsonContentCondition] = map[string]any{}
 	}
 	whereCategoryStatement := ""
 	if len(condition.Category) != 0 {
-		whereCategoryStatement = fmt.Sprintf("AND (content ->> '%s') = ANY($4)", categoryField)
-		args = append(args, condition.Category)
+		whereCategoryStatement = fmt.Sprintf("AND (content ->> '%s') = ANY(@%s)", categoryField, categoryCondition)
+		args[categoryCondition] = condition.Category
 	}
-	args = append(args, offset, validLimit)
 
 	sql := fmt.Sprintf(
 		`SELECT content FROM %s 
-               WHERE COALESCE((content->>'%s')::bigint, 0) BETWEEN $1 AND $2 
-               AND content @> $3::jsonb 
+               WHERE COALESCE((content->>'%s')::bigint, 0) BETWEEN @%s AND @%s 
+               AND content @> @%s::jsonb 
                %s
                ORDER BY COALESCE((content->>'%s')::bigint, 0) 
-               OFFSET $%d LIMIT $%d`,
-		notificationTableName, createdField, whereCategoryStatement, createdField, len(args)-1, len(args))
+               OFFSET @%s LIMIT @%s`,
+		notificationTableName, createdField, startTimeCondition, endTimeCondition, jsonContentCondition,
+		whereCategoryStatement, createdField, offsetCondition, limitCondition)
 
-	notifications, err := queryNotifications(context.Background(), connPool, sql, args...)
+	notifications, err := queryNotifications(context.Background(), connPool, sql, args)
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all notifications by query conditions", err)
 	}
diff --git a/internal/pkg/infrastructure/postgres/provision_watcher.go b/internal/pkg/infrastructure/postgres/provision_watcher.go
index 00e1226a..b6a5fa1d 100644
--- a/internal/pkg/infrastructure/postgres/provision_watcher.go
+++ b/internal/pkg/infrastructure/postgres/provision_watcher.go
@@ -84,7 +84,8 @@ func (c *Client) ProvisionWatchersByServiceName(offset int, limit int, name stri
 	ctx := context.Background()
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{serviceNameField: name}
-	return queryProvisionWatchers(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(provisionWatcherTableName), queryObj, offset, validLimit)
+	return queryProvisionWatchers(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(provisionWatcherTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 }
 
 // ProvisionWatchersByProfileName query provision watchers by offset, limit and profile name
@@ -92,7 +93,8 @@ func (c *Client) ProvisionWatchersByProfileName(offset int, limit int, name stri
 	ctx := context.Background()
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{"DiscoveredDevice": map[string]any{profileNameField: name}}
-	return queryProvisionWatchers(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(provisionWatcherTableName), queryObj, offset, validLimit)
+	return queryProvisionWatchers(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(provisionWatcherTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 }
 
 // AllProvisionWatchers query provision watchers with offset, limit and labels
@@ -103,7 +105,8 @@ func (c *Client) AllProvisionWatchers(offset int, limit int, labels []string) (p
 	if len(labels) > 0 {
 		c.loggingClient.Debugf("Querying provision watchers by labels: %v", labels)
 		queryObj := map[string]any{labelsField: labels}
-		pws, err = queryProvisionWatchers(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(provisionWatcherTableName), queryObj, offset, validLimit)
+		pws, err = queryProvisionWatchers(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(provisionWatcherTableName),
+			pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 		if err != nil {
 			return pws, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all provision watchers by labels", err)
 		}
diff --git a/internal/pkg/infrastructure/postgres/reading.go b/internal/pkg/infrastructure/postgres/reading.go
index 916e39f7..3fddae70 100644
--- a/internal/pkg/infrastructure/postgres/reading.go
+++ b/internal/pkg/infrastructure/postgres/reading.go
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2024 IOTech Ltd
+// Copyright (C) 2024-2025 IOTech Ltd
 //
 // SPDX-License-Identifier: Apache-2.0
 
@@ -27,7 +27,7 @@ var (
 )
 
 func (c *Client) ReadingTotalCount() (uint32, errors.EdgeX) {
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCount(readingTableName))
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountReading())
 }
 
 func (c *Client) AllReadings(offset int, limit int) ([]model.Reading, errors.EdgeX) {
@@ -35,7 +35,7 @@ func (c *Client) AllReadings(offset int, limit int) ([]model.Reading, errors.Edg
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 
 	// query reading by origin descending with offset & limit
-	readings, err := queryReadings(ctx, c.ConnPool, sqlQueryAllReadingWithPaginationDescByCol(originCol), offset, validLimit)
+	readings, err := queryReadings(ctx, c.ConnPool, sqlQueryAllReadingWithPaginationDescByCol(originCol), pgx.NamedArgs{offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.KindDatabaseError, "failed to query all readings", err)
 	}
@@ -50,7 +50,8 @@ func (c *Client) ReadingsByResourceName(offset int, limit int, resourceName stri
 	// query reading by the resourceName and origin descending
 	sqlStatement := sqlQueryAllReadingAndDescWithCondsAndPag(originCol, resourceNameCol)
 
-	readings, err := queryReadings(context.Background(), c.ConnPool, sqlStatement, resourceName, offset, validLimit)
+	readings, err := queryReadings(context.Background(), c.ConnPool, sqlStatement,
+		pgx.NamedArgs{resourceNameCol: resourceName, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.KindDatabaseError, fmt.Sprintf("failed to query readings by resource '%s'", resourceName), err)
 	}
@@ -64,7 +65,8 @@ func (c *Client) ReadingsByDeviceName(offset int, limit int, name string) ([]mod
 	// query reading by the deviceName and origin descending
 	sqlStatement := sqlQueryAllReadingAndDescWithCondsAndPag(originCol, deviceNameCol)
 
-	readings, err := queryReadings(context.Background(), c.ConnPool, sqlStatement, name, offset, validLimit)
+	readings, err := queryReadings(context.Background(), c.ConnPool, sqlStatement,
+		pgx.NamedArgs{deviceNameCol: name, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.KindDatabaseError, fmt.Sprintf("failed to query readings by device '%s'", name), err)
 	}
@@ -78,7 +80,8 @@ func (c *Client) ReadingsByDeviceNameAndResourceName(deviceName string, resource
 	// query reading by the deviceName/resourceName and origin descending
 	sqlStatement := sqlQueryAllReadingAndDescWithCondsAndPag(originCol, deviceNameCol, resourceNameCol)
 
-	readings, err := queryReadings(context.Background(), c.ConnPool, sqlStatement, deviceName, resourceName, offset, validLimit)
+	readings, err := queryReadings(context.Background(), c.ConnPool, sqlStatement,
+		pgx.NamedArgs{deviceNameCol: deviceName, resourceNameCol: resourceName, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.KindDatabaseError,
 			fmt.Sprintf("failed to query readings by device '%s' and resource '%s'", deviceName, resourceName), err)
@@ -92,7 +95,9 @@ func (c *Client) ReadingsByTimeRange(start int64, end int64, offset int, limit i
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	sqlStatement := sqlQueryAllReadingWithPaginationAndTimeRangeDescByCol(originCol, originCol, nil)
 
-	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement, start, end, offset, validLimit)
+	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement,
+		pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end,
+			offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
@@ -105,7 +110,9 @@ func (c *Client) ReadingsByDeviceNameAndTimeRange(deviceName string, start int64
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	sqlStatement := sqlQueryAllReadingWithPaginationAndTimeRangeDescByCol(originCol, originCol, nil, deviceNameCol)
 
-	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement, start, end, deviceName, offset, validLimit)
+	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement,
+		pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end,
+			deviceNameCol: deviceName, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
@@ -118,7 +125,9 @@ func (c *Client) ReadingsByResourceNameAndTimeRange(resourceName string, start i
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	sqlStatement := sqlQueryAllReadingWithPaginationAndTimeRangeDescByCol(originCol, originCol, nil, resourceNameCol)
 
-	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement, start, end, resourceName, offset, validLimit)
+	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement,
+		pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end,
+			resourceNameCol: resourceName, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
@@ -131,7 +140,9 @@ func (c *Client) ReadingsByDeviceNameAndResourceNameAndTimeRange(deviceName stri
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	sqlStatement := sqlQueryAllReadingWithPaginationAndTimeRangeDescByCol(originCol, originCol, nil, deviceNameCol, resourceNameCol)
 
-	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement, start, end, deviceName, resourceName, offset, validLimit)
+	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement,
+		pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end,
+			deviceNameCol: deviceName, resourceNameCol: resourceName, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
@@ -147,9 +158,10 @@ func (c *Client) ReadingsByDeviceNameAndResourceNamesAndTimeRange(deviceName str
 		[]string{resourceNameCol}, deviceNameCol, resourceNameCol)
 
 	// build the query args for the where condition using in querying readings
-	queryArgs := []any{start, end, deviceName, resourceNames, offset, validLimit}
+	queryArgs := pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end,
+		deviceNameCol: deviceName, resourceNameCol: resourceNames, offsetCondition: offset, limitCondition: validLimit}
 	// query readings
-	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement, queryArgs...)
+	readings, err := queryReadings(ctx, c.ConnPool, sqlStatement, queryArgs)
 	if err != nil {
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
@@ -161,36 +173,38 @@ func (c *Client) ReadingsByDeviceNameAndResourceNamesAndTimeRange(deviceName str
 func (c *Client) ReadingCountByDeviceName(deviceName string) (uint32, errors.EdgeX) {
 	sqlStatement := sqlQueryCountReadingByCol(deviceNameCol)
 
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, deviceName)
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, pgx.NamedArgs{deviceNameCol: deviceName})
 }
 
 // ReadingCountByResourceName returns the count of Readings associated a specific resource from db
 func (c *Client) ReadingCountByResourceName(resourceName string) (uint32, errors.EdgeX) {
 	sqlStatement := sqlQueryCountReadingByCol(resourceNameCol)
 
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, resourceName)
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, pgx.NamedArgs{resourceNameCol: resourceName})
 }
 
 // ReadingCountByDeviceNameAndResourceName returns the count of readings associated a specific device and resource values from db
 func (c *Client) ReadingCountByDeviceNameAndResourceName(deviceName string, resourceName string) (uint32, errors.EdgeX) {
 	sqlStatement := sqlQueryCountReadingByCol(deviceNameCol, resourceNameCol)
 
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, deviceName, resourceName)
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlStatement, pgx.NamedArgs{deviceNameCol: deviceName, resourceNameCol: resourceName})
 }
 
 // ReadingCountByTimeRange returns the count of reading by origin within the time range from db
 func (c *Client) ReadingCountByTimeRange(start int64, end int64) (uint32, errors.EdgeX) {
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountReadingByTimeRangeCol(originCol, nil), start, end)
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountReadingByTimeRangeCol(originCol, nil), pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end})
 }
 
 // ReadingCountByDeviceNameAndTimeRange returns the count of readings by origin within the time range and the specified device from db
 func (c *Client) ReadingCountByDeviceNameAndTimeRange(deviceName string, start int64, end int64) (uint32, errors.EdgeX) {
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountReadingByTimeRangeCol(originCol, nil, deviceNameCol), start, end, deviceName)
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountReadingByTimeRangeCol(originCol, nil, deviceNameCol),
+		pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end, deviceNameCol: deviceName})
 }
 
 // ReadingCountByResourceNameAndTimeRange returns the count of readings by origin within the time range and the specified resource from db
 func (c *Client) ReadingCountByResourceNameAndTimeRange(resourceName string, start int64, end int64) (uint32, errors.EdgeX) {
-	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountReadingByTimeRangeCol(originCol, nil, resourceNameCol), start, end, resourceName)
+	return getTotalRowsCount(context.Background(), c.ConnPool, sqlQueryCountReadingByTimeRangeCol(originCol, nil, resourceNameCol),
+		pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end, resourceNameCol: resourceName})
 }
 
 // ReadingCountByDeviceNameAndResourceNameAndTimeRange returns the count of readings by origin within the time range
@@ -199,10 +213,7 @@ func (c *Client) ReadingCountByDeviceNameAndResourceNameAndTimeRange(deviceName
 	return getTotalRowsCount(context.Background(),
 		c.ConnPool,
 		sqlQueryCountReadingByTimeRangeCol(originCol, nil, deviceNameCol, resourceNameCol),
-		start,
-		end,
-		deviceName,
-		resourceName)
+		pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end, deviceNameCol: deviceName, resourceNameCol: resourceName})
 }
 
 // ReadingCountByDeviceNameAndResourceNamesAndTimeRange returns the count of readings by origin within the time range
@@ -211,13 +222,13 @@ func (c *Client) ReadingCountByDeviceNameAndResourceNamesAndTimeRange(deviceName
 	return getTotalRowsCount(context.Background(),
 		c.ConnPool,
 		sqlQueryCountReadingByTimeRangeCol(originCol, []string{resourceNameCol}, deviceNameCol, resourceNameCol),
-		start, end, deviceName, resourceNames)
+		pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end, deviceNameCol: deviceName, resourceNameCol: resourceNames})
 }
 
 func (c *Client) LatestReadingByOffset(offset uint32) (model.Reading, errors.EdgeX) {
 	ctx := context.Background()
 
-	readings, err := queryReadings(ctx, c.ConnPool, sqlQueryAllReadingWithPaginationDescByCol(originCol), offset, 1)
+	readings, err := queryReadings(ctx, c.ConnPool, sqlQueryAllReadingWithPaginationDescByCol(originCol), pgx.NamedArgs{offsetCondition: offset, limitCondition: 1})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.KindDatabaseError, "failed to query all readings", err)
 	}
@@ -229,8 +240,8 @@ func (c *Client) LatestReadingByOffset(offset uint32) (model.Reading, errors.Edg
 }
 
 // queryReadings queries the data rows with given sql statement and passed args, converts the rows to map and unmarshal the data rows to the Reading model slice
-func queryReadings(ctx context.Context, connPool *pgxpool.Pool, sql string, args ...any) ([]model.Reading, errors.EdgeX) {
-	rows, err := connPool.Query(ctx, sql, args...)
+func queryReadings(ctx context.Context, connPool *pgxpool.Pool, sql string, args pgx.NamedArgs) ([]model.Reading, errors.EdgeX) {
+	rows, err := connPool.Query(ctx, sql, args)
 	if err != nil {
 		return nil, pgClient.WrapDBError("query failed", err)
 	}
@@ -293,7 +304,7 @@ func deleteReadingsByOriginAndEventId(ctx context.Context, tx pgx.Tx, origin int
 	commandTag, err := tx.Exec(
 		ctx,
 		sqlStatement,
-		origin, eventId,
+		pgx.NamedArgs{endTimeCondition: origin, eventIdFKCol: eventId},
 	)
 	if commandTag.RowsAffected() == 0 {
 		return errors.NewCommonEdgeX(errors.KindContractInvalid, "no reading found", nil)
@@ -305,7 +316,7 @@ func deleteReadingsByOriginAndEventId(ctx context.Context, tx pgx.Tx, origin int
 }
 
 // deleteReadingsBySubQuery delete the readings with event_id in the range of the sub query
-func deleteReadingsBySubQuery(ctx context.Context, tx pgx.Tx, subQuerySql string, args ...any) errors.EdgeX {
+func deleteReadingsBySubQuery(ctx context.Context, tx pgx.Tx, subQuerySql string, args pgx.NamedArgs) errors.EdgeX {
 	sqlStatement := sqlDeleteByColumns(readingTableName, eventIdFKCol)
 	subQueryCond := "ANY ( " + subQuerySql + " )"
 	sqlStatement = strings.Replace(sqlStatement, "$1", subQueryCond, 1)
@@ -313,7 +324,7 @@ func deleteReadingsBySubQuery(ctx context.Context, tx pgx.Tx, subQuerySql string
 	commandTag, err := tx.Exec(
 		ctx,
 		sqlStatement,
-		args...,
+		args,
 	)
 	if commandTag.RowsAffected() == 0 {
 		return errors.NewCommonEdgeX(errors.KindContractInvalid, "no reading found", nil)
diff --git a/internal/pkg/infrastructure/postgres/scheduleactionrecord.go b/internal/pkg/infrastructure/postgres/scheduleactionrecord.go
index 26e53936..ced92f17 100644
--- a/internal/pkg/infrastructure/postgres/scheduleactionrecord.go
+++ b/internal/pkg/infrastructure/postgres/scheduleactionrecord.go
@@ -9,6 +9,7 @@ import (
 	"context"
 	"encoding/json"
 	"fmt"
+	"github.com/jackc/pgx/v5"
 	"time"
 
 	"github.com/google/uuid"
@@ -50,7 +51,8 @@ func (c *Client) AllScheduleActionRecords(ctx context.Context, start, end int64,
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
 
-	records, err := queryScheduleActionRecords(ctx, c.ConnPool, sqlQueryAllWithPaginationAndTimeRange(scheduleActionRecordTableName), startTime, endTime, offset, validLimit)
+	records, err := queryScheduleActionRecords(ctx, c.ConnPool, sqlQueryAllWithPaginationAndTimeRangeAsNamedArgs(scheduleActionRecordTableName),
+		pgx.NamedArgs{startTimeCondition: startTime, endTimeCondition: endTime, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all schedule action records", err)
 	}
@@ -85,7 +87,7 @@ func (c *Client) LatestScheduleActionRecordsByJobName(ctx context.Context, jobNa
 
 // LatestScheduleActionRecordsByOffset queries the latest schedule action records by offset
 func (c *Client) LatestScheduleActionRecordsByOffset(ctx context.Context, offset uint32) (model.ScheduleActionRecord, errors.EdgeX) {
-	records, err := queryScheduleActionRecords(ctx, c.ConnPool, sqlQueryAllWithPaginationDescByCol(scheduleActionRecordTableName, createdCol), offset, 1)
+	records, err := queryScheduleActionRecords(ctx, c.ConnPool, sqlQueryAllWithPaginationDescByCol(scheduleActionRecordTableName, createdCol), pgx.NamedArgs{offsetCondition: offset, limitCondition: 1})
 	if err != nil {
 		return model.ScheduleActionRecord{}, errors.NewCommonEdgeX(errors.KindDatabaseError, "failed to query all schedule action records", err)
 	}
@@ -120,7 +122,8 @@ func (c *Client) ScheduleActionRecordsByJobName(ctx context.Context, jobName str
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
 
-	records, err := queryScheduleActionRecords(ctx, c.ConnPool, sqlQueryAllByColWithPaginationAndTimeRange(scheduleActionRecordTableName, jobNameCol), jobName, startTime, endTime, offset, validLimit)
+	records, err := queryScheduleActionRecords(ctx, c.ConnPool, sqlQueryAllByColWithPaginationAndTimeRange(scheduleActionRecordTableName, jobNameCol),
+		pgx.NamedArgs{jobNameCol: jobName, startTimeCondition: startTime, endTimeCondition: endTime, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query schedule action records by job name %s", jobName), err)
 	}
@@ -136,7 +139,8 @@ func (c *Client) ScheduleActionRecordsByJobNameAndStatus(ctx context.Context, jo
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
 
-	records, err := queryScheduleActionRecords(ctx, c.ConnPool, sqlQueryAllByColWithPaginationAndTimeRange(scheduleActionRecordTableName, jobNameCol, statusCol), jobName, status, startTime, endTime, offset, validLimit)
+	records, err := queryScheduleActionRecords(ctx, c.ConnPool, sqlQueryAllByColWithPaginationAndTimeRange(scheduleActionRecordTableName, jobNameCol, statusCol),
+		pgx.NamedArgs{jobNameCol: jobName, statusCol: status, startTimeCondition: startTime, endTimeCondition: endTime, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query schedule action records by job name %s and status %s", jobName, status), err)
 	}
@@ -147,25 +151,26 @@ func (c *Client) ScheduleActionRecordsByJobNameAndStatus(ctx context.Context, jo
 // ScheduleActionRecordTotalCount returns the total count of all the schedule action records
 func (c *Client) ScheduleActionRecordTotalCount(ctx context.Context, start, end int64) (uint32, errors.EdgeX) {
 	startTime, endTime := getUTCStartAndEndTime(start, end)
-	return getTotalRowsCount(ctx, c.ConnPool, sqlQueryCountByTimeRangeCol(scheduleActionRecordTableName, createdCol, nil), startTime, endTime)
+	return getTotalRowsCount(ctx, c.ConnPool, sqlQueryCountByTimeRangeCol(scheduleActionRecordTableName, createdCol, nil), pgx.NamedArgs{startTimeCondition: startTime, endTimeCondition: endTime})
 }
 
 // ScheduleActionRecordCountByStatus returns the total count of the schedule action records by status
 func (c *Client) ScheduleActionRecordCountByStatus(ctx context.Context, status string, start, end int64) (uint32, errors.EdgeX) {
 	startTime, endTime := getUTCStartAndEndTime(start, end)
-	return getTotalRowsCount(ctx, c.ConnPool, sqlQueryCountByTimeRangeCol(scheduleActionRecordTableName, createdCol, nil, statusCol), startTime, endTime, status)
+	return getTotalRowsCount(ctx, c.ConnPool, sqlQueryCountByTimeRangeCol(scheduleActionRecordTableName, createdCol, nil, statusCol), pgx.NamedArgs{statusCol: status, startTimeCondition: startTime, endTimeCondition: endTime})
 }
 
 // ScheduleActionRecordCountByJobName returns the total count of the schedule action records by job name
 func (c *Client) ScheduleActionRecordCountByJobName(ctx context.Context, jobName string, start, end int64) (uint32, errors.EdgeX) {
 	startTime, endTime := getUTCStartAndEndTime(start, end)
-	return getTotalRowsCount(ctx, c.ConnPool, sqlQueryCountByTimeRangeCol(scheduleActionRecordTableName, createdCol, nil, jobNameCol), startTime, endTime, jobName)
+	return getTotalRowsCount(ctx, c.ConnPool, sqlQueryCountByTimeRangeCol(scheduleActionRecordTableName, createdCol, nil, jobNameCol), pgx.NamedArgs{jobNameCol: jobName, startTimeCondition: startTime, endTimeCondition: endTime})
 }
 
 // ScheduleActionRecordCountByJobNameAndStatus returns the total count of the schedule action records by job name and status
 func (c *Client) ScheduleActionRecordCountByJobNameAndStatus(ctx context.Context, jobName, status string, start, end int64) (uint32, errors.EdgeX) {
 	startTime, endTime := getUTCStartAndEndTime(start, end)
-	return getTotalRowsCount(ctx, c.ConnPool, sqlQueryCountByTimeRangeCol(scheduleActionRecordTableName, createdCol, nil, jobNameCol, statusCol), startTime, endTime, jobName, status)
+	return getTotalRowsCount(ctx, c.ConnPool, sqlQueryCountByTimeRangeCol(scheduleActionRecordTableName, createdCol, nil, jobNameCol, statusCol),
+		pgx.NamedArgs{jobNameCol: jobName, statusCol: status, startTimeCondition: startTime, endTimeCondition: endTime})
 }
 
 // DeleteScheduleActionRecordByAge deletes the schedule action records by age
diff --git a/internal/pkg/infrastructure/postgres/schedulejob.go b/internal/pkg/infrastructure/postgres/schedulejob.go
index 72d1fe68..00033bf5 100644
--- a/internal/pkg/infrastructure/postgres/schedulejob.go
+++ b/internal/pkg/infrastructure/postgres/schedulejob.go
@@ -40,12 +40,13 @@ func (c *Client) AllScheduleJobs(ctx context.Context, labels []string, offset, l
 	if len(labels) > 0 {
 		c.loggingClient.Debugf("Querying schedule jobs by labels: %v", labels)
 		queryObj := map[string]any{labelsField: labels}
-		jobs, err = queryScheduleJobs(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPagination(scheduleJobTableName), queryObj, offset, validLimit)
+		jobs, err = queryScheduleJobs(ctx, c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(scheduleJobTableName),
+			pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 		if err != nil {
 			return nil, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all schedule jobs by labels", err)
 		}
 	} else {
-		jobs, err = queryScheduleJobs(ctx, c.ConnPool, sqlQueryContentWithPagination(scheduleJobTableName), offset, validLimit)
+		jobs, err = queryScheduleJobs(ctx, c.ConnPool, sqlQueryContentWithPaginationAsNamedArgs(scheduleJobTableName), pgx.NamedArgs{offsetCondition: offset, limitCondition: validLimit})
 		if err != nil {
 			return nil, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all schedule jobs", err)
 		}
diff --git a/internal/pkg/infrastructure/postgres/sql.go b/internal/pkg/infrastructure/postgres/sql.go
index 7a3d10d9..0702a512 100644
--- a/internal/pkg/infrastructure/postgres/sql.go
+++ b/internal/pkg/infrastructure/postgres/sql.go
@@ -41,11 +41,6 @@ func sqlInsert(table string, columns ...string) string {
 // SQL statements for SELECT operations
 // ----------------------------------------------------------------------------------
 
-// sqlQueryAll returns the SQL statement for selecting all rows from the table.
-//func sqlQueryAll(table string) string {
-//	return fmt.Sprintf("SELECT * FROM %s", table)
-//}
-
 // sqlQueryFieldsByCol returns the SQL statement for selecting the given fields of rows from the table by the conditions composed of given columns
 func sqlQueryFieldsByCol(table string, fields []string, columns ...string) string {
 	whereCondition := constructWhereCondition(columns...)
@@ -56,7 +51,7 @@ func sqlQueryFieldsByCol(table string, fields []string, columns ...string) strin
 
 // sqlQueryEventIdFieldsByCol returns the SQL statement for selecting the event.id of rows from the event table by the conditions composed of given columns
 func sqlQueryEventIdFieldsByCol(columns ...string) string {
-	whereCondition := constructWhereCondition(columns...)
+	whereCondition := constructWhereNamedArgCondition(columns...)
 
 	return fmt.Sprintf("SELECT event.id FROM %s JOIN %s on event.device_info_id = device_info.id WHERE %s", eventTableName, deviceInfoTableName, whereCondition)
 }
@@ -69,123 +64,99 @@ func sqlQueryFieldsByColAndLikePat(table string, fields []string, columns ...str
 	return fmt.Sprintf("SELECT %s FROM %s WHERE %s", queryFieldStr, table, whereCondition)
 }
 
-// sqlQueryAllWithTimeRange returns the SQL statement for selecting all rows from the table with a time range.
-//func sqlQueryAllWithTimeRange(table string) string {
-//	return fmt.Sprintf("SELECT * FROM %s WHERE %s >= $1 AND %s <= $2", table, createdCol, createdCol)
-//}
-
-// sqlQueryAllWithPaginationDesc returns the SQL statement for selecting all rows from the table with pagination by created timestamp in descending order.
-//func sqlQueryAllWithPaginationDesc(table string) string {
-//	return fmt.Sprintf("SELECT * FROM %s ORDER BY %s DESC OFFSET $1 LIMIT $2", table, createdCol)
-//}
-
-// sqlQueryAllWithConds returns the SQL statement for selecting all rows from the table by the given columns composed of the where condition
-func sqlQueryAllWithConds(table string, columns ...string) string {
-	whereCondition := constructWhereCondition(columns...)
+// sqlQueryAllWithNamedArgConds returns the SQL statement for selecting all rows from the table by the given columns composed of the where condition
+func sqlQueryAllWithNamedArgConds(table string, columns ...string) string {
+	whereCondition := constructWhereNamedArgCondition(columns...)
 
 	return fmt.Sprintf("SELECT * FROM %s WHERE %s", table, whereCondition)
 }
 
 // sqlQueryAllWithPaginationDescByCol returns the SQL statement for selecting all rows from the table with the pagination and desc by descCol
 func sqlQueryAllWithPaginationDescByCol(table string, descCol string) string {
-	return fmt.Sprintf("SELECT * FROM %s ORDER BY %s DESC OFFSET $1 LIMIT $2", table, descCol)
+	return fmt.Sprintf("SELECT * FROM %s ORDER BY %s DESC OFFSET @%s LIMIT @%s", table, descCol, offsetCondition, limitCondition)
 }
 
 // sqlQueryAllEventWithPaginationDescByCol returns the SQL statement for selecting all rows from the event table with the pagination and desc by descCol
 func sqlQueryAllEventWithPaginationDescByCol(descCol string) string {
-	return fmt.Sprintf("SELECT %s FROM %s JOIN %s on event.device_info_id = device_info.id ORDER BY %s DESC OFFSET $1 LIMIT $2", eventColumns, eventTableName, deviceInfoTableName, descCol)
+	return fmt.Sprintf("SELECT %s FROM %s JOIN %s on event.device_info_id = device_info.id WHERE %s = false ORDER BY %s DESC OFFSET @%s LIMIT @%s", eventColumns, eventTableName, deviceInfoTableName, markDeletedCol, descCol, offsetCondition, limitCondition)
 }
 
 // sqlQueryAllReadingWithPaginationDescByCol returns the SQL statement for selecting all rows from the reading table with the pagination and desc by descCol
 func sqlQueryAllReadingWithPaginationDescByCol(descCol string) string {
-	return fmt.Sprintf("SELECT %s FROM %s JOIN %s on reading.device_info_id = device_info.id ORDER BY %s DESC OFFSET $1 LIMIT $2", readingColumns, readingTableName, deviceInfoTableName, descCol)
+	return fmt.Sprintf("SELECT %s FROM %s JOIN %s on reading.device_info_id = device_info.id WHERE %s = false ORDER BY %s DESC OFFSET @%s LIMIT @%s", readingColumns, readingTableName, deviceInfoTableName, markDeletedCol, descCol, offsetCondition, limitCondition)
 }
 
 // sqlQueryAllReadingAndDescWithConds returns the SQL statement for selecting all rows from the table by the given columns composed of the where condition with descending by descCol
 func sqlQueryAllReadingAndDescWithConds(descCol string, columns ...string) string {
-	whereCondition := constructWhereCondition(columns...)
+	whereCondition := constructWhereNamedArgCondition(columns...)
 
-	return fmt.Sprintf("SELECT %s FROM %s JOIN %s on reading.device_info_id = device_info.id WHERE %s ORDER BY %s DESC", readingColumns, readingTableName, deviceInfoTableName, whereCondition, descCol)
+	return fmt.Sprintf("SELECT %s FROM %s JOIN %s on reading.device_info_id = device_info.id WHERE %s = false AND %s ORDER BY %s DESC", readingColumns, readingTableName, deviceInfoTableName, markDeletedCol, whereCondition, descCol)
 }
 
 // sqlQueryAllEventAndDescWithCondsAndPage returns the SQL statement for selecting all rows from the event table by the given columns composed of the where condition
 // with descending by descCol and pagination
 func sqlQueryAllEventAndDescWithCondsAndPage(descCol string, columns ...string) string {
-	columnCount := len(columns)
-	whereCondition := constructWhereCondition(columns...)
+	whereCondition := constructWhereNamedArgCondition(columns...)
 
 	return fmt.Sprintf(
-		"SELECT %s FROM %s join %s on event.device_info_id = device_info.id WHERE %s ORDER BY %s DESC OFFSET $%d LIMIT $%d",
-		eventColumns, eventTableName, deviceInfoTableName,
+		"SELECT %s FROM %s join %s on event.device_info_id = device_info.id WHERE %s = false AND %s ORDER BY %s DESC OFFSET @%s LIMIT @%s",
+		eventColumns, eventTableName, deviceInfoTableName, markDeletedCol,
 		whereCondition, descCol,
-		// note that this is a prepared statement with parameters beginning with count WHERE
-		// conditions, so adding 1 and 2 for OFFSET, LIMIT parameters, respectively
-		columnCount+1, columnCount+2)
+		offsetCondition, limitCondition)
 }
 
 // sqlQueryAllReadingAndDescWithCondsAndPag returns the SQL statement for selecting all rows from the reading table by the given columns composed of the where condition
 // with descending by descCol and pagination
 func sqlQueryAllReadingAndDescWithCondsAndPag(descCol string, columns ...string) string {
-	columnCount := len(columns)
-	whereCondition := constructWhereCondition(columns...)
+	whereCondition := constructWhereNamedArgCondition(columns...)
 
 	return fmt.Sprintf(
-		"SELECT %s FROM %s join %s on reading.device_info_id = device_info.id WHERE %s ORDER BY %s DESC OFFSET $%d LIMIT $%d",
-		readingColumns, readingTableName, deviceInfoTableName,
+		"SELECT %s FROM %s join %s on reading.device_info_id = device_info.id WHERE %s = false AND %s ORDER BY %s DESC OFFSET @%s LIMIT @%s",
+		readingColumns, readingTableName, deviceInfoTableName, markDeletedCol,
 		whereCondition, descCol,
-		// note that this is a prepared statement with parameters beginning with count WHERE
-		// conditions, so adding 1 and 2 for OFFSET, LIMIT parameters, respectively
-		columnCount+1, columnCount+2)
+		offsetCondition, limitCondition)
 }
 
 // sqlQueryAllEventAndDescWithCondsAndPagAndUpperLimitTime returns the SQL statement for selecting all rows from the event table by the given columns composed of the where condition
 // with descending by descCol and pagination
 func sqlQueryAllEventAndDescWithCondsAndPagAndUpperLimitTime(descCol string, upperLimitTimeRangeCol string, columns ...string) string {
-	columnCount := len(columns)
-	whereCondition := constructWhereCondWithTimeRange("", upperLimitTimeRangeCol, nil, columns...)
+	whereCondition := constructWhereNamedArgCondWithTimeRange("", upperLimitTimeRangeCol, nil, columns...)
 
 	return fmt.Sprintf(
-		"SELECT %s FROM %s join %s on event.device_info_id = device_info.id WHERE %s ORDER BY %s DESC OFFSET $%d LIMIT $%d",
-		eventColumns, eventTableName, deviceInfoTableName,
+		"SELECT %s FROM %s join %s on event.device_info_id = device_info.id WHERE %s = false AND %s ORDER BY %s DESC OFFSET @%s LIMIT @%s",
+		eventColumns, eventTableName, deviceInfoTableName, markDeletedCol,
 		whereCondition, descCol,
-		// note that this is a prepared statement with parameters beginning with UpperLimitTime
-		// and then columns conditions, so adding 2 and 3 for OFFSET, LIMIT parameters, respectively
-		columnCount+2, columnCount+3)
+		offsetCondition, limitCondition)
 }
 
-// sqlQueryAllWithPaginationAndTimeRange returns the SQL statement for selecting all rows from the table with pagination and a time range.
-func sqlQueryAllWithPaginationAndTimeRange(table string) string {
-	return fmt.Sprintf("SELECT * FROM %s WHERE %s >= $1 AND %s <= $2 ORDER BY %s OFFSET $3 LIMIT $4", table, createdCol, createdCol, createdCol)
+// sqlQueryAllWithPaginationAndTimeRangeAsNamedArgs returns the SQL statement for selecting all rows from the table with pagination and a time range.
+func sqlQueryAllWithPaginationAndTimeRangeAsNamedArgs(table string) string {
+	return fmt.Sprintf("SELECT * FROM %s WHERE %s >= @%s AND %s <= @%s ORDER BY %s OFFSET @%s LIMIT @%s",
+		table, createdCol, startTimeCondition, createdCol, endTimeCondition, createdCol, offsetCondition, limitCondition)
 }
 
 // sqlQueryAllEventWithPaginationAndTimeRangeDescByCol returns the SQL statement for selecting all rows from the event table with the arrayColNames slice,
 // provided columns with pagination and a time range by timeRangeCol, desc by descCol
-func sqlQueryAllEventWithPaginationAndTimeRangeDescByCol(timeRangeCol string, descCol string, arrayColNames []string, columns ...string) string {
-	whereCondition := constructWhereCondWithTimeRange(timeRangeCol, timeRangeCol, arrayColNames, columns...)
-	columnCount := len(columns)
+func sqlQueryAllEventWithPaginationAndTimeRangeDescByCol(timeRangeCol string, descCol string) string {
+	whereCondition := constructWhereNamedArgCondWithTimeRange(timeRangeCol, timeRangeCol, nil)
 
 	return fmt.Sprintf(
-		"SELECT %s FROM %s join %s on event.device_info_id = device_info.id WHERE %s ORDER BY %s DESC OFFSET $%d LIMIT $%d",
-		eventColumns, eventTableName, deviceInfoTableName,
+		"SELECT %s FROM %s join %s on event.device_info_id = device_info.id WHERE %s = false AND %s ORDER BY %s DESC OFFSET @%s LIMIT @%s",
+		eventColumns, eventTableName, deviceInfoTableName, markDeletedCol,
 		whereCondition, descCol,
-		// note that this is a prepared statement with parameters beginning with two timeRangeCol
-		// and then columns conditions, so OFFSET, LIMIT are the third and forth parameters
-		columnCount+3, columnCount+4)
+		offsetCondition, limitCondition)
 }
 
 // sqlQueryAllReadingWithPaginationAndTimeRangeDescByCol returns the SQL statement for selecting all rows from the reading table with the arrayColNames slice,
 // provided columns with pagination and a time range by timeRangeCol, desc by descCol
 func sqlQueryAllReadingWithPaginationAndTimeRangeDescByCol(timeRangeCol string, descCol string, arrayColNames []string, columns ...string) string {
-	whereCondition := constructWhereCondWithTimeRange(timeRangeCol, timeRangeCol, arrayColNames, columns...)
-	columnCount := len(columns)
+	whereCondition := constructWhereNamedArgCondWithTimeRange(timeRangeCol, timeRangeCol, arrayColNames, columns...)
 
 	return fmt.Sprintf(
-		"SELECT %s FROM %s join %s on reading.device_info_id = device_info.id WHERE %s ORDER BY %s DESC OFFSET $%d LIMIT $%d",
-		readingColumns, readingTableName, deviceInfoTableName,
+		"SELECT %s FROM %s join %s on reading.device_info_id = device_info.id WHERE %s = false AND %s ORDER BY %s DESC OFFSET @%s LIMIT @%s",
+		readingColumns, readingTableName, deviceInfoTableName, markDeletedCol,
 		whereCondition, descCol,
-		// note that this is a prepared statement with parameters beginning with two timeRangeCol
-		// and then columns conditions, so OFFSET, LIMIT are the third and forth parameters
-		columnCount+3, columnCount+4)
+		offsetCondition, limitCondition)
 }
 
 // sqlQueryAllByStatusWithPaginationAndTimeRange returns the SQL statement for selecting all rows from the table by status with pagination and a time range.
@@ -195,23 +166,14 @@ func sqlQueryAllByStatusWithPaginationAndTimeRange(table string) string {
 
 // sqlQueryAllByColWithPaginationAndTimeRange returns the SQL statement for selecting all rows from the table by the given columns with pagination and a time range.
 func sqlQueryAllByColWithPaginationAndTimeRange(table string, columns ...string) string {
-	columnCount := len(columns)
-	whereCondition := constructWhereCondition(columns...)
-	timeRangeCondition := fmt.Sprintf("%s >= $%d AND %s <= $%d", createdCol, columnCount+1, createdCol, columnCount+2)
+	whereCondition := constructWhereNamedArgCondWithTimeRange(createdCol, createdCol, nil, columns...)
 
 	return fmt.Sprintf(
-		"SELECT * FROM %s WHERE %s AND %s ORDER BY %s OFFSET $%d LIMIT $%d",
-		table, whereCondition, timeRangeCondition, createdCol,
-		// note that this is a prepared statement with parameters beginning with two timeRangeCol
-		// and then columns conditions, so OFFSET, LIMIT are the third and forth parameters
-		columnCount+3, columnCount+4)
+		"SELECT * FROM %s WHERE %s ORDER BY %s OFFSET @%s LIMIT @%s",
+		table, whereCondition, createdCol,
+		offsetCondition, limitCondition)
 }
 
-// sqlQueryAllWithPaginationAndTimeRangeDesc returns the SQL statement for selecting all rows from the table with pagination and a time range.
-//func sqlQueryAllWithPaginationAndTimeRangeDesc(table string) string {
-//	return fmt.Sprintf("SELECT * FROM %s WHERE %s >= $1 AND %s <= $2 ORDER BY %s DESC OFFSET $3 LIMIT $4", table, createdCol, createdCol, createdCol)
-//}
-
 // sqlQueryAllById returns the SQL statement for selecting all rows from the table by id.
 func sqlQueryAllById(table string) string {
 	return fmt.Sprintf("SELECT * FROM %s WHERE %s = $1", table, idCol)
@@ -219,7 +181,7 @@ func sqlQueryAllById(table string) string {
 
 // sqlQueryAllEventById returns the SQL statement for selecting all rows from the event table by id.
 func sqlQueryAllEventById() string {
-	return fmt.Sprintf("SELECT %s FROM %s JOIN %s on event.device_info_id = device_info.id WHERE core_data.event.id=$1", eventColumns, eventTableName, deviceInfoTableName)
+	return fmt.Sprintf("SELECT %s FROM %s JOIN %s on event.device_info_id = device_info.id WHERE core_data.event.id=@%s", eventColumns, eventTableName, deviceInfoTableName, idCol)
 }
 
 // sqlQueryContentById returns the SQL statement for selecting content column by the specified id.
@@ -237,9 +199,15 @@ func sqlQueryContentWithPagination(table string) string {
 	return fmt.Sprintf("SELECT content FROM %s ORDER BY COALESCE((content->>'%s')::bigint, 0) OFFSET $1 LIMIT $2", table, createdField)
 }
 
-// sqlQueryContentWithTimeRangeAndPagination returns the SQL statement for selecting content column from the table by the given time range with pagination
-func sqlQueryContentWithTimeRangeAndPagination(table string) string {
-	return fmt.Sprintf("SELECT content FROM %s WHERE COALESCE((content->>'%s')::bigint, 0) BETWEEN $1 AND $2 AND content @> $3::jsonb ORDER BY COALESCE((content->>'%s')::bigint, 0) OFFSET $4 LIMIT $5", table, createdField, createdField)
+// sqlQueryContentWithPaginationAsNamedArgs returns the SQL statement for selecting content column from the table with pagination
+func sqlQueryContentWithPaginationAsNamedArgs(table string) string {
+	return fmt.Sprintf("SELECT content FROM %s ORDER BY COALESCE((content->>'%s')::bigint, 0) OFFSET @%s LIMIT @%s", table, createdField, offsetCondition, limitCondition)
+}
+
+// sqlQueryContentWithTimeRangeAndPaginationAsNamedArgs returns the SQL statement for selecting content column from the table by the given time range with pagination
+func sqlQueryContentWithTimeRangeAndPaginationAsNamedArgs(table string) string {
+	return fmt.Sprintf("SELECT content FROM %s WHERE COALESCE((content->>'%s')::bigint, 0) BETWEEN @%s AND @%s AND content @> @%s::jsonb ORDER BY COALESCE((content->>'%s')::bigint, 0) OFFSET @%s LIMIT @%s",
+		table, createdField, startTimeCondition, endTimeCondition, jsonContentCondition, createdField, offsetCondition, limitCondition)
 }
 
 // sqlQueryContentByJSONField returns the SQL statement for selecting content column in the table by the given JSON query string
@@ -247,16 +215,12 @@ func sqlQueryContentByJSONField(table string) string {
 	return fmt.Sprintf("SELECT content FROM %s WHERE content @> $1::jsonb", table)
 }
 
-// sqlQueryContentByJSONFieldWithPagination returns the SQL statement for selecting content column in the table by the given JSON query string with pagination
-func sqlQueryContentByJSONFieldWithPagination(table string) string {
-	return fmt.Sprintf("SELECT content FROM %s WHERE content @> $1::jsonb ORDER BY COALESCE((content->>'%s')::bigint, 0) OFFSET $2 LIMIT $3", table, createdField)
+// sqlQueryContentByJSONFieldWithPaginationAsNamedArgs returns the SQL statement for selecting content column in the table by the given JSON query string with pagination
+func sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(table string) string {
+	return fmt.Sprintf("SELECT content FROM %s WHERE content @> @%s::jsonb ORDER BY COALESCE((content->>'%s')::bigint, 0) OFFSET @%s LIMIT @%s",
+		table, jsonContentCondition, createdField, offsetCondition, limitCondition)
 }
 
-// sqlQueryContentByJSONFieldTimeRange returns the SQL statement for selecting content column by the given time range of the JSON field name
-//func sqlQueryContentByJSONFieldTimeRange(table string, field string) string {
-//	return fmt.Sprintf("SELECT content FROM %s WHERE (content->'%s')::bigint  >= $1 AND (content->'%s')::bigint <= $2 ORDER BY %s OFFSET $3 LIMIT $4", table, field, field, createdCol)
-//}
-
 // sqlCheckExistsById returns the SQL statement for checking if a row exists in the table by id.
 func sqlCheckExistsById(table string) string {
 	return fmt.Sprintf("SELECT EXISTS(SELECT 1 FROM %s WHERE %s = $1)", table, idCol)
@@ -278,37 +242,47 @@ func sqlQueryCount(table string) string {
 	return fmt.Sprintf("SELECT COUNT(*) FROM %s", table)
 }
 
+// sqlQueryCountEvent returns the SQL statement for counting the number of rows in the table.
+func sqlQueryCountEvent() string {
+	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on event.device_info_id = device_info.id WHERE %s = false", eventTableName, deviceInfoTableName, markDeletedCol)
+}
+
+// sqlQueryCountReading returns the SQL statement for counting the number of rows in the table.
+func sqlQueryCountReading() string {
+	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on reading.device_info_id = device_info.id WHERE %s = false", readingTableName, deviceInfoTableName, markDeletedCol)
+}
+
 // sqlQueryCountEventByCol returns the SQL statement for counting the number of rows in the table by the given column name.
 func sqlQueryCountEventByCol(columns ...string) string {
-	whereCondition := constructWhereCondition(columns...)
-	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on event.device_info_id = device_info.id WHERE %s", eventTableName, deviceInfoTableName, whereCondition)
+	whereCondition := constructWhereNamedArgCondition(columns...)
+	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on event.device_info_id = device_info.id WHERE %s = false AND %s", eventTableName, deviceInfoTableName, markDeletedCol, whereCondition)
 }
 
 // sqlQueryCountReadingByCol returns the SQL statement for counting the number of rows in the table by the given column name.
 func sqlQueryCountReadingByCol(columns ...string) string {
-	whereCondition := constructWhereCondition(columns...)
-	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on reading.device_info_id = device_info.id WHERE %s", readingTableName, deviceInfoTableName, whereCondition)
+	whereCondition := constructWhereNamedArgCondition(columns...)
+	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on reading.device_info_id = device_info.id WHERE %s = false AND %s", readingTableName, deviceInfoTableName, markDeletedCol, whereCondition)
 }
 
 // sqlQueryCountByTimeRangeCol returns the SQL statement for counting the number of rows in the table
 // by the given time range of the specified column
 func sqlQueryCountByTimeRangeCol(table string, timeRangeCol string, arrayColNames []string, columns ...string) string {
-	whereCondition := constructWhereCondWithTimeRange(timeRangeCol, timeRangeCol, arrayColNames, columns...)
+	whereCondition := constructWhereNamedArgCondWithTimeRange(timeRangeCol, timeRangeCol, arrayColNames, columns...)
 	return fmt.Sprintf("SELECT COUNT(*) FROM %s WHERE %s", table, whereCondition)
 }
 
 // sqlQueryCountEventByTimeRangeCol returns the SQL statement for counting the number of rows in the event table
 // by the given time range of the specified column
 func sqlQueryCountEventByTimeRangeCol(timeRangeCol string, arrayColNames []string, columns ...string) string {
-	whereCondition := constructWhereCondWithTimeRange(timeRangeCol, timeRangeCol, arrayColNames, columns...)
-	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on event.device_info_id = device_info.id WHERE %s", eventTableName, deviceInfoTableName, whereCondition)
+	whereCondition := constructWhereNamedArgCondWithTimeRange(timeRangeCol, timeRangeCol, arrayColNames, columns...)
+	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on event.device_info_id = device_info.id WHERE %s = false AND %s", eventTableName, deviceInfoTableName, markDeletedCol, whereCondition)
 }
 
 // sqlQueryCountReadingByTimeRangeCol returns the SQL statement for counting the number of rows in the reading table
 // by the given time range of the specified column
 func sqlQueryCountReadingByTimeRangeCol(timeRangeCol string, arrayColNames []string, columns ...string) string {
-	whereCondition := constructWhereCondWithTimeRange(timeRangeCol, timeRangeCol, arrayColNames, columns...)
-	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on reading.device_info_id = device_info.id WHERE %s", readingTableName, deviceInfoTableName, whereCondition)
+	whereCondition := constructWhereNamedArgCondWithTimeRange(timeRangeCol, timeRangeCol, arrayColNames, columns...)
+	return fmt.Sprintf("SELECT COUNT(*) FROM %s join %s on reading.device_info_id = device_info.id WHERE %s = false AND %s", readingTableName, deviceInfoTableName, markDeletedCol, whereCondition)
 }
 
 // sqlQueryCountByColAndLikePat returns the SQL statement for counting the number of rows by the given column name with LIKE pattern.
@@ -334,20 +308,14 @@ func sqlQueryCountInUseResource() string {
 func sqlCountEventByDeviceNameAndSourceNameAndLimit() string {
 	return fmt.Sprintf(
 		`SELECT count(*) FROM (
-		  SELECT 1 FROM %s JOIN %s on event.device_info_id = device_info.id WHERE %s = $1 AND %s = $2
-		  LIMIT $3
-        ) limited_count`, eventTableName, deviceInfoTableName, deviceNameCol, sourceNameCol)
+		  SELECT 1 FROM %s JOIN %s on event.device_info_id = device_info.id WHERE %s = false AND %s = @%s AND %s = @%s
+		  LIMIT @%s
+        ) limited_count`, eventTableName, deviceInfoTableName, markDeletedCol, deviceNameCol, deviceNameCol, sourceNameCol, sourceNameCol, limitCondition)
 }
 
-// sqlQueryCountByJSONFieldTimeRange returns the SQL statement for counting the number of rows in the table
-// by the given time range of the JSON field name
-//func sqlQueryCountByJSONFieldTimeRange(table string, field string) string {
-//	return fmt.Sprintf("SELECT COUNT(*) FROM %s WHERE (content->'%s')::bigint  >= $1 AND (content->'%s')::bigint <= $2", table, field, field)
-//}
-
 // sqlQueryEventIdFieldByTimeRangeAndConditions returns the SQL statement for selecting fields from the table within the time range
 func sqlQueryEventIdFieldByTimeRangeAndConditions(timeRangeCol string, cols ...string) string {
-	whereCondition := constructWhereCondWithTimeRange("", timeRangeCol, nil, cols...)
+	whereCondition := constructWhereNamedArgCondWithTimeRange("", timeRangeCol, nil, cols...)
 
 	return fmt.Sprintf("SELECT event.id FROM %s JOIN %s on event.device_info_id = device_info.id WHERE %s", eventTableName, deviceInfoTableName, whereCondition)
 }
@@ -412,14 +380,14 @@ func sqlDeleteByJSONFieldAndAge(table string) string {
 // sqlDeleteTimeRangeByColumn returns the SQL statement for deleting rows from the table by time range with the specified column
 // the time range is calculated from the caller function since the interval unit might be different
 func sqlDeleteTimeRangeByColumn(table string, upperLimitTimeRangeCol string, cols ...string) string {
-	whereCondition := constructWhereCondWithTimeRange("", upperLimitTimeRangeCol, nil, cols...)
+	whereCondition := constructWhereNamedArgCondWithTimeRange("", upperLimitTimeRangeCol, nil, cols...)
 	return fmt.Sprintf("DELETE FROM %s WHERE %s", table, whereCondition)
 }
 
 // sqlDeleteEventsByTimeRangeAndColumn returns the SQL statement for deleting rows from the event table by time range with the specified column
 // the time range is calculated from the caller function since the interval unit might be different
 func sqlDeleteEventsByTimeRangeAndColumn(upperLimitTimeRangeCol string, cols ...string) string {
-	whereCondition := constructWhereCondWithTimeRange("", upperLimitTimeRangeCol, nil, cols...)
+	whereCondition := constructWhereNamedArgCondWithTimeRange("", upperLimitTimeRangeCol, nil, cols...)
 	return fmt.Sprintf("DELETE FROM %s USING %s WHERE event.device_info_id = device_info.id AND %s", eventTableName, deviceInfoTableName, whereCondition)
 }
 
@@ -430,7 +398,7 @@ func sqlDeleteByColumns(table string, cols ...string) string {
 
 // sqlDeleteEventsByColumn returns the SQL statement for deleting rows from the event table by the specified column
 func sqlDeleteEventsByColumn(cols ...string) string {
-	return fmt.Sprintf("DELETE FROM %s USING %s WHERE event.device_info_id = device_info.id AND %s", eventTableName, deviceInfoTableName, constructWhereCondition(cols...))
+	return fmt.Sprintf("DELETE FROM %s USING %s WHERE event.device_info_id = device_info.id AND %s", eventTableName, deviceInfoTableName, constructWhereNamedArgCondition(cols...))
 }
 
 // sqlDeleteByColAndLikePat returns the SQL statement for deleting rows by the specified column with LIKE pattern
@@ -460,27 +428,50 @@ func constructWhereCondition(columns ...string) string {
 	return strings.Join(conditions, " AND ")
 }
 
-// constructWhereCondWithTimeRange constructs the WHERE condition for the given columns with time range
+// constructWhereNamedArgCondition constructs the WHERE condition for the given columns.
+func constructWhereNamedArgCondition(columns ...string) string {
+	columnCount := len(columns)
+	conditions := make([]string, columnCount)
+
+	for i, column := range columns {
+		conditions[i] = fmt.Sprintf("%s = @%s", column, column)
+	}
+
+	return strings.Join(conditions, " AND ")
+}
+
+// constructWhereNamedArgCondWithTimeRange constructs the WHERE condition for the given columns with time range
 // if arrayColNames is not empty, ANY operator will be added to accept the array argument for the specified array col names
-func constructWhereCondWithTimeRange(lowerLimitTimeRangeCol, upperLimitTimeRangeCol string, arrayColNames []string, columns ...string) string {
+//
+// For example, we want to query 'temperature' and 'humidity' from a 'sensor-device' within specified time range,
+// we use origin as start, end time, and put deviceNameCol and resourceNameCol in columns and indicate the resourceNameCol is array in arrayColNames
+// Here's the code snippet to query readings:
+// sqlStatement := sqlQueryAllReadingWithPaginationAndTimeRangeDescByCol(originCol, originCol, []string{resourceNameCol}, deviceNameCol, resourceNameCol)
+// queryArgs := pgx.NamedArgs{startTimeCondition: start, endTimeCondition: end, deviceNameCol: "sensor-device", resourceNameCol: []string{"temperature", "humidity"}, offsetCondition: 0, limitCondition: 100}
+// readings, err := queryReadings(ctx, c.ConnPool, sqlStatement, queryArgs)
+// ...
+// The sqlQueryAllReadingWithPaginationAndTimeRangeDescByCol will invoke constructWhereNamedArgCondWithTimeRange to construct the where condition sql statement,
+// the sql should similar to below:
+// SELECT ... FROM ... WHERE origin >= @start AND origin <= @end AND devicename = @devicename AND resourcename = ANY (@resourcename) ORDER BY origin DESC OFFSET @offset LIMIT @limit
+func constructWhereNamedArgCondWithTimeRange(startTimeCol, endTimeCol string, arrayColNames []string, columns ...string) string {
 	var hasArrayColumn bool
 	var conditions []string
-	if lowerLimitTimeRangeCol != "" {
-		conditions = append(conditions, lowerLimitTimeRangeCol+" >= $1")
+	if startTimeCol != "" {
+		conditions = append(conditions, fmt.Sprintf("%s >= @%s", startTimeCol, startTimeCondition))
 	}
-	if upperLimitTimeRangeCol != "" {
-		conditions = append(conditions, fmt.Sprintf("%s <= $%d", upperLimitTimeRangeCol, len(conditions)+1))
+	if endTimeCol != "" {
+		conditions = append(conditions, fmt.Sprintf("%s <= @%s", endTimeCol, endTimeCondition))
 	}
 
 	if len(arrayColNames) > 0 {
 		hasArrayColumn = true
 	}
 	for _, column := range columns {
-		equalCondition := "%s = $%d"
+		equalCondition := "%s = @%s"
 		if hasArrayColumn && slices.Contains(arrayColNames, column) {
-			equalCondition = "%s = ANY ($%d)"
+			equalCondition = "%s = ANY (@%s)"
 		}
-		conditions = append(conditions, fmt.Sprintf(equalCondition, column, 1+len(conditions)))
+		conditions = append(conditions, fmt.Sprintf(equalCondition, column, column))
 	}
 
 	return strings.Join(conditions, " AND ")
diff --git a/internal/pkg/infrastructure/postgres/subscription.go b/internal/pkg/infrastructure/postgres/subscription.go
index 93849935..d87d2660 100644
--- a/internal/pkg/infrastructure/postgres/subscription.go
+++ b/internal/pkg/infrastructure/postgres/subscription.go
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2024 IOTech Ltd
+// Copyright (C) 2024-2025 IOTech Ltd
 //
 // SPDX-License-Identifier: Apache-2.0
 
@@ -65,7 +65,7 @@ func (c *Client) SubscriptionById(id string) (models.Subscription, errors.EdgeX)
 func (c *Client) AllSubscriptions(offset, limit int) ([]models.Subscription, errors.EdgeX) {
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 
-	subscriptions, err := querySubscriptions(context.Background(), c.ConnPool, sqlQueryContentWithPagination(subscriptionTableName), offset, validLimit)
+	subscriptions, err := querySubscriptions(context.Background(), c.ConnPool, sqlQueryContentWithPaginationAsNamedArgs(subscriptionTableName), pgx.NamedArgs{offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all subscriptions", err)
 	}
@@ -89,7 +89,8 @@ func (c *Client) SubscriptionsByCategory(offset, limit int, category string) ([]
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{categoriesField: []string{category}}
 
-	subscriptions, err := querySubscriptions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPagination(subscriptionTableName), queryObj, offset, validLimit)
+	subscriptions, err := querySubscriptions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(subscriptionTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return subscriptions, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query subscription by category %s", category), err)
 	}
@@ -102,7 +103,8 @@ func (c *Client) SubscriptionsByLabel(offset, limit int, label string) ([]models
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{labelsField: []string{label}}
 
-	subscriptions, err := querySubscriptions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPagination(subscriptionTableName), queryObj, offset, validLimit)
+	subscriptions, err := querySubscriptions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(subscriptionTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return subscriptions, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query subscription by label %s", label), err)
 	}
@@ -115,7 +117,8 @@ func (c *Client) SubscriptionsByReceiver(offset, limit int, receiver string) ([]
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{receiverField: receiver}
 
-	subscriptions, err := querySubscriptions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPagination(subscriptionTableName), queryObj, offset, validLimit)
+	subscriptions, err := querySubscriptions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(subscriptionTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return subscriptions, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query subscription by receiver %s", receiver), err)
 	}
@@ -229,24 +232,27 @@ func subscriptionsByCategoriesAndLabels(connPool *pgxpool.Pool, offset, limit in
 
 	switch {
 	case len(labels) == 0:
-		subscriptions, err = querySubscriptions(context.Background(), connPool, sqlQueryContentByJSONFieldWithPagination(subscriptionTableName), categoriesObj, offset, validLimit)
+		subscriptions, err = querySubscriptions(context.Background(), connPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(subscriptionTableName),
+			pgx.NamedArgs{jsonContentCondition: categoriesObj, offsetCondition: offset, limitCondition: validLimit})
 	case len(categories) == 0:
-		subscriptions, err = querySubscriptions(context.Background(), connPool, sqlQueryContentByJSONFieldWithPagination(subscriptionTableName), labelsObj, offset, validLimit)
+		subscriptions, err = querySubscriptions(context.Background(), connPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(subscriptionTableName),
+			pgx.NamedArgs{jsonContentCondition: labelsObj, offsetCondition: offset, limitCondition: validLimit})
 	default:
 		sql := fmt.Sprintf(`
 			SELECT content
 				FROM (
 	    			SELECT content, COALESCE((content->>'%s')::bigint, 0) AS sort_key
 						FROM %s 
-						WHERE content @> $1::jsonb
+						WHERE content @> @%s::jsonb
 					INTERSECT
 					SELECT content, COALESCE((content->>'%s')::bigint, 0) AS sort_key 
 						FROM %s 
-						WHERE content @> $2::jsonb
+						WHERE content @> @%s::jsonb
 				)		
-			ORDER BY sort_key OFFSET $3 LIMIT $4;
-	`, createdField, subscriptionTableName, createdField, subscriptionTableName)
-		subscriptions, err = querySubscriptions(context.Background(), connPool, sql, categoriesObj, labelsObj, offset, validLimit)
+			ORDER BY sort_key OFFSET @%s LIMIT @%s;
+	`, createdField, subscriptionTableName, categoryCondition, createdField, subscriptionTableName, labelsCondition, offsetCondition, limitCondition)
+		subscriptions, err = querySubscriptions(context.Background(), connPool, sql,
+			pgx.NamedArgs{categoryCondition: categoriesObj, labelsCondition: labelsObj, offsetCondition: offset, limitCondition: validLimit})
 	}
 	if err != nil {
 		return subscriptions, errors.NewCommonEdgeXWrapper(err)
diff --git a/internal/pkg/infrastructure/postgres/transmission.go b/internal/pkg/infrastructure/postgres/transmission.go
index 55db4eaa..f22376ca 100644
--- a/internal/pkg/infrastructure/postgres/transmission.go
+++ b/internal/pkg/infrastructure/postgres/transmission.go
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2024 IOTech Ltd
+// Copyright (C) 2024-2025 IOTech Ltd
 //
 // SPDX-License-Identifier: Apache-2.0
 
@@ -83,7 +83,8 @@ func (c *Client) TransmissionsByTimeRange(start int64, end int64, offset, limit
 		return nil, errors.NewCommonEdgeXWrapper(err)
 	}
 
-	transmission, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentWithTimeRangeAndPagination(transmissionTableName), validStart, validEnd, map[string]any{}, offset, validLimit)
+	transmission, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentWithTimeRangeAndPaginationAsNamedArgs(transmissionTableName),
+		pgx.NamedArgs{startTimeCondition: validStart, endTimeCondition: validEnd, jsonContentCondition: map[string]any{}, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all transmission by time range", err)
 	}
@@ -95,7 +96,7 @@ func (c *Client) TransmissionsByTimeRange(start int64, end int64, offset, limit
 func (c *Client) AllTransmissions(offset, limit int) ([]models.Transmission, errors.EdgeX) {
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 
-	transmissions, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentWithPagination(transmissionTableName), offset, validLimit)
+	transmissions, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentWithPaginationAsNamedArgs(transmissionTableName), pgx.NamedArgs{offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), "failed to query all transmissions", err)
 	}
@@ -108,7 +109,8 @@ func (c *Client) TransmissionsByStatus(offset, limit int, status string) ([]mode
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{statusField: status}
 
-	transmissions, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPagination(transmissionTableName), queryObj, offset, validLimit)
+	transmissions, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(transmissionTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query all transmissions by status %s", status), err)
 	}
@@ -133,7 +135,8 @@ func (c *Client) TransmissionsBySubscriptionName(offset, limit int, subscription
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{subscriptionNameField: subscriptionName}
 
-	transmissions, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPagination(transmissionTableName), queryObj, offset, validLimit)
+	transmissions, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(transmissionTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query all transmissions by subscription name %s", subscriptionName), err)
 	}
@@ -172,7 +175,8 @@ func (c *Client) TransmissionsByNotificationId(offset, limit int, id string) ([]
 	offset, validLimit := getValidOffsetAndLimit(offset, limit)
 	queryObj := map[string]any{notificationIdField: id}
 
-	transmissions, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPagination(transmissionTableName), queryObj, offset, validLimit)
+	transmissions, err := queryTransmissions(context.Background(), c.ConnPool, sqlQueryContentByJSONFieldWithPaginationAsNamedArgs(transmissionTableName),
+		pgx.NamedArgs{jsonContentCondition: queryObj, offsetCondition: offset, limitCondition: validLimit})
 	if err != nil {
 		return nil, errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("failed to query all transmissions by notification id %s", id), err)
 	}
diff --git a/openapi/core-command.yaml b/openapi/core-command.yaml
index 212c8833..bf0845ce 100644
--- a/openapi/core-command.yaml
+++ b/openapi/core-command.yaml
@@ -228,6 +228,17 @@ components:
           required:
             - binaryValue
             - mediaType
+    ObjectReading:
+      description: "An event reading for an object data type"
+      allOf:
+        - $ref: '#/components/schemas/BaseReading'
+        - type: object
+          properties:
+            objectValue:
+              description: "If the value of the reading is an object, it will be found in this property as a object"
+              type: object
+          required:
+            - objectValue
     Event:
       description: "A discrete event containing one or more readings"
       properties:
@@ -257,6 +268,7 @@ components:
             oneOf:
               - $ref: '#/components/schemas/SimpleReading'
               - $ref: '#/components/schemas/BinaryReading'
+              - $ref: '#/components/schemas/ObjectReading'
         tags:
           description: "List of zero or more Tags attached to the Event which give more context to the Event"
           title: tags
@@ -538,6 +550,11 @@ paths:
             default: true
           example: false
           description: "If set to false, there will be no Event returned in the http response"
+        - in: query
+          name: jsonObject
+          schema:
+            type: string
+          description: "Base64-encoded JSON string for passing additional parameters"
       responses:
         '200':
           description: "OK"
diff --git a/openapi/core-data.yaml b/openapi/core-data.yaml
index 53e78c73..de67f095 100644
--- a/openapi/core-data.yaml
+++ b/openapi/core-data.yaml
@@ -20,7 +20,7 @@ components:
           $ref: '#/components/schemas/Event'
       required:
         - event
-    BaseReading:
+    Reading:
       description: "A base reading type containing common properties from which more specific reading types inherit. This definition should not be implemented but is used elsewhere to indicate support for a mixed list of simple/binary readings in a single event."
       type: object
       properties:
@@ -66,11 +66,22 @@ components:
             - Float32Array
             - Float64Array
             - Object
+        value:
+          description: "A string representation of the reading's value"
+          type: string
+        binaryValue:
+          description: "If the value of the reading is binary, it will be found in this property as a byte array"
+          type: string
+          format: byte
+        mediaType:
+          description: "E.g. MIME Type, indicates what the content type of the binaryValue property is if it's populated."
+          type: string
+        objectValue:
+          description: "If the value type of the reading is Object, it will be found in this property as a object value"
+          type: string
+          format: byte
       required:
-        - deviceName
         - resourceName
-        - profileName
-        - origin
         - valueType
     BaseRequest:
       description: "Defines basic properties which all use-case specific request DTO instances should support."
@@ -121,45 +132,6 @@ components:
         totalCount:
           description: "The total count of all multi instances."
           type: integer
-    SimpleReading:
-      description: "An event reading for a simple data type"
-      allOf:
-        - $ref: '#/components/schemas/BaseReading'
-        - type: object
-          properties:
-            value:
-              description: "A string representation of the reading's value"
-              type: string
-      required:
-        - value    
-    BinaryReading:
-      description: "An event reading for a binary data type"
-      allOf:
-        - $ref: '#/components/schemas/BaseReading'
-        - type: object
-          properties:
-            binaryValue:
-              description: "If the value of the reading is binary, it will be found in this property as a byte array"
-              type: string
-              format: byte
-            mediaType:
-              description: "E.g. MIME Type, indicates what the content type of the binaryValue property is if it's populated."
-              type: string
-          required:
-            - binaryValue
-            - mediaType
-    ObjectReading:
-      description: "An event reading for a object data type"
-      allOf:
-        - $ref: '#/components/schemas/BaseReading'
-        - type: object
-          properties:
-            objectValue:
-              description: "If the value type of the reading is Object, it will be found in this property as a object value"
-              type: string
-              format: byte
-          required:
-            - objectValue
     CountResponse:
       allOf:
         - $ref: '#/components/schemas/BaseResponse'
@@ -194,10 +166,7 @@ components:
           description: "One or more readings captured at the time of the event"
           type: array
           items:
-            oneOf:
-              - $ref: '#/components/schemas/SimpleReading'
-              - $ref: '#/components/schemas/BinaryReading'
-              - $ref: '#/components/schemas/ObjectReading'
+            $ref: '#/components/schemas/Reading'
           example: [
             {
                 "deviceName": "Random-Boolean-Device",
@@ -281,7 +250,7 @@ components:
         readings:
           type: array
           items:
-            $ref: '#/components/schemas/BaseReading'
+            $ref: '#/components/schemas/Reading'
     PingResponse:
       type: object
       properties:
@@ -1141,7 +1110,7 @@ paths:
       - $ref: '#/components/parameters/offsetParam'
       - $ref: '#/components/parameters/limitParam'
     get:
-      summary: "Given the entire range of readings sorted by origin descending, returns a portion of that range according to the offset and limit parameters. Readings returned will all inherit from BaseReading but their concrete types will be either SimpleReading or BinaryReading, potentially interleaved."
+      summary: "Given the entire range of readings sorted by origin descending, returns a portion of that range according to the offset and limit parameters. Readings are returned as a Reading type, which includes value for simple data types, binaryValue and mediaType for binary data types, or objectValue for object data types."
       responses:
         '200':
           description: "OK"
diff --git a/openapi/core-keeper.yaml b/openapi/core-keeper.yaml
index ed3aaada..e4fa0b53 100644
--- a/openapi/core-keeper.yaml
+++ b/openapi/core-keeper.yaml
@@ -254,40 +254,6 @@ components:
         config:
           description: "An object containing the service's configuration. Please refer the configuration documentation of each service for more details at [EdgeX Foundry Documentation](https://docs.edgexfoundry.org)."
           type: object
-    MetricsResponse:
-      description: "A response from the /metrics endpoint providing memory and cpu utilization stats."
-      type: object
-      properties:
-        apiVersion:
-          description: "A version number shows the API version in DTOs."
-          type: string
-        serviceName:
-          description: "Outputs the name of the service the response is from"
-          type: string
-        metrics:
-          type: object
-          properties:
-            memAlloc:
-              description: "Alloc is bytes of allocated heap objects which is a uint64 type integer."
-              type: integer
-            memFrees:
-              description: "Frees is the cumulative count of heap objects freed which is a uint64 type integer."
-              type: integer
-            memLiveObjects:
-              description: "The uint64 type integer of live objects is Mallocs - Frees."
-              type: integer
-            memMallocs:
-              description: "The cumulative count of heap objects allocated which is a uint64 type integer."
-              type: integer
-            memSys:
-              description: "The total bytes of memory obtained from the OS which is a uint64 type integer."
-              type: integer
-            memTotalAlloc:
-              description: "Cumulative bytes allocated for heap objects which is a uint64 type integer."
-              type: integer
-            cpuBusyAvg:
-              description: "A uint8 type integer indicates the average level of CPU utilization"
-              type: number
     PingResponse:
       type: object
       properties:
@@ -322,7 +288,7 @@ components:
       required: true
       schema:
         type: string
-      example: edgex/core/3.0/core-data
+      example: edgex/v4/core-data
       description: "Uniquely identifies a key."
     plaintextParam:
       in: query
@@ -392,23 +358,23 @@ components:
         apiVersion: "v3"
         statusCode: 200
         response:
-          - "edgex/core/3.0/core-data/Writable/Telemetry/Interval"
-          - "edgex/core/3.0/core-data/Writable/Telemetry/PublishTopicPrefix"
-          - "edgex/core/3.0/core-data/Writable/Telemetry/Metrics/EventsPersisted"
+          - "edgex/v4/core-data/Writable/Telemetry/Interval"
+          - "edgex/v4/core-data/Writable/Telemetry/PublishTopicPrefix"
+          - "edgex/v4/core-data/Writable/Telemetry/Metrics/EventsPersisted"
     KVExample:
       value:
         apiVersion: "v3"
         statusCode: 200
         response:
-          - key: "edgex/core/3.0/core-data/Writable/Telemetry/Interval"
+          - key: "edgex/v4/core-data/Writable/Telemetry/Interval"
             created: 1655372722060444
             modified: 1655372722060444
             value: "MzBz"
-          - key: "edgex/core/3.0/core-data/Writable/Telemetry/PublishTopicPrefix"
+          - key: "edgex/v4/core-data/Writable/Telemetry/PublishTopicPrefix"
             created: 1655372722061042
             modified: 1655372722061042
             value: "ZWRnZXgvdGVsZW1ldHJ5"
-          - key: "edgex/core/3.0/core-data/Writable/Telemetry/Metrics/EventsPersisted"
+          - key: "edgex/v4/core-data/Writable/Telemetry/Metrics/EventsPersisted"
             created: 1655372722061868
             modified: 1655372722061868
             value": false
@@ -433,18 +399,18 @@ components:
         apiVersion: "v3"
         statusCode: 200
         response:
-          - "edgex/core/3.0/core-data"
+          - "edgex/v4/core-data"
     UpdateKeyFlattenRespExample:
       value:
         apiVersion: "v3"
         statusCode: 200
         response:
-          - "edgex/core/3.0/core-data/MaxEventSize"
-          - "edgex/core/3.0/core-data/Writable/InsecureSecrets/DB/path"
-          - "edgex/core/3.0/core-data/Writable/InsecureSecrets/DB/Secrets/username"
-          - "edgex/core/3.0/core-data/Writable/InsecureSecrets/DB/Secrets/password"
-          - "edgex/core/3.0/core-data/Writable/PersistData"
-          - "edgex/core/3.0/core-data/Writable/LogLevel"
+          - "edgex/v4/core-data/MaxEventSize"
+          - "edgex/v4/core-data/Writable/InsecureSecrets/DB/path"
+          - "edgex/v4/core-data/Writable/InsecureSecrets/DB/Secrets/username"
+          - "edgex/v4/core-data/Writable/InsecureSecrets/DB/Secrets/password"
+          - "edgex/v4/core-data/Writable/PersistData"
+          - "edgex/v4/core-data/Writable/LogLevel"
     AddRegistrationRequestExample:
       value:
         apiVersion: "v3"
@@ -880,35 +846,6 @@ paths:
               examples:
                 500Example:
                   $ref: '#/components/examples/500Example'
-  /metrics:
-    get:
-      summary: "An endpoint that can be used to obtain CPU/Memory usage stats for a given service."
-      responses:
-        '200':
-          description: "OK"
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/MetricsResponse'
-              example:
-                apiVersion: "v3"
-                metrics:
-                  memAlloc: 877192
-                  memFrees: 2248915
-                  memLiveObjects: 6522
-                  memMallocs: 2255437
-                  memSys: 72876280
-                  memTotalAlloc: 203821192
-                  cpuBusyAvg: 2.2521221920656003
-        '500':
-          description: "Interval Server Error"
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/ErrorResponse'
-              examples:
-                500Example:
-                  $ref: '#/components/examples/500Example'
   /ping:
     get:
       summary: "A simple 'ping' endpoint that can be used as a service healthcheck"
diff --git a/openapi/core-metadata.yaml b/openapi/core-metadata.yaml
index dc600eee..b23eb029 100644
--- a/openapi/core-metadata.yaml
+++ b/openapi/core-metadata.yaml
@@ -605,6 +605,9 @@ components:
         adminState:
           type: string
           description: Device Service Admin State
+        properties:
+          type: object
+          description: A map of properties required to address the given device service
     DeviceServiceResponse:
       allOf:
         - $ref: '#/components/schemas/BaseResponse'
@@ -666,8 +669,8 @@ components:
             - UNLOCKED
         discoveredDevice:
           type: object
-          items:
-            $ref: '#/components/schemas/DiscoveredDevice'
+          allOf:
+            - $ref: '#/components/schemas/DiscoveredDevice'
     CreateProvisionWatcher:
       description: "A ProvisionWatcher defines the filtering criteria for device auto discovery."
       type: object
@@ -752,14 +755,14 @@ components:
         - $ref: '#/components/schemas/BaseResponse'
       type: object
       properties:
-        provisionwatcher:
+        provisionWatcher:
           $ref: '#/components/schemas/ProvisionWatcher'
     MultiProvisionWatchersResponse:
       allOf:
         - $ref: '#/components/schemas/BaseWithTotalCountResponse'
       type: object
       properties:
-        provisionwatchers:
+        provisionWatchers:
           type: array
           items:
             $ref: '#/components/schemas/ProvisionWatcher'
@@ -1642,7 +1645,7 @@ components:
         requestId: "4e63c9b9-9cc4-45e4-9bf0-6d994a3860b4"
         statusCode: 200
         totalCount: 3
-        provisionwatchers:
+        provisionWatchers:
           - id: "1ff7762f-c432-4af0-9a5d-756bbc92744b"
             name: "virtual-watcher"
             created: 1600927134890
@@ -3969,7 +3972,7 @@ paths:
                 apiVersion: "v3"
                 requestId: "4e63c9b9-9cc4-45e4-9bf0-6d994a3860b4"
                 statusCode: 200
-                provisionwatcher:
+                provisionWatcher:
                   id: "1ff7762f-c432-4af0-9a5d-756bbc92744b"
                   name: "virtual-watcher"
                   created: 1600927134890


Test patch:
diff --git a/internal/core/command/application/command_test.go b/internal/core/command/application/command_test.go
index cdbac192..ddefc7e5 100644
--- a/internal/core/command/application/command_test.go
+++ b/internal/core/command/application/command_test.go
@@ -1,19 +1,28 @@
 //
-// Copyright (C) 2021 IOTech Ltd
+// Copyright (C) 2021-2025 IOTech Ltd
 //
 // SPDX-License-Identifier: Apache-2.0
 
 package application
 
 import (
+	"context"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 
+	"github.com/edgexfoundry/edgex-go/internal/core/command/config"
+	"github.com/edgexfoundry/edgex-go/internal/core/command/container"
+
+	bootstrapContainer "github.com/edgexfoundry/go-mod-bootstrap/v4/bootstrap/container"
+	bootstrapConfig "github.com/edgexfoundry/go-mod-bootstrap/v4/config"
+	"github.com/edgexfoundry/go-mod-bootstrap/v4/di"
+	"github.com/edgexfoundry/go-mod-core-contracts/v4/clients/interfaces/mocks"
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/common"
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos"
-
-	"github.com/stretchr/testify/assert"
+	dtosCommon "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/common"
+	"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/responses"
 )
 
 const (
@@ -97,3 +106,64 @@ func TestBuildCoreCommands(t *testing.T) {
 
 	assert.ElementsMatch(t, expectedCoreCommand, result)
 }
+
+func TestAllCommands(t *testing.T) {
+	ctx := context.Background()
+	device1 := dtos.Device{Name: "test-device-1", ProfileName: "test-profile-1"}
+	device2 := dtos.Device{Name: "test-device-2", ProfileName: "test-profile-2"}
+	device3 := dtos.Device{Name: "test-device-3", ProfileName: ""}
+
+	dic := di.NewContainer(di.ServiceConstructorMap{})
+	dc := &mocks.DeviceClient{}
+	dpc := &mocks.DeviceProfileClient{}
+	dpc.On("DeviceProfileByName", ctx, device1.ProfileName).Return(responses.DeviceProfileResponse{}, nil)
+	dpc.On("DeviceProfileByName", ctx, device2.ProfileName).Return(responses.DeviceProfileResponse{}, nil)
+	dic.Update(di.ServiceConstructorMap{
+		container.ConfigurationName: func(get di.Get) interface{} {
+			return &config.ConfigurationStruct{
+				Service: bootstrapConfig.ServiceInfo{
+					Host: "localhost",
+					Port: 59882,
+				},
+			}
+		},
+		bootstrapContainer.DeviceClientName: func(get di.Get) interface{} {
+			return dc
+		},
+		bootstrapContainer.DeviceProfileClientName: func(get di.Get) interface{} {
+			return dpc
+		},
+	})
+
+	tests := []struct {
+		name                 string
+		multiDevicesResponse responses.MultiDevicesResponse
+		expectedTotalCount   uint32
+	}{
+		{
+			name: "query the commands",
+			multiDevicesResponse: responses.MultiDevicesResponse{
+				BaseWithTotalCountResponse: dtosCommon.BaseWithTotalCountResponse{TotalCount: 2},
+				Devices:                    []dtos.Device{device1, device2},
+			},
+			expectedTotalCount: 2,
+		},
+		{
+			name: "device has empty profile",
+			multiDevicesResponse: responses.MultiDevicesResponse{
+				BaseWithTotalCountResponse: dtosCommon.BaseWithTotalCountResponse{TotalCount: 2},
+				Devices:                    []dtos.Device{device1, device3},
+			},
+			expectedTotalCount: 2,
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			var labels []string
+			dc.On("AllDevices", ctx, labels, 0, 0).Return(tt.multiDevicesResponse, nil).Once()
+			_, count, err := AllCommands(0, 0, dic)
+			require.NoError(t, err)
+			assert.Equal(t, tt.expectedTotalCount, count)
+		})
+	}
+}
diff --git a/internal/core/data/application/reading_test.go b/internal/core/data/application/reading_test.go
index 8c2cd03c..93083255 100644
--- a/internal/core/data/application/reading_test.go
+++ b/internal/core/data/application/reading_test.go
@@ -7,6 +7,7 @@
 package application
 
 import (
+	"context"
 	"net/http"
 	"testing"
 	"time"
@@ -19,7 +20,12 @@ import (
 	"github.com/edgexfoundry/edgex-go/internal/core/data/container"
 	dbMock "github.com/edgexfoundry/edgex-go/internal/core/data/infrastructure/interfaces/mocks"
 	"github.com/edgexfoundry/edgex-go/internal/core/data/mocks"
+	bootstrapContainer "github.com/edgexfoundry/go-mod-bootstrap/v4/bootstrap/container"
 	"github.com/edgexfoundry/go-mod-bootstrap/v4/di"
+	clientMocks "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/interfaces/mocks"
+	"github.com/edgexfoundry/go-mod-core-contracts/v4/common"
+	"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos"
+	"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/responses"
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/errors"
 	"github.com/edgexfoundry/go-mod-core-contracts/v4/models"
 )
@@ -253,7 +259,7 @@ func TestReadingCountByDeviceName(t *testing.T) {
 	}
 }
 
-func TestPurgeEvent(t *testing.T) {
+func TestPurgeEventsByAutoEvent(t *testing.T) {
 	dic := mocks.NewMockDIC()
 	deviceName := "testDevice"
 	sourceName := "testSource"
@@ -340,7 +346,7 @@ func TestPurgeEvent(t *testing.T) {
 	}
 	for _, testCase := range tests {
 		t.Run(testCase.name, func(t *testing.T) {
-			err := purgeEvent(deviceName, testCase.autoEvent, dic)
+			err := purgeEventsByAutoEvent(deviceName, testCase.autoEvent, dic)
 			require.NoError(t, err)
 			duration, parseErr := time.ParseDuration(testCase.autoEvent.Retention.Duration)
 			require.NoError(t, parseErr)
@@ -363,3 +369,36 @@ func TestPurgeEvent(t *testing.T) {
 		})
 	}
 }
+
+func TestNoneAutoEventSourcesByDevice(t *testing.T) {
+	deviceName := "test-device"
+	profileName := "test-profile"
+	dic := mocks.NewMockDIC()
+	clientMock := &clientMocks.DeviceProfileClient{}
+	clientMock.On("DeviceProfileByName", context.Background(), profileName).Return(responses.DeviceProfileResponse{Profile: dtos.DeviceProfile{
+		DeviceResources: []dtos.DeviceResource{{Name: "resource1", Properties: dtos.ResourceProperties{ReadWrite: common.ReadWrite_R}}, {Name: "resource2", Properties: dtos.ResourceProperties{ReadWrite: common.ReadWrite_W}}},
+		DeviceCommands:  []dtos.DeviceCommand{{Name: "command1", ReadWrite: common.ReadWrite_R}, {Name: "command2", ReadWrite: common.ReadWrite_W}},
+	}}, nil)
+	dic.Update(di.ServiceConstructorMap{
+		bootstrapContainer.DeviceProfileClientName: func(get di.Get) interface{} {
+			return clientMock
+		},
+	})
+
+	test := []struct {
+		name            string
+		device          models.Device
+		expectedSources []string
+	}{
+		{"no auto events in device", models.Device{Name: deviceName, ProfileName: profileName, AutoEvents: nil}, []string{"resource1", "command1"}},
+		{"one auto events in device", models.Device{Name: deviceName, ProfileName: profileName, AutoEvents: []models.AutoEvent{{SourceName: "resource1"}}}, []string{"command1"}},
+		{"two auto events in device", models.Device{Name: deviceName, ProfileName: profileName, AutoEvents: []models.AutoEvent{{SourceName: "resource1"}, {SourceName: "command1"}}}, nil},
+	}
+	for _, testCase := range test {
+		t.Run(testCase.name, func(t *testing.T) {
+			sources, err := noneAutoEventSourcesByDevice(testCase.device, dic)
+			require.NoError(t, err)
+			assert.Equal(t, testCase.expectedSources, sources)
+		})
+	}
+}
diff --git a/internal/core/keeper/controller/http/kv_test.go b/internal/core/keeper/controller/http/kv_test.go
index 1313dc5f..44e10d7b 100644
--- a/internal/core/keeper/controller/http/kv_test.go
+++ b/internal/core/keeper/controller/http/kv_test.go
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2024 IOTech Ltd
+// Copyright (C) 2024-2025 IOTech Ltd
 //
 // SPDX-License-Identifier: Apache-2.0
 
@@ -350,6 +350,8 @@ func TestDeleteKeys(t *testing.T) {
 	prefixExistsKey := "prefix-key"
 	keyResp := []models.KeyOnly{models.KeyOnly(key)}
 
+	msgClientMock := &messageClientMocks.MessageClient{}
+	msgClientMock.On("Publish", mock.Anything, mock.Anything).Return(nil)
 	dic := mockDic()
 	dbClientMock := &mocks.DBClient{}
 	dbClientMock.On("DeleteKeeperKeys", key, true).Return(keyResp, nil)
@@ -361,6 +363,9 @@ func TestDeleteKeys(t *testing.T) {
 		container.DBClientInterfaceName: func(get di.Get) interface{} {
 			return dbClientMock
 		},
+		bootstrapContainer.MessagingClientName: func(get di.Get) interface{} {
+			return msgClientMock
+		},
 	})
 
 	controller := NewKVController(dic)