-
Notifications
You must be signed in to change notification settings - Fork 39
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 SurrealDB hosting/client integration #365
base: main
Are you sure you want to change the base?
Conversation
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.
Copilot reviewed 30 out of 45 changed files in this pull request and generated 1 comment.
Files not reviewed (15)
- CODEOWNERS: Language not supported
- CommunityToolkit.Aspire.sln: Language not supported
- Directory.Packages.props: Language not supported
- examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService/CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService.csproj: Language not supported
- examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService/Properties/launchSettings.json: Language not supported
- examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService/appsettings.json: Language not supported
- examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost/CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost.csproj: Language not supported
- examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost/Properties/launchSettings.json: Language not supported
- examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost/appsettings.json: Language not supported
- examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.ServiceDefaults/CommunityToolkit.Aspire.Hosting.SurrealDb.ServiceDefaults.csproj: Language not supported
- src/CommunityToolkit.Aspire.Hosting.SurrealDb/CommunityToolkit.Aspire.Hosting.SurrealDb.csproj: Language not supported
- src/CommunityToolkit.Aspire.Hosting.SurrealDb/PublicAPI.Shipped.txt: Language not supported
- src/CommunityToolkit.Aspire.Hosting.SurrealDb/PublicAPI.Unshipped.txt: Language not supported
- examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost/Program.cs: Evaluated as low risk
- README.md: Evaluated as low risk
Comments suppressed due to low confidence (2)
examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService/Program.cs:10
- [nitpick] The value 'CamelCase' for NamingPolicy might be ambiguous. Consider using a predefined constant or enum if available.
settings.Options!.NamingPolicy = "CamelCase";
examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService/Models/WeatherForecast.cs:10
- [nitpick] The constant name 'Table' should follow a consistent naming convention. Consider renaming it to 'TableName' or 'TableIdentifier'.
internal const string Table = "weatherForecast";
examples/surrealdb/CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService/Program.cs
Show resolved
Hide resolved
Having a look into the test failure, and it's because they are timing out, which made me think that the problem is to do with the container not starting. This is... sort of true, the container used for the tests does start, but it immediately exists because it's missing the You'll need to add The next place it seems to fail is that it can't resolve an My guess is that for the Looking at how you can register SurrealDB via their native SDK, I see you can pass a type argument that implements |
I will make the change and see how it goes.
Yes, it can take an
Yes, it was there because KeyedService did not exist. I will get rid of this feature because Keyed Service is a better solution. So, no need to change anything for this. |
I wasn't paying attention properly to the error I was seeing, it is when using the If you don't register keyed, it uses |
Is it uncommon that someone would create their own type that implements |
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.
Overall, the code is looking pretty much ready to go, with the obvious exception of the tests needing to be fixed.
Legacy approach |
I suppose bad copy/paste due to different commit changes. I will fix that. |
I kind of struggle with the conformance tests (non keyed). It fails to read I think it would be easier/better to only deal with connection string, at least for DB integrations which is the case here. I don't know what is the best practice for this. Can you guide me? |
Ok. I found the issue. I copied misleading code. :( Missing key in the default connection string. |
Cool, looks like that's sorted most of the tests and we're just going to wait for surrealdb/surrealdb.net#163 to be resolved to unblock most of the others. |
Closes #<ISSUE_NUMBER>
PR Checklist
Other information