Closed Slesa closed 1 year ago
This library does not provide ORM style mappings, so if you want to insert a record, it needs to map one-to-one with the table. Your example shows a parent-child object graph (User-Password). If you want to insert this with D.FS, you would need to flatten it by moving the Password fields into the User record (depending on your table schema).
Yup, as @JordanMarr says - it needs to be flattened as it's written in the documentation 👉 https://github.com/Dzoukr/Dapper.FSharp#do-i-need-to-create-a-record-with-all-columns
Closing as it's not an issue 😁
I'm trying out some proof of concepts, using the example from another F# implementation. There is a user database, with name and passwort, where the pw is a discriminated union - either plain text or a hash with its salt.
As I am questioning the sense of storing plain text pws, I've removed the union, so I want to store the following in the db:
Is there an example how to store this in a database-agnostic way?