diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-04 12:13:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-04 12:13:04 +0200 |
commit | 5ad4f467561511175c314018e0b3c6e30a3d145b (patch) | |
tree | bf10d97a50eaa54c11f884d0bc0bd870df49f93f /doc/manual.xhtml | |
parent | f12b9121475a2eb80c61a9aa5d76a7bdb0885214 (diff) |
Document MySQL DECIMAL mapping
Diffstat (limited to 'doc/manual.xhtml')
-rw-r--r-- | doc/manual.xhtml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/manual.xhtml b/doc/manual.xhtml index d98474f..2787129 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -19991,6 +19991,24 @@ class object }; </pre> + <p>The only built-in mapping provided for the MySQL <code>DECIMAL</code> + type is to <code>std::string/char[N]</code>, for example:</p> + + <pre class="cxx"> +#pragma db object +class object +{ + ... + + #pragma db type ("DECIMAL(6,3)") + std::string value_; +}; + </pre> + + <p>You can, however, map <code>DECIMAL</code> to a custom C++ type by + providing a suitable <code>odb::mysql::value_traits</code> + specialization.</p> + <p>It is also possible to add support for additional MySQL types, such as geospatial types. For more information, refer to <a href="#14.8">Section 14.8, "Database Type Mapping |