demetrixbio / FSharp.Data.Npgsql

F# type providers to support statically typed access to input parameters and result set of sql statement in idiomatic F# way. Data modifications via statically typed tables.
Apache License 2.0
127 stars 16 forks source link

Support composite types #73

Closed kerams closed 2 years ago

kerams commented 4 years ago

Aims to implement #9. Does not currently support fields that are themselves composite types or enums (they're provided as obj, so it's possible to manually cast them).

use cmd = DvdRental.CreateCommand<"select * from table_with_composites">(cs)
let res = cmd.Execute()
let a = res.Head.complex.Value.nested_composite // Option<obj>
let b = res.[4].simple.some_array // Option<int64[]>
kerams commented 2 years ago

Not viable in Npgsql 5+ because dynamic mapping of composite types is no longer supported. I reckon a generative type provider would help, but I have no experience with that.