1推荐信号
1讨论来源
2026-02-18最近提及
为什么 HN 用户提到它?
自动整理的讨论摘录,保留原始英文。阅读原文了解完整语境。
My favourite Postgres one is: https://github.com/Zaid-Ajaj/Npgsql.FSharp https://github.com/Zaid-Ajaj/Npgsql.FSharp This simple sample executes query and read results as table then map the results open Npgsql.FSharp type User = { Id: int FirstName: string LastName: string } let getAllUsers (connectionString: string) : User list = connectionString |> Sql.connect |> Sql.query "SELECT * FROM users" |> Sql.execute (fun read -> { Id = read.int "user_id" FirstName = read.text "first_name" LastName = read.text "last_name" })阅读完整讨论