[Question] Are composite types defined in PostgreSQL supported by SQLProvider?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- fsharp, postgresql
- Ambito
- databases
Direzione di ricerca
Inizia da PostgreSQLTests.fsx e traccia il modo in cui SQLProvider individua e rappresenta i parametri delle stored procedure. Confronta la firma del tipo composito segnalata con gli esempi esistenti di tipi PostgreSQL e il workaround di Npgsql. Il lavoro è completo quando è stato stabilito se i tipi compositi sono supportati e il mapping o la limitazione richiesti sono stati documentati o testati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Database has composite types defined which are input/output types to stored procedures. I am attempting to call the said procedure with input parameters. SqlProvider does not see the input parameter and assumes it is a void function.
Repro steps
The composite type defined in the database is
CREATE TYPE product_t AS
(name text,
product_type text)
The signature of procedure in the database is
create or replace function func_iproduct( p product_t ) returns void as
On .NET side (F#), I have created a type
type PgProductType(Name:string,ProductType:string)=
member this.Name = Name
member this.ProductType = ProductType
new() = PgProductType("","")
I believe there should be a way in which I could tell SqlProvider how to map PgProductType to product_t; not sure if this is required or such mapping is automatic. If required, an example how do I go about doing it would be helpful. Without this mapping, if I attempt to execute the procedure, the error message it reports back indicates that SqlProvider does NOT see the input parameter;
let prd = new PgProductType("F#Product","")
ctx.Functions.FuncIproduct.Invoke(prd)
stdin(29,1): error FS0501: The member or object constructor 'Invoke' takes 0 argument(s) but is here given 1. The required signature is 'SqlDataProvider<...>.dataContext.Functions.FuncIproduct.Result.Invoke() : Unit'.
Question
- Can I use postgresql composite types? If so, an illustrative example would help.The test suite PostgreSQLTests.fsx does not contain an example to map custom types (though there are examples to map pre-defined postgresql types).
- Any alternative solution short of re-implementing queries (using query expressions) foregoing the existing procedures?
Known workarounds
Directly use Npgsql
Related information
- PostgreSQL 9.6
- Win 7
- Lingua principale
- F#
- Stelle
- 627
- Fork
- 147
- Merge medio
- 2h 2m
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fsprojects/SQLProvider
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
fsprojects/SQLProvider#872 · 2 commenti ·
-
Repo Assist? Apertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
fsprojects/SQLProvider#870 · 1 commento ·
-
postgresql
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
fsprojects/SQLProvider#869 · 2 commenti ·
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
fsprojects/SQLProvider#868 · 2 commenti ·
-
sql server
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
fsprojects/SQLProvider#851 · 1 commento ·
Tutte le issue di fsprojects/SQLProvider
Issue simili
-
Add: New Channel Pop! Apertachannels:add check:passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
confluentinc/dbt-confluent#160 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
AstrBotDevs/AstrBot#10205 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100