on-internet
← Community

How to get a the ID of a field in a type F#

Stack Overflow ·

How do I create a function to search on a database and return just the ID of a type? Actually, I have a database, where I can search for a pair. The pair is a Type, in F#: module Types = [<CLIMutable>] type Pair = { Id :int64 PairName : string } My objective is to create a function, that return just the value of the ID (int) given a PairName. I Already have a function that returns a Pair, given this name. module Query = let GetSingleByName name = querySingleAsync<Types.Bird> { script "SELECT * FROM Pair WHERE PairName = @Name LIMIT 1" parameters (dict ["Name", box name]) } How can I return jus

Comments

Sign in or sign up to comment and upvote.

No comments yet.