-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OracleManagedDataAccess Aspire Component #1004
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oracle doesn't have a data source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I intend to update this code as soon as they implement DbDataSource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// <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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aspire:OracleManagedDataAccess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a well known connection string?
@@ -0,0 +1,22 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project/folder/package name should be Aspire.Oracle.ManagedDataAccess.Core
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
@@ -0,0 +1,22 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/// </summary> | ||
public static class AspireOracleManagedDataAccessExtensions | ||
{ | ||
private const string DefaultConfigSectionName = "Aspire:OracleManagedDataAccess"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private const string DefaultConfigSectionName = "Aspire:OracleManagedDataAccess"; | |
private const string DefaultConfigSectionName = "Aspire:Oracle:ManagedDataAccess:Core"; |
This should follow the name of the component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The connection should be transient? I would have guessed scoped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these used? If not, we shouldn't have properties for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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