PrevUpHomeNext

Polymorphically Mapped Types

Polymorphically mapped types are C++ types that can have different concrete mapper clases --and hence different column representations-- to suit different circumstances. E.g. a C++ bool has one mapper class that represents it as an SQL boolean for PostgreSQL, and another that represents it as an SQL integer for sqlite; and an application can give it still more mapper classes, to represent it in customized ways on a per-database or per-table basis.

All bool's concrete mapper classes are supplied by the backend libraries and (possibly) by application code; not by quince itself. That is the case for:

Quince does, however, provide a concrete mapper class for serial. Future backends might provide their own, but quince_postgresql and quince_sqlite have no need to do so.

The backend-supplied concrete mapper classes will be detailed in later sections, as will the means for application code to supply concrete mapper classes.

In general, if PM is a polymorphically mapped type, then application code does not have access to its concrete mapper classes. It treats PM's mapper objects polymorphically, via the interface abstract_mapper<PM>. Examples:


PrevUpHomeNext