summaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-09-10 12:12:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-09-10 12:12:06 +0200
commit3ac67fb63eec3534046fe2eb72bc2d37aca1cd98 (patch)
tree8d5938b6666fc5387286effa905562f11124220b /odb
parent275245dfefd73f5e4e81e46637ade03315408fb6 (diff)
Add support for alternative UTF-16 image for TEXT in SQLite
Use it to handle QString and support std::wstring on Windows.
Diffstat (limited to 'odb')
-rw-r--r--odb/relational/sqlite/context.cxx3
-rw-r--r--odb/relational/sqlite/source.cxx4
2 files changed, 5 insertions, 2 deletions
diff --git a/odb/relational/sqlite/context.cxx b/odb/relational/sqlite/context.cxx
index 52c7751..5dc3fa8 100644
--- a/odb/relational/sqlite/context.cxx
+++ b/odb/relational/sqlite/context.cxx
@@ -53,7 +53,8 @@ namespace relational
{"float", "REAL", 0, true},
{"double", "REAL", 0, true},
- {"::std::string", "TEXT", 0, false}
+ {"::std::string", "TEXT", 0, false},
+ {"::std::wstring", "TEXT", 0, false}
};
}
diff --git a/odb/relational/sqlite/source.cxx b/odb/relational/sqlite/source.cxx
index 1e93568..7d29c1e 100644
--- a/odb/relational/sqlite/source.cxx
+++ b/odb/relational/sqlite/source.cxx
@@ -51,7 +51,9 @@ namespace relational
virtual void
traverse_text (member_info& mi)
{
- os << b << ".type = sqlite::bind::text;"
+ os << b << ".type = sqlite::image_traits<" << endl
+ << " " << mi.fq_type () << "," << endl
+ << " sqlite::id_text>::bind_value;"
<< b << ".buffer = " << arg << "." << mi.var << "value.data ();"
<< b << ".size = &" << arg << "." << mi.var << "size;"
<< b << ".capacity = " << arg << "." << mi.var <<