Repository: quarkusio/quarkus
Issue: quarkus.security.jdbc.principal-query.sql is required even if quarkus.security.jdbc.enabled is set to false

`quarkus.security.jdbc.principal-query.sql` is required even if `quarkus.security.jdbc.enabled=false`

Expected behavior is to not require `quarkus.security.jdbc.principal-query.sql`  when `quarkus.security.jdbc.enabled=false` is set.

```
[INFO] Running io.quarkus.qe.MyResourceTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.306 s <<< FAILURE! - in io.quarkus.qe.MyResourceTest
[ERROR] testHelloEndpoint  Time elapsed: 0.011 s  <<< ERROR!
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.NoSuchElementException: Property quarkus.security.jdbc.principal-query.sql not found
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.util.NoSuchElementException: Property quarkus.security.jdbc.principal-query.sql not found
Caused by: java.lang.RuntimeException: java.util.NoSuchElementException: Property quarkus.security.jdbc.principal-query.sql not found
Caused by: java.util.NoSuchElementException: Property quarkus.security.jdbc.principal-query.sql not found
```

Reproducer:
```
rm -rf fooBar
mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create \\
    -DprojectGroupId=io.quarkus.qe \\
    -DprojectArtifactId=fooBar \\
    -DprojectVersion=1.0.0-SNAPSHOT \\
    -DplatformArtifactId=quarkus-bom \\
    -DclassName="io.quarkus.qe.MyResource" \\
    -Dextensions="quarkus-elytron-security-jdbc"

echo "quarkus.security.jdbc.enabled=false" > fooBar/src/main/resources/application.properties
mvn -f fooBar/pom.xml clean verify
```

Changed files:
extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/PrincipalQueryConfig.java
extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/JdbcRecorder.java

diff --git a/extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/JdbcRecorder.java b/extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/JdbcRecorder.java
index 1949f766148..53faf6a116e 100644
--- a/extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/JdbcRecorder.java
+++ b/extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/JdbcRecorder.java
@@ -43,11 +43,10 @@ public Provider[] get() {
     }
 
     private void registerPrincipalQuery(PrincipalQueryConfig principalQuery, JdbcSecurityRealmBuilder builder) {
-        DataSource dataSource = (DataSource) principalQuery.datasource
-                .map(name -> Arc.container().instance(name).get())
-                .orElse(Arc.container().instance(DataSource.class).get());
 
-        QueryBuilder queryBuilder = builder.principalQuery(principalQuery.sql).from(dataSource);
+        QueryBuilder queryBuilder = builder.principalQuery(principalQuery.sql.orElseThrow(
+                () -> new IllegalStateException("quarkus.security.jdbc.principal-query.sql property must be set")))
+                .from(getDataSource(principalQuery));
 
         AttributeMapper[] mappers = principalQuery.attributeMappings.entrySet()
                 .stream()
@@ -62,4 +61,10 @@ private void registerPrincipalQuery(PrincipalQueryConfig principalQuery, JdbcSec
             queryBuilder.withMapper(principalQuery.bcryptPasswordKeyMapperConfig.toPasswordKeyMapper());
         }
     }
+
+    private DataSource getDataSource(PrincipalQueryConfig principalQuery) {
+        return (DataSource) principalQuery.datasource
+                .map(name -> Arc.container().instance(name).get())
+                .orElse(Arc.container().instance(DataSource.class).get());
+    }
 }
diff --git a/extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/PrincipalQueryConfig.java b/extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/PrincipalQueryConfig.java
index 93e2179f70b..85433878212 100644
--- a/extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/PrincipalQueryConfig.java
+++ b/extensions/elytron-security-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/PrincipalQueryConfig.java
@@ -16,7 +16,7 @@ public class PrincipalQueryConfig {
      * The sql query to find the password
      */
     @ConfigItem
-    public String sql;
+    public Optional<String> sql;
 
     /**
      * The data source to use