Skip to content

Basic tutorial seems out of date #599

@tysonzero

Description

@tysonzero

It uses leftJoin which the docs specify as not recommended in favor of optionalRestrict, optionalRestrict doesn't mention anything about being not recommended but I get the impression that the arrow syntax in general is semi-deprecated in favor of the monadic syntax.

Similarly it uses FieldNullable extensively but the "Working with NULL" section of Opaleye.Field mentions you should be using Opaleye.MaybeFields instead, although that itself also confuses me as for individual nullable columns it seems like the former is more appropriate, even if the latter will work nicely for outer joins.

This is less of an "out of date" thing but the newtype section being so short and not tied into the rest of it is also making it rather unclear to me what the "idiomatic" way to work with those newtypes is in less trivial situations. For example I'm currently using ors instead of in_ so that I can use the .=== machinery. I'm also trying to work with nullable type-safe foreign keys and it's not obvious to me how to preserve the type safety, as .=== doesn't allow nulls (but does allow MaybeFields?) and matchNullable doesn't have the Default machinery.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions