{"repo":"Zaid-Ajaj/Npgsql.FSharp","free":true,"listed":false,"github":"https://github.com/Zaid-Ajaj/Npgsql.FSharp","clone":"git clone https://github.com/Zaid-Ajaj/Npgsql.FSharp.git","description":"Thin F# wrapper around Npgsql, the PostgreSQL database driver for .NET","language":"F#","stars":339,"topics":["postgresql","npgsql","fsharp","analyzer"],"license":"MIT","category":"databases-storage","readme_excerpt":"Npgsql.FSharp Thin F#-friendly layer for the Npgsql data provider for PostgreSQL. For an optimal developer experience, this library is made to work with Npgsql.FSharp.Analyzer which is a F# analyzer that will verify the query syntax and perform type-checking against the parameters and the types of the columns from the result set. Read the full documentation at zaid-ajaj.github.io/Npgsql.FSharp Install from nuget Start using the library First thing to do is aquire your connection string some how. For example using environment variables, a hardcoded value or using the builder API Once you have a connection string you can start querying the database: Sql.execute : Execute query and read results as table then map the results The main function to execute queries and return a list of a results is Sql.execute : Deal with null values and provide defaults Notice the LastName field becomes string option instead of string Then you can use defaultArg or other functions from the Option to provide default values when needed. Make the reading async using Sql.executeAsync The exact definition is used, except that Sql.execute becomes Sql.executeAsync Sql.parameters : Parameterized queries Provide parameters using the Sql.parameters function as a list of tuples. When using the analyzer, make sure you use functions from Sql module to initialize the values so that the analyzer can type-check them against the types of the required parameters. Sql.executeRow : Execute a query and read a single row","default_branch":null,"files":null,"tree":[],"storefront":"/r/Zaid-Ajaj","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Zaid-Ajaj/Npgsql.FSharp/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}