Add OracleManagedDataAccess Aspire Component#1004
Add OracleManagedDataAccess Aspire Component#1004andrevlins wants to merge 3 commits intomicrosoft:mainfrom
Conversation
|
Hello @RussKie, Can you help me with these packages mentioned above? AspNetCore.HealthChecks.Oracle 7.0.0 |
| { | ||
| ValidateConnection(); | ||
|
|
||
| return new OracleConnection(settings.ConnectionString); |
There was a problem hiding this comment.
Oracle doesn't have a data source?
There was a problem hiding this comment.
No. I intend to update this code as soon as they implement DbDataSource.
There was a problem hiding this comment.
| /// <param name="builder">The <see cref="IHostApplicationBuilder" /> to read config from and add services to.</param> | ||
| /// <param name="connectionName">A name used to retrieve the connection string from the ConnectionStrings configuration section.</param> | ||
| /// <param name="configureSettings">An optional delegate that can be used for customizing options. It's invoked after the settings are read from the configuration.</param> | ||
| /// <remarks>Reads the configuration from "Aspire:Oracle" section.</remarks> |
There was a problem hiding this comment.
Aspire:OracleManagedDataAccess
There was a problem hiding this comment.
Changed to Aspire:Oracle:ManagedDataAccess:Core as @eerhardt advised
|
|
||
| public class AspireOracleManagedDataAccessExtensionsTests | ||
| { | ||
| private const string ConnectionString = "user id=system;password=123;data source=localhost:1522/freepdb1"; |
There was a problem hiding this comment.
Is this a well known connection string?
| @@ -0,0 +1,22 @@ | |||
| <Project Sdk="Microsoft.NET.Sdk"> | |||
There was a problem hiding this comment.
The project/folder/package name should be Aspire.Oracle.ManagedDataAccess.Core.
There was a problem hiding this comment.
Done. I ended up closing the PR unintentionally during this process, sorry about that
| using Oracle.ManagedDataAccess.Client; | ||
|
|
||
| namespace Aspire.OracleManagedDataAccess; | ||
| internal sealed class OracleHealthCheck : IHealthCheck |
There was a problem hiding this comment.
| @@ -0,0 +1,22 @@ | |||
| <Project Sdk="Microsoft.NET.Sdk"> | |||
There was a problem hiding this comment.
Can you also update:
- https://github.com/dotnet/aspire/blob/main/src/Components/Telemetry.md
- https://github.com/dotnet/aspire/blob/main/src/Components/Aspire_Components_Progress.md
- Add a README.
See other PRs for example:
| /// </summary> | ||
| public static class AspireOracleManagedDataAccessExtensions | ||
| { | ||
| private const string DefaultConfigSectionName = "Aspire:OracleManagedDataAccess"; |
There was a problem hiding this comment.
| private const string DefaultConfigSectionName = "Aspire:OracleManagedDataAccess"; | |
| private const string DefaultConfigSectionName = "Aspire:Oracle:ManagedDataAccess:Core"; |
This should follow the name of the component.
| if (serviceKey is null) | ||
| { | ||
| // delay validating the ConnectionString until the DataSource is requested. This ensures an exception doesn't happen until a Logger is established. | ||
| builder.Services.AddTransient((serviceProvider) => |
There was a problem hiding this comment.
The connection should be transient? I would have guessed scoped.
There was a problem hiding this comment.
I agree, in this case it really is better for the connection to be scoped
| public bool Tracing { get; set; } = true; | ||
|
|
||
| /// <summary> | ||
| /// <para>Gets or sets a boolean value that indicates whether the Open Telemetry metrics are enabled or not.</para> | ||
| /// <para>Enabled by default.</para> | ||
| /// </summary> | ||
| public bool Metrics { get; set; } = true; |
There was a problem hiding this comment.
Are these used? If not, we shouldn't have properties for them.
There was a problem hiding this comment.
Removed for now, I looked in the ODP.NET documentation and there are still no metrics that we can use here.
| @@ -0,0 +1,34 @@ | |||
| { | |||
| "properties": { | |||
There was a problem hiding this comment.
Is there integration with Logging? If so, can we add the log categories to the ConfigurationSchema.json?
See #430 for example.
There was a problem hiding this comment.
Not for the time being. I believe that if they implement DbDataSource they will provide this feature.
f9cd28f to
69f4227
Compare
|
@andrevlins did you mean to close this? |
|
Force push erased all the commits which were here so github closed the PR. 😟 |
|
@mitchdenny I'll reopen with the new folder structure |
|
@andrevlins - this PR is marked as a Draft. Is it ready for review? |
This PR depends on a version of the Oracle.ManagedDataAccess nuget package that is still in preview. |
|
@andrevlins - do you have a timeline for when you think this PR will be ready for review? |
I am waiting for the stable version of the library Some paths we can follow:
What do you think? |
|
I'm inclined to say that if no progress is being made on this PR, let's close it for now. We can always re-open it when progress is ready to be made. |
I'll do it this way then |
Adds the ability to connect to an Oracle database through the OracleManagedDataAccess library by adding a connection of type OracleConnection or DbConnection.
It also adds the ability to configure a container with an Oracle Database Free image (container-registry.oracle.com/database/free:latest).
To continue this work I need the following packages to be available in the nuget repository of this project:
AspNetCore.HealthChecks.Oracle 7.0.0
Oracle.ManagedDataAccess.Core 23.3.0-dev
Oracle.ManagedDataAccess.OpenTelemetry 23.2.0-dev