circuithub / rel8

Hey! Hey! Can u rel8?
https://rel8.readthedocs.io
Other
150 stars 38 forks source link

Introduce QualifiedName (fixes #228) #257

Closed shane-circuithub closed 12 months ago

shane-circuithub commented 12 months ago

This adds a new type QualifiedName for named PostgreSQL objects (tables, views, functions and sequences) that can optionally be qualified by a schema. Previously only TableSchema could be qualified in this way.

QualifiedName has an IsString instance so the common case (where the schema is Nothing) doesn't have to care about schemas (if OverloadedStrings is enabled).

This also refactors TableSchema to use QualifiedName for its name field and drops its schema field.

Thanks to @elldritch for the bug report and the inspiration.