5

I am trying to call a stored procedure in postgresql from F# using the Npgsql type provider.

Currently, I am connected to the database as follows:

open System
open System.Data
open System.Data.Entity
open System.Data.Linq
open Microsoft.FSharp.Data.TypeProviders
open Microsoft.FSharp.Linq
open Npgsql
open NpgsqlTypes

type internal dbSchema = SqlEntityConnection<ConnectionString="**my connection string**", Provider="Npgsql">

let internal db = dbSchema.GetDataContext()

However, I only see the tables on the db type, not any of the stored procedures. Is there a way to use the stored procedures in a statically typed manner through the type provider, instead of just calling the raw query string?

4

2 に答える 2

0

ご覧のとおり、これは npgsql、f#、および npgsqltypes の間のどこかでサポートされていないようです。ここで良い答えが得られる可能性は非常に低いです。なぜなら、この言語、そのアーキテクチャ、およびパズルの各ピースがどこに依存しているかを深く理解している人が必要だからです。また、何が問題なのかを確認するためにデバッグが必要になる場合もあります。

以前の提案は次のとおりです。

  1. PostgreSQL には実際にはストアド プロシージャ自体がないため、F# はそれらを認識しない可能性があります。

  2. npgsqltypes には、マッピングに関するいくつかの重要な側面が欠けている可能性があります。

npgsql は、理論的にはタイプ プロバイダー自体がルックアップを実行できるはずなので、これを調べ始める場所ではないと思います。

そのため、関連するメーリング リストに参加して、型プロバイダーの問題であると仮定して、これについて質問することをお勧めします。トラブルシューティングについて十分な知識を持っている人は、おそらくこれらのメーリング リストに参加しているでしょう。

于 2013-09-21T10:52:37.077 に答える