🌉 bridged from @ragingHungryPanda@piefed.keyboardvagabond.com by Tidepool
ragingHungryPanda
@raginghungrypanda.piefed.keyboardvagabond.com.ap.tdpl.io
The cluster has been a lot healthier lately
The kubernetes cluster that Keyboard Vagabond runs on had some re-occurring issues that bugged me for a while and I think that I've final...
blog.keyboardvagabond.com
Blog - Shared Postgres Test Container with Expecto in FSharp
I'm learning FSharp by creating a web application. I've cycled through lots of different ways of doing things, libraries, etc. Today I finally got my integration tests to use a single docker test contaner with the Expecto test framework. I couldn't find a good example online of how to do it, so I'm sharing it here.
blog.keyboardvagabond.com
Blog - Shared Postgres Test Container with Expecto in FSharp
I'm learning FSharp by creating a web application. I've cycled through lots of different ways of doing things, libraries, etc. Today I finally got my integration tests to use a single docker test contaner with the Expecto test framework. I couldn't find a good example online of how to do it, so I'm sharing it here.
blog.keyboardvagabond.com
Navigating and Learning Data Access in FSharp
I wrote a blog post about me getting in to FSharp web application development, but am having issues deciding how I want the data access to look. I'm very much open to feedback!
blog.keyboardvagabond.com
Navigating and Learning Data Access in FSharp
I wrote a blog post about me getting in to FSharp web application development, but am having issues deciding how I want the data access to look. I'm very much open to feedback!
blog.keyboardvagabond.com
Navigating and Learning Data Access in FSharp
I wrote a blog post about me getting in to FSharp web application development, but am having issues deciding how I want the data access to look. I'm very much open to feedback!
blog.keyboardvagabond.com
Navigating and Learning Data Access in FSharp
I wrote a blog post about me getting in to FSharp web application development, but am having issues deciding how I want the data access to look. I'm very much open to feedback!
blog.keyboardvagabond.com
Navigating and Learning Data Access in FSharp
I wrote a blog post about me getting in to FSharp web application development, but am having issues deciding how I want the data access to look. I'm very much open to feedback!
blog.keyboardvagabond.com
Navigating and Learning Data Access in FSharp
I wrote a blog post about me getting in to FSharp web application development, but am having issues deciding how I want the data access to look. I'm very much open to feedback!
blog.keyboardvagabond.com
I'm not sure I'm doing things well in my FSharp side project and could use some feedback
I might be going a bit all over the place, but I appreciate anyone reading and offering input. I'm working on a side project that is an FSharp SAFE stack application. One of the issues that I've been running into is the multiple was of doing things, so I started out with some Saturn configuration, Fable.Remoting, and Giraffe endpoints and since I've upgraded to dotnet 10, I've eventually gotten rid of the Saturn components and almost exclusively am using Giraffe with dotnet EndpointRoutes so that I can better do things like e-tags and whatnot. Is this normal? But my main example is on the data access layer. I found that there were a lot of cool looking libraries and after playing around a bit, I decided that I like Dapper, Dapper.FSharp, and DbFun. DbFun does some cool stuff and looks like a more type safe Dapper with build or test run time evaluation of your queries, so a bad query or a typo will fail to build. It looks a bit like this (with explicit typing):
fsharp
let findByUserId (userId: UserId) (queryBuilder: QueryBuilder) : (IConnector<unit> -> Async<UserOption>)-> queryBuilder.Sql<UserId, User option>(someSql, "id") userIdThis is pretty cool. The but though is that the new http handlers don't take an
Async, they take aTask. It would be cool if it was possible to get the query object generated, but DbFun appears to be all partially applied functions, so I can't put it through a runner that returns aTask. Now, I can convert the Async to a Task, but I'd prefer not to switch between the two. I ran some tests between DbFun with Async converted to Task and Dapper and there was a difference in memory and execution time. It's not a huge deal and this is a side project, but I'd prefer to stick with one type up through the stack. This currently leaves me with using Dapper and the typical Repository pattern, though even this repo is getting bloated already. What I'm doing at the moment until I decide a direction is I'm creating the DbFun queries for testing and type safety stuff, but also putting those queries into my dapper commands wrapped with instrumentation:fsharp
// I'm pretty sure I can make some handlers for dapper to work with my single case DUs, but I'm still looking at the best way to do strong typing of IDs. member this.FindTask(id:IdentityId, mediaId: MediaId, ct: CancellationToken) : Task<SomeFindResponseType option> = let instrument = withDbActivity logger (nameof(findByUserIdAndMediaIdQuery)) (Some findByUserIdAndMediaIdSql) instrument(fun () -> task { let conn = connectionFactory() let mediaGuid: Guid = mediaId let guidValue = match id with | IdentityId guid -> guid let! result = conn.QuerySingleOrDefaultAsync< SomeFindResponseType >( CommandDefinition(findByUserIdAndMediaIdSql, {| id = guidValue.ToString(); mediaId = mediaGuid |}, cancellationToken = ct)) return Option.ofObj result })What is normally done with this sort of thing. Does anyone have any recommendations? Do most people go with the convenience of the FSharp libs and convert Async to Task and take the hit? Or do you just stick with dapper and maybe make a lightweight query/runner object to make things more functional?
- Photo Blog
The Art Islands of Naoshima and Teshima in Japan
I took a few days to visit the art islands of Naoshima and Teshima. As it was told to me, these islands knew that they were declining some decades ago and sought to revitalize themselves by bringing in artists to create exhibits and art houses. It seems to have worked.
Originally posted on !blogs_and_blogging@piefed.keyboardvagabond.com
blog.keyboardvagabond.com
- Photo Blog
The Art Islands of Naoshima and Teshima in Japan
I took a few days to visit the art islands of Naoshima and Teshima. As it was told to me, these islands knew that they were declining some decades ago and sought to revitalize themselves by bringing in artists to create exhibits and art houses. It seems to have worked.
Originally posted on !blogs_and_blogging@piefed.keyboardvagabond.com
blog.keyboardvagabond.com
- Photo Blog
Flowers and Gardens, Exploring Shikoku Island in Japan (Cross Post)
I am finishing up spending a month in the small town of ~7,000 people called Kothira, which is also home to the oldest Kabuki theater in ...
piefed.keyboardvagabond.com
- Photo Blog
Flowers and Gardens, Exploring Shikoku Island in Japan (Cross Post)
I am finishing up spending a month in the small town of ~7,000 people called Kothira, which is also home to the oldest Kabuki theater in ...
piefed.keyboardvagabond.com
I arrived in the small town of Ooarai in Japan
It's super small, but quaint with some small town charm.
pixelfed.keyboardvagabond.com
You can (and should) spend more time in Singapore
I just finished up a trip to Singapore and I think that if you have the time, you should totally spend more than the three days many say to stay. Here is my blog and photos on it
I recently finished a week long trip to Singapore to catch up with an old friend. When I told people that I was going there for a week, several people gave me a grimmaced look, and told me that I shouldn't stay there for longer than three days, and that I would be bored. I can safely tell you that I could have easily spent more than the week that I did, and I could happily do several weeks as a traveling nomad (especially if I was working).
blog.keyboardvagabond.com
You can (and should) spend more time in Singapore
I just finished up a trip to Singapore and I think that if you have the time, you should totally spend more than the three days many say to stay. Here is my blog and photos on it
I recently finished a week long trip to Singapore to catch up with an old friend. When I told people that I was going there for a week, several people gave me a grimmaced look, and told me that I shouldn't stay there for longer than three days, and that I would be bored. I can safely tell you that I could have easily spent more than the week that I did, and I could happily do several weeks as a traveling nomad (especially if I was working).
blog.keyboardvagabond.com
Blog - I had a new bit of learning with Kubernetes Event Driven Autoscaling today
Changing Piefed Worker Scaling to be Based on Queue Size in Kubernetes with KEDA I recently caused myself a bit of a minor issue by installing some updates on the Keyboard Vagabond cluster. It wasn't a big deal, just s...
blog.keyboardvagabond.com
what a chonk