doc: Mention generics when declaring TableSchemas (#58)

This commit is contained in:
Adam Bergmark 2021-06-21 12:34:05 +02:00 committed by GitHub
parent 137ebeda89
commit 92f7c08300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,6 +147,15 @@ And likewise for ``project`` and ``Project``::
}
}
There is also some generics machinery available if you want to grab the field information from your Rel8able type::
projectSchema :: TableSchema (Project Name)
projectSchema = TableSchema
{ name = "project"
, schema = Nothing
, columns = namesFromLabels @(Project Name)
}
.. note::