Closed jkone27 closed 3 years ago
Sorry, what is the problem?
type Db = FSharp.Data.Npgsql.NpgsqlConnection<"Host=localhost;Username=postgres;Password=postgres;Database=postgres">
let deleteRememberMe cs (id: RememberMeTokenId) = async {
use cmd = Db.CreateCommand<"delete from remember_me where id = @id">(cs)
do! cmd.AsyncExecute %id }
a good idea could be to store also statically in a file the schema informations, like other providers do, to allow the type provider to work OFFLINE after establishing a first successful connection/generation.
That could be done easily, but it's Postgres that parses and type checks your query. Have fun recreating a full parser in .NET.
Hello, yes i was just re-watching 🥇 LOL and was about to remove my first part of comment :D :D :D . Thanks a lot!
Thanks @kerams my fault , will start using it right now!👍 Seems Awesome
Other SQL type provider give the ability to pass another connection string , e.g. using one for schema generation , and one for production usage.
From the docs this wasn's clear on how to use it. Maybe I missed it
e.g. https://fsprojects.github.io/FSharp.Data.SqlClient/
or https://fsprojects.github.io/SQLProvider/core/general.html
a very good reason is e.g. CI doesn't have access to prod sql connection.
a good idea could be to store also statically in a file the schema informations, like other providers do, to allow the type provider to work OFFLINE after establishing a first successful connection/generation.