Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Question] Are composite types defined in PostgreSQL supported by SQLProvider?

Đang mở
#427 12 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ả

enhancement postgresql
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

  1. 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).
  2. 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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fsprojects/SQLProvider

Tất cả issue của fsprojects/SQLProvider

Issue tương tự

Thêm issue về Databases

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.