[Question] Are composite types defined in PostgreSQL supported by SQLProvider?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- fsharp, postgresql
- Lĩnh vực
- databases
Hướng nghiên cứu
Bắt đầu với PostgreSQLTests.fsx và theo dõi cách SQLProvider phát hiện và biểu diễn các tham số của stored procedure. So sánh chữ ký kiểu composite được báo cáo với các ví dụ kiểu PostgreSQL hiện có và workaround của Npgsql. Được xem là hoàn thành khi xác định được các kiểu composite có được hỗ trợ hay không, đồng thời mapping hoặc giới hạn cần thiết đã được ghi lại hoặc kiểm thử.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- F#
- Star
- 627
- Fork
- 147
- Merge trung bình
- 2 giờ 2 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fsprojects/SQLProvider
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
fsprojects/SQLProvider#872 · 2 bình luận ·
-
Repo Assist? Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
fsprojects/SQLProvider#870 · 1 bình luận ·
-
postgresql
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
fsprojects/SQLProvider#869 · 2 bình luận ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 42/100
fsprojects/SQLProvider#868 · 2 bình luận ·
-
sql server
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fsprojects/SQLProvider#851 · 1 bình luận ·
Tất cả issue của fsprojects/SQLProvider
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
AstrBotDevs/AstrBot#10205 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OHDSI/Data2Evidence#3394 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100