-
Notifications
You must be signed in to change notification settings - Fork 11
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 documentation on how to use Fluent(Kit) #10
Comments
What you're doing is fine. Though you're still right that there should be more documentation on how to use swift-openapi-vapor with existing Vapor projects, and that's something we should work on. |
I don't think this is correct though. The If you have a reference let database = databases.database(on: databases.eventLoopGroup.any()) This should make full use of all of your EventLoops when performing database operations. |
@adam-fowler is right. |
@MahdiBM i guess that is the point of the issue there is no documentation covering this. |
@adam-fowler @MahdiBM Your example uses the EventLoop, does this also apply async/await projects? |
Vapor and basically all other server-side libraries that support async-await still use EventLoops underneath. So yes, it does apply. |
Err @MahdiBM do you know what happened to the generated tutorials? @jbehrens94 You can see the source here https://github.com/swift-server/swift-openapi-vapor/tree/main/Sources/OpenAPIVapor/Documentation.docc/Tutorials We'll work on getting them fixed (and the README link updated!) |
@jbehrens94 @0xTim It's available here: https://swiftpackageindex.com/swift-server/swift-openapi-vapor/main/tutorials/swift-openapi-vapor/requestinjection |
Currently, I am working on a side project using this Vapor OpenAPI generated package. I am missing documentation on how to use Fluent with the generated code. I would like to use Fluent and I think this is going to be a big use case.
An example of my code:
Which results in a warning:
Stored property 'db' of 'Sendable'-conforming struct 'UserController' has non-sendable type 'any Database'
. Therefore, I would like to request documentation on how I am supposed to build out my Vapor app with FluentKit.The text was updated successfully, but these errors were encountered: